Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SX: unable to reduce motion inside keyframes #2808

Open
mrtnzlml opened this issue Jul 27, 2021 · 0 comments
Open

SX: unable to reduce motion inside keyframes #2808

mrtnzlml opened this issue Jul 27, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@mrtnzlml
Copy link
Member

It seems like keyframes are fairly limited in what can go inside. Specifically, we allow only raw styles without any pseudo or media definitions. I wanted to write something like this (and it didn't work):

const bounce = sx.keyframes({
  '33%': { transform: `translateY(-10px)` },
  '66%': {
    'transform': `translateY(10px)`,
    '@media (prefers-reduced-motion: no-preference)': {
      fill: 'rgba(var(--sx-accent-5))',
    }
  },
});

I actually don't know if this should be allowed or if it should work. At least, we should throw a warning/error explaining this is not supported (instead of quietly ignoring it).

See: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion

@mrtnzlml mrtnzlml added the bug Something isn't working label Jul 27, 2021
@mrtnzlml mrtnzlml added this to To do in SX, SX Design via automation Jul 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

1 participant