Lea Verou 12.10.2020

The -​-var: ; hack to toggle multiple values with one custom property

Przeczytaj oryginał

This article explains a clever CSS hack using custom properties. By setting a property like `--foo: ;` (a single space), you can use `var(--foo, fallback-value)` to conditionally append or remove multiple style values (like gradients, borders, shadows) across different properties and rules, acting as a single-clause conditional.

The -​-var: ; hack to toggle multiple values with one custom property

komentarzy

Brak komentarzy

Bądź pierwszy, który podzieli się swoimi myślami!

Rozszerzenie przeglądarki

Uzyskaj natychmiastowy dostęp do AllDevBlogs z przeglądarki

Tydzień

No top articles yet