You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browsers will automatically apply the last declaration they understand. Old browsers that do not understand the [dvh] unit will ignore that declaration and fall back to the previous one.
While in #1109 it was proposed to use PostCSS plugin, that only addresses general problems, like usage of dvh, but does not address browser specific syntax or preferred behavior as shown in #2992
Proposed solution
Implement fallback() function that generates utility classes employing fallback mechanism. Example:
Order of values is preferred-to-fallback to help people hanlding values quickly. fallback-to-preferred order, used in native CSS, was born from technical considirations, not developer usability.
Array syntax (as in vanilla-extract) is already used in responsive values and responsive values are seem to be used much frequently than fallbacks.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
CSS supports fallback mechanism by order of properties declaration. Quote from #1109:
While in #1109 it was proposed to use PostCSS plugin, that only addresses general problems, like usage of
dvh
, but does not address browser specific syntax or preferred behavior as shown in #2992Proposed solution
Implement
fallback()
function that generates utility classes employing fallback mechanism. Example:that'll result in following css:
Proposed syntax
Considered options
Related discussions:
Beta Was this translation helpful? Give feedback.
All reactions