CSS-Tricks shipped version 20 of its theme after roughly five years on the previous design. The author frames it as an iterative rollup rather than a rebuild: the site kept evolving with feature work, especially since 2024, but the theme itself had gone untouched long enough to warrant a version bump.

Clearing out legacy code

Much of the release's weight sits in removals. Nineteen years of accumulated pieces left scripts in the global compiled JavaScript bundle that nothing referenced anymore — handling for embedded newsletter versions from before posts were self-hosted, relics supporting toggle behavior in the Flexbox Guide from before native <details> existed, a jQuery lazy-loader now covered by WordPress core, and third-party ad scripts made unnecessary by self-hosted ads. The bundle went from 151.6 KB (55.3 KB gzipped) to 133.8 KB (48.1 KB).

The CSS-Tricks Forum was also formally retired. It had been in archive mode since around 2018, and since its discussions were over ten years old, deactivating the bbPress plugin behind it and clearing the database cut about 400 MB and allowed several custom templates to be dropped. Further cleanup is said to be easier now, though some legacy code remains.

Tooling and hardening

The build workflow stays on Gulp but gains guardrails: Prettier is enforced through a husky + lint-staged pre-commit hook, Stylelint checks alphabetical CSS property order, a GitHub Actions build check was added, and cache-busting moved from rewriting source files to filemtime(). The recurring errors that used to appear in a fresh terminal are gone.

On security, a handful of unescaped custom field calls were spotted and fixed. The author also used Claude for a broader audit, prompting it to review recent WordPress security release notes and flag areas where the theme could be hardened; most patches were then written by hand, with the model serving as a check against inexperience.

Sass organization and design tokens

Sass is still in use, largely for partials. The previous flat structure gave way to a more organized one, notwithstanding some compromises (for instance, /header arguably belongs in /layout, but ordering constraints made some ideals impossible). Cascade Layers structure is a future goal. The rewrite brought the CSS down from 180 KB (31.7 KB) to 169 KB (24.6 KB); part of that came from moving all form styles into a separate forms.css served only on pages where WooCommerce, Restrict Content Pro, and Gravity Forms are enqueued.

A sort-of design system

Semantic design tokens now abstract away one-off values across colors, fonts, font styles, font sizes, paddings, and margins — replacing the many fixed values, magic numbers, one-off styles, and older utilities that had collected in the theme's corners. A single palette is referenced throughout, so a change at the system level propagates reliably.

Some of this work is visible. Link styles are now consistent sitewide, with a small, maintained set of variations; because inherited styles use visual cues that don't rely solely on color or opacity changes, accessibility improves too. Forms and tables were reworked as well — no small job in a WordPress theme where these components arrive from different plugin sources (Gravity Forms, WooCommerce, Restrict Content Pro), each with its own stylesheet. Resetting those brought a level of harmony across instances.

Theme toggle and The Jawbreaker

Version 20 introduces the first multiple color schemes in the site's history. Since the site was already predominantly dark while content sat on white, the author treated the existing design as the "dark" mode and produced a creamy light theme that mostly swaps backgrounds and component styles. The toggle covers system, dark, and light preferences through a single control, drawing on lessons from the recent toggle debate, and a view transition slides the new theme over the previous one. The main content container is unchanged — it was already white — and toggling it between white and black is being considered but hasn't been settled on.

The header and footer now carry a backdrop of colorful dots called "Jawbreaker," after the candy; the name is admittedly a placeholder. The author wanted to random()-position the dots but avoided the many empty markup elements that would require, so the <circle> elements are generated in PHP instead — each with inlined random coordinates, inlined styles for fill and sizing, and variables supplying a --delay and --dur for a subtle twinkling animation. The same pattern repeats in the footer and appears on the 404 page; generating it with <defs> is noted as future work.

<?php echo csstricks_jawbreaker_svg( array(
  'count'    => 90,
  'seed'     => mt_rand(),
  'size_min' => 2,
  'size_max' => 5,
) ); ?>

Blobby hover effect

The homepage hides a blobby shape behind the author avatar grid for browsers supporting border-shape and random() (Chrome). It builds on the existing .gradient-card pattern, placing a gradient on the component's :before pseudo and a translucent :after above it so a hint of the gradient shows through; differing border-radius values let :before bleed outside and read as a border around the whole shape. The border-shape property adds the blobbiness, with variables mapped to shape()s. The "static" shape comes from Temani Afif's blob generator; on hover or focus, the points swap to a "hover" shape whose variables are mapped to random() values, so it differs on every page load and animates between the two states.

Index pages rework

The Almanac had grown well but its primary page hadn't been revisited beyond clickable cards linking to feature subsets. It is now a genuine index of CSS features — layout inspired by a CSS periodic table the author had once seen — that gets readers where they're going quickly.

The Guides index was similarly overdue. About 27 guides in a vertical stack meant a lot of scrolling with no sense of what was ahead, and the book effect had been carrying the visuals at the expense of function. The new layout adds a featured guide, a widget of newly added and updated guides, and a categorized grid beneath.

Smaller edits

Author pages moved the right sidebar to the left and brought the author image and bio into the flow so articles rise to the top; the change opens up room for further work. The larger Authors index still needs the same treatment. For editors, some front-end styles now reach into the WordPress admin — not a full visual editor, but a useful hint of what content will look like.

Lighthouse results, v19 against v20

Lighthouse is not a reliable yardstick for performance, accessibility or best practices — its numbers come with plenty of caveats — but there is no need to discard it entirely. The scores are more entertaining than authoritative, and the recommendations are still worth reading.

After several runs and adjustments, here is how the two themes compared.

Scores

Categoryv19v20
Performance7172
Accessibility8691
Best Practices75100
SEO9290

This is a satisfying outcome. Certain performance factors sit outside the author's control, so v20 matching v19 is acceptable. The improvements in accessibility and best practices are the more welcome development. SEO matters little unless it starts damaging something more important, such as accessibility.

What the metrics show

Metricv19v20
LCP8.5s7.2s
CLS0.0320
TBT10ms13ms
FCP2.6s2.5s
Speed Index3.2s3.5s
Time to Interactive8.6s4.0s
Total page weight2.03 MB1.24 MB

Again, a pleasing result. Time to first byte is largely out of reach, but every other metric comes in at least slightly better. Total page weight is the clearest gain and probably the most important one here.

Beyond the front end

Plenty of remaining changes never reach the front end — comparable to the generic "bug squashing" entries in browser changelogs. In this case that means improved post queries, breadcrumbs, function management and naming.

Much work is still outstanding, and surely some things were missed or broken along the way. Those belong in a later, smaller iterative release that doesn't warrant a version bump.