#css-custom-properties

[ follow ]
fromCSS-Tricks
4 days ago

On Inheriting and Sharing Property Values | CSS-Tricks

Sometimes I want to set the value of a CSS property to that of a different property, even if I don't know what that value is, and even if it changes later. Unfortunately though, that's not possible (at least, there isn't a CSS function that specifically does that). In my opinion, it'd be super useful to have something like this (for interpolation, maybe you'd throw in there as well): /* Totally hypothetical */ button { border-radius: compute(height, self); border-radius: compute(height, inherit); border-radius: compute(height, #this); }
Web development
Web development
fromPiccalilli
2 months ago

A workaround for using custom properties in media queries

Use container style queries plus @property and vi units to emulate media queries using custom properties and computed length comparisons.
Web design
fromPiccalilli
4 months ago

A revisit of the Every Layout sidebar with :has() and selector performance

The Sidebar layout provides adaptability without requiring @media queries.
UX design
fromAlways Twisted
7 months ago

CSS Custom Properties vs. Sass Variables: A Pragmatic Guide Always Twisted

Sass variables are for compile-time constants; CSS custom properties offer runtime flexibility for theming.
[ Load more ]