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…
Register and Use WordPress Block Patterns for Reusable Layouts

Register and Use WordPress Block Patterns for Reusable Layouts

Register and use WordPress block patterns for reusable layouts Block patterns are ready-made arrangements of blocks that an editor inserts with one click: a hero section, a testimonial grid, a pricing table. For the block editor they are what shortcodes and copy-pasted HTML were for the classic one, only better: after insertion they are normal…
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…