Variable X is undefined and used without a fallback
madsfors opened this issue ยท 7 comments
Hi ๐ It's an issue with the postcss-css-variables plugin: if the variables are not defined in the :root, it throws a warning. The variables are defined and work fine (e.g., the --gap-x variable is defined in the .grid class).
Hi Sebastiano. Thanks for the reply! The variables work as expected (and thus works ๐ in any modern browser), but whenever using the generated style-fallback.css, the styling seems to break. I'm in the (unfortunate) situation that I have to support IE11 so I'm experiencing code that turns out with "undefined" declarations. This is i.e. happening with the lists component. See below:
How would you suggest fixing this issue?
Hi! Moving the custom properties to the :root element should fix the issue:
:root {
--list-space-y: var(--space-xxs); // vertical gaps
--list-offset: var(--space-xs); // sublist horizontal offset
--list-line-height: var(--body-line-height); // items line-height
}
I'll give it a test ๐
We just published a new version of the List component that fixes the IE issues:
https://codyhouse.co/ds/components/app/list
Perfect. Thanks a lot!