Changeset 51677
- Timestamp:
- 08/27/2021 09:35:17 AM (3 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/wp/customize/controls.js
r51417 r51677 6 6 (function( exports, $ ){ 7 7 var Container, focus, normalizedTransitionendEventName, api = wp.customize; 8 9 var reducedMotionMediaQuery = window.matchMedia( '(prefers-reduced-motion: reduce)' ); 10 var isReducedMotion = reducedMotionMediaQuery.matches; 11 reducedMotionMediaQuery.addEventListener( 'change' , function handleReducedMotionChange( event ) { 12 isReducedMotion = event.matches; 13 }); 8 14 9 15 api.OverlayNotification = api.Notification.extend(/** @lends wp.customize.OverlayNotification.prototype */{ … … 1265 1271 */ 1266 1272 _animateChangeExpanded: function( completeCallback ) { 1267 // Return if CSS transitions are not supported. 1268 if ( ! normalizedTransitionendEventName ) { 1269 if ( completeCallback ) { 1270 completeCallback(); 1271 } 1273 // Return if CSS transitions are not supported or if reduced motion is enabled. 1274 if ( ! normalizedTransitionendEventName || isReducedMotion ) { 1275 // Schedule the callback until the next tick to prevent focus loss. 1276 _.defer( function () { 1277 if ( completeCallback ) { 1278 completeCallback(); 1279 } 1280 } ); 1272 1281 return; 1273 1282 } -
trunk/src/wp-admin/css/customize-controls.css
r51456 r51677 106 106 } 107 107 108 @media (prefers-reduced-motion: reduce) { 109 #customize-sidebar-outer-content { 110 transition: none; 111 } 112 } 113 108 114 #customize-theme-controls .control-section-outer { 109 115 display: none !important; … … 122 128 left: 100%; 123 129 transition: left .18s; 130 } 131 132 @media (prefers-reduced-motion: reduce) { 133 .outer-section-open .wp-full-overlay.expanded #customize-sidebar-outer-content { 134 transition: none; 135 } 124 136 } 125 137 … … 538 550 } 539 551 552 @media (prefers-reduced-motion: reduce) { 553 #customize-theme-controls .accordion-section-title, 554 #customize-outer-theme-controls .accordion-section-title { 555 transition: none; 556 } 557 } 558 540 559 #customize-controls #customize-theme-controls .customize-themes-panel .accordion-section-title { 541 560 color: #50575e; … … 634 653 box-sizing: border-box; 635 654 transition: 0.18s transform cubic-bezier(0.645, 0.045, 0.355, 1); /* easeInOutCubic */ 655 } 656 657 @media (prefers-reduced-motion: reduce) { 658 #customize-info, 659 #customize-theme-controls .customize-pane-parent, 660 #customize-theme-controls .customize-pane-child { 661 transition: none; 662 } 636 663 } 637 664 … … 1722 1749 background: #f0f0f1; 1723 1750 z-index: 20; 1751 } 1752 1753 @media (prefers-reduced-motion: reduce) { 1754 .control-panel-themes .customize-themes-full-container { 1755 transition: none; 1756 } 1724 1757 } 1725 1758
Note: See TracChangeset
for help on using the changeset viewer.