WordPress Developer Ukraine, Kyiv
Native CSS Nesting in WordPress Themes Without a Preprocessor

Native CSS Nesting in WordPress Themes Without a Preprocessor

Native CSS nesting in WordPress themes without Sass Many themes still compile Sass for one reason: nesting. Writing the rules of a component inside the component’s selector keeps them together and readable. Browsers can do that natively now, and together with custom properties, which replaced Sass variables long ago, a small or medium theme can…
CSS Scroll-Driven Animations with animation-timeline in WordPress Themes

CSS Scroll-Driven Animations with animation-timeline in WordPress Themes

Scroll-driven animations with animation-timeline in a WordPress theme Fade-in effects for sections and a reading progress bar used to need JavaScript: an Intersection Observer or a scroll listener that sets classes or styles. With animation-timeline, a normal CSS @keyframes animation runs along the scroll position instead of along time. The browser does it off the…
Style Parent Elements Conditionally with the CSS :has() Selector

Style Parent Elements Conditionally with the CSS :has() Selector

Style parents conditionally with the CSS :has() selector For years CSS could only look down the tree: style a child depending on its parent, never the other way round. :has() changes that. .card:has(img) matches a card that contains an image, and the theme no longer needs PHP or JavaScript to add classes like has-thumbnail. Since…