Make WordPress Core


Ignore:
Timestamp:
03/10/2022 05:19:50 AM (3 years ago)
Author:
peterwilsoncc
Message:

Twenty Twenty-One: Reverse logic for prefers-reduced-motion media query.

Reverse the logic of the prefers-reduced-motion to enable transitions based on no-preference rather than disable them based on the reduce preference. This removes the need to disable transitions with the ! important tag and unintended interactions with plugins as a result.

Props gregoiresailland, sabernhardt, ryokuhi.
Fixes #54174.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentytwentyone/assets/sass/style-dark-mode.scss

    r51253 r52835  
    4747        &.fixed-bottom {
    4848            position: fixed;
    49             bottom: 5px;
     49            bottom: 5px; // The bottom property has transition (see below).
    5050            right: 5px;
    51             transition: bottom 0.5s;
    5251
    5352            &.hide:not(:focus) {
     
    9897            display: none;
    9998        }
     99
     100        &.fixed-bottom {
     101            @media (prefers-reduced-motion: no-preference) {
     102                transition: bottom 0.5s;
     103            }
     104        }
    100105    }
    101106}
Note: See TracChangeset for help on using the changeset viewer.