Make WordPress Core

Changeset 59989


Ignore:
Timestamp:
03/16/2025 08:25:35 PM (6 weeks ago)
Author:
joedolson
Message:

Customizer: A11y: Respect prefers-reduced-motion.

Several significant animations in the customizer did not respect prefers reduced motion. Change CSS to wrap animations in @media queries to verify user preferences.

Props wildworks, sainathpoojary, abcd95, joedolson, audrasjb.
Fixes #62806.

Location:
trunk/src/wp-admin/css
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/customize-controls.css

    r59942 r59989  
    843843    text-align: left;
    844844    cursor: pointer;
    845     transition:
    846         color .15s ease-in-out,
    847         border-color .15s ease-in-out,
    848         background .15s ease-in-out;
    849845    box-sizing: content-box;
     846}
     847
     848@media (prefers-reduced-motion: no-preference) {
     849    .customize-controls-close {
     850        transition:
     851            color .15s ease-in-out,
     852            border-color .15s ease-in-out,
     853            background .15s ease-in-out;   
     854    }
    850855}
    851856
  • trunk/src/wp-admin/css/customize-nav-menus.css

    r59224 r59989  
    721721}
    722722
    723 #customize-preview {
    724     transition: all 0.2s;
     723@media (prefers-reduced-motion: no-preference) {
     724    #customize-preview {
     725        transition: all 0.2s;
     726    }
    725727}
    726728
  • trunk/src/wp-admin/css/customize-widgets.css

    r51727 r59989  
    262262}
    263263
    264 #customize-preview {
    265     transition: all 0.2s;
     264@media (prefers-reduced-motion: no-preference) {
     265    #customize-preview {
     266        transition: all 0.2s;
     267    }
    266268}
    267269
  • trunk/src/wp-admin/css/themes.css

    r59821 r59989  
    16491649
    16501650/* Animations */
    1651 .wp-full-overlay,
    1652 .wp-full-overlay-sidebar,
    1653 .wp-full-overlay .collapse-sidebar,
    1654 .wp-full-overlay-main {
    1655     transition-property: left, right, top, bottom, width, margin;
    1656     transition-duration: 0.2s;
     1651@media (prefers-reduced-motion: no-preference) {
     1652    .wp-full-overlay,
     1653    .wp-full-overlay-sidebar,
     1654    .wp-full-overlay .collapse-sidebar,
     1655    .wp-full-overlay-main {
     1656        transition-property: left, right, top, bottom, width, margin;
     1657        transition-duration: 0.2s;
     1658    }
    16571659}
    16581660
Note: See TracChangeset for help on using the changeset viewer.