-
Notifications
You must be signed in to change notification settings - Fork 17
Description
What happened?
When defining typography tokens using CSS variables with UniWind, variables work correctly as long as they are declared only once.
However, when the same variables are redefined inside @media queries, an unexpected behavior occurs: all text-related utilities resolve to the same computed font-size.
This makes it impossible to implement responsive typography using CSS variables, which is a core requirement for design-system-based setups.
Steps to Reproduce
Works correctly:
`@import 'tailwindcss';
@import 'uniwind';
@layer theme {
:root {
--text-xs: 0.75rem;
--text-sm: 0.875rem;
--text-base: 1rem;
--text-lg: 1.125rem;
--text-xl: 1.25rem;
}
}
`
Text utilities (text-xs, text-base, text-lg, etc.) resolve correctly.
Breaks when adding media queries
`@import 'tailwindcss';
@import 'uniwind';
@layer theme {
:root {
--text-base: 1rem;
--text-lg: 1.125rem;
}
}
@media (min-width: 640px) {
:root {
--text-base: 1.125rem;
--text-lg: 1.375rem;
}
}
`
Snack or Repository Link
https://gist.github.com/Atotaro98/f0cd7356d425723371c87fa66da9fa21
Uniwind version
1.2.2
React Native Version
0.83.0
Platforms
iOS, Android
Expo
No
Additional information
- I've searched for similar issues in this repository and found none