WordPress Developer Ukraine, Kyiv
CSS color-mix() and oklch: Modern Color Systems for WordPress Themes

CSS color-mix() and oklch: Modern Color Systems for WordPress Themes

color-mix() and OKLCH: a color system for a WordPress theme from one variable A theme palette usually needs more colors than the brand has: a lighter tint for backgrounds, a darker shade for hover, a transparent version for borders. Without a preprocessor these ended up as a dozen hard-coded hex values that drift apart when…
CSS @layer: Managing Cascade Layers in WordPress Themes

CSS @layer: Managing Cascade Layers in WordPress Themes

CSS cascade layers (@layer) in a WordPress theme In a WordPress page, the CSS comes from many places: core block styles, global styles from theme.json, the theme, every plugin. Which rule wins depends on specificity and order, and themes end up with long selectors or !important to beat a plugin. @layer adds a new step…
View Transitions API: Smooth Page Transitions in WordPress Themes

View Transitions API: Smooth Page Transitions in WordPress Themes

View Transitions in a WordPress theme: smooth page changes without a framework A click on a link in a WordPress site replaces the whole page at once. Single-page apps animate between states, and themes copied that with AJAX navigation and animation libraries. The View Transitions API lets the browser do the animation: it takes a…
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…