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…
Git LFS: Tracking Large Media Files in WordPress Theme Repositories

Git LFS: Tracking Large Media Files in WordPress Theme Repositories

Git LFS for large files in WordPress theme repositories A theme repository with design source files, demo videos and font packages grows by hundreds of megabytes with every revision of a binary file, because git keeps every version in full. Cloning takes minutes, and the deploy server downloads files it never needs. Git LFS (Large…
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…
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…
ES Modules in WordPress 6.5: wp_enqueue_script_module()

ES Modules in WordPress 6.5: wp_enqueue_script_module()

Script modules in WordPress: wp_enqueue_script_module() For a long time, WordPress could only load classic scripts. Writing import and export in a theme meant a bundler, or a script_loader_tag filter that added type="module" by hand, with no way to share modules between plugins. WordPress 6.5 added the Script Modules API: modules are registered with an ID,…