Replies: 2 comments 2 replies
-
isn't there a postcss plugin for that kind of logic ? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Not sure why this feature request was resolved without comment 🤷 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
As described in #846, it would be helpful if there was a way to define multiple values for the same property.
Example in plain css:
Browsers will automatically apply the last declaration they understand. Old browsers that do not understand the
dwh
unit will ignore that declaration and fall back to the previous one.In styled-components it's possible to utilize this when using the template literal syntax.
Problem Statement/Justification
Sometimes we need to write backwards-compatible css for older browsers. Ideally with good deleteability. So it would be great to be able to utilize this browser-native way of declaring fallback values.
Proposed Solution or API
Not really sure because array syntax is already used as an alternative syntax for defining responsive styles.
Alternatives
A complicated workaround is shown in #846. Not really great though.
Additional Information
E.g. this is how vanilla-extract does it: https://vanilla-extract.style/documentation/styling/#fallback-styles
Beta Was this translation helpful? Give feedback.
All reactions