WordPress Developer Ukraine, Kyiv
CSS @supports: Progressive Enhancement and Feature Detection

CSS @supports: Progressive Enhancement and Feature Detection

@supports: progressive enhancement for new CSS in a theme A theme that uses new CSS features faces the same question again and again: what do visitors with an older browser see? @supports answers it explicitly. The basic layout works everywhere, and the enhanced version applies only where the browser understands the feature, tested by a…
CSS if() Function: Inline Conditionals in Custom Properties

CSS if() Function: Inline Conditionals in Custom Properties

The CSS if() function: conditional values inside a declaration Until now, CSS chose between values only through selectors and at-rules: a class, a media query, an @supports block, each repeating the property. The if() function puts the condition into the value itself. A component can switch a value based on a custom property, a media…
CSS @scope Rule: Scoped Styles Without Frameworks

CSS @scope Rule: Scoped Styles Without Frameworks

CSS @scope: styles that stay inside a component A rule like .card a { color: inherit; } also hits links in a newsletter form that someone places inside the card, and .prose p styles paragraphs in a nested block that should look different. BEM class names and growing specificity were the workarounds. @scope limits rules…