WordPress Developer Ukraine, Kyiv
CSS Individual Transform Properties: translate, rotate, scale

CSS Individual Transform Properties: translate, rotate, scale

translate, rotate and scale as separate CSS properties transform is one property with a list of functions. A hover effect that only wants to scale a card has to repeat the card’s existing translate(), or it removes it; an animation of the rotation overwrites the position set elsewhere. The individual transform properties translate, rotate and…
CSS Relative Color Syntax: Auto-Generate Palettes from One Token

CSS Relative Color Syntax: Auto-Generate Palettes from One Token

CSS relative color syntax: a theme palette from one color token color-mix() blends two colors. Relative color syntax goes one step further: it takes a color apart into its channels and lets you change each of them with calc(). “The brand color, 15% lighter”, “the brand color with half the chroma”, “the complementary hue” become…
CSS Popover API: Native Tooltips and Dropdowns in WordPress Themes

CSS Popover API: Native Tooltips and Dropdowns in WordPress Themes

The Popover API: menus, tooltips and panels without JavaScript toggles Every theme has elements that open on click and close on Escape or a click outside: a user menu, a mini cart, a language switcher, a help tooltip. Each needs the same JavaScript: toggle a class, set aria-expanded, listen for Escape and outside clicks, manage…
CSS Anchor Positioning: Tooltips and Dropdowns Without JS

CSS Anchor Positioning: Tooltips and Dropdowns Without JS

CSS anchor positioning: tooltips and dropdowns without a positioning library A tooltip has to sit next to its button, stay inside the viewport and move to the other side when there is no room. JavaScript libraries like Popper and Floating UI exist only for this, and they recalculate positions on every scroll and resize. CSS…
CSS @starting-style: Animating Elements on First Render

CSS @starting-style: Animating Elements on First Render

CSS @starting-style: entry animations from display: none A dropdown that fades in when it opens sounds trivial, and in CSS it used to be impossible without JavaScript. The element goes from display: none to display: block, and a transition needs a “before” style to start from, but an element that was not rendered has none.…
CSS Container Style Queries: Data-Driven Component Variants

CSS Container Style Queries: Data-Driven Component Variants

Container style queries: component variants from a custom property Size container queries ask “how wide is my container?”. Style queries ask a different question: “what is the value of a custom property on my container?”. A card can then switch to its featured layout because a parent section sets --ha-variant: featured, without an extra class…
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…