Skip to content

How can I override the motion-safe: and motion-reduced: query variants 😬 #18596

Answered by wongjn
kylemh asked this question in Help
Discussion options

You must be logged in to vote

You can add a custom variant using the same variant names - motion-safe and motion-reduce - to override them. For example:

@custom-variant motion-safe {
  @media (prefers-reduced-motion: no-preference) {
    @slot;
  }
  &:where([data-ignore], [data-ignore] *) {
    @slot;
  }
}

@custom-variant motion-reduce {
  @media (prefers-reduced-motion: reduce) {
    @slot;
  }
  &:where([data-ignore], [data-ignore] *) {
    @slot;
  }
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kylemh
Comment options

Answer selected by kylemh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants