Continued from: “New Look on the Blog: Discover the Mechanics Behind My Minimalist WordPress Theme”
In the previous article, I shared the philosophy behind Jure Minimal Blog: why I decided to build my own theme from scratch, which design decisions I made, and how the visual result turned out. If you haven’t read it yet, I recommend starting there to get the full context.
This article is different. It’s a pure dev log: the story of how I set out to fix one small issue, stumbled upon another, and ended up scoring 100/100 on Google PageSpeed almost without planning to.
The starting point: comments
It all started with the comments section.
It didn’t look quite right: misaligned margins, rogue bullet points… My first hypothesis was performance-related. I thought I could lighten the CSS by extracting comment-specific styles and injecting them inline directly into comments.php, so they would only load on pages that actually needed them.
When I dove into the code to do that, I found the real culprit: my stylesheet was still targeting ol.commentlist (the class name older WordPress versions used). But WordPress has been generating HTML as <ol class="comment-list"> with a hyphen for quite a while now. A single character difference that was silently breaking the entire layout.
I fixed the selector right away. And while I was at it, I went ahead and implemented the conditional CSS anyway, since in theory it still made sense.
Spoiler: the performance impact was virtually nonexistent. The comment CSS was so tiny that it made no measurable difference. But that little rabbit hole made me question something much more important: how small was the theme’s main CSS, really?
The real discovery: 3.3 KiB blocking everything
Checking file sizes, I noticed that style.min.css weighed just 3.3 KiB. Minified, compact, and clean. Yet PageSpeed Insights flagged it as the site’s primary bottleneck:
Render-blocking requests — Est. savings: 150 ms
style.min.css?ver=1.5.1 3.3 KiB 160 ms
And inside the critical request chains:
Initial Navigation /blog/ 226 ms 9.95 KiB
└── style.min.css?ver=1.5.1 387 ms 3.27 KiB
The browser couldn’t paint a single pixel until it received that file. Cumulative latency reached 387 ms. Not because of the CSS payload size itself, but due to the full round-trip network overhead: the HTTP request, the server response time, and parsing.
Then it hit me: if the file is only 3.3 KiB, serving it as an external blocking resource makes zero sense. It’s so small that it can be injected directly into the <head> at virtually no real cost.
I put it to the test.
The fix: inline CSS in the <head>
Instead of continuing to rely on wp_enqueue_style, I updated functions.php so the theme reads the contents of style.min.css and dumps it straight into the HTML of every page:
function jure_minimal_blog_inline_styles() {
$css_file = get_template_directory() . '/style.min.css';
if ( file_exists( $css_file ) ) {
echo '<style>' . file_get_contents( $css_file ) . '</style>';
}
}
add_action( 'wp_head', 'jure_minimal_blog_inline_styles' );
Now CSS is no longer a separate network request: it arrives as part of the initial HTML document. The browser has everything it needs to render from the very first byte it receives.
I checked the results and decided to keep it.
A visual consistency fix (while I was at it)
While reviewing the styles, I noticed the 404 page had square buttons (border-radius: 0), hardcoded colors that ignored the theme’s CSS variables, and animations that didn’t exist anywhere else on the blog.
It wasn’t the main goal of the session, but it was an easy detail to fix. I unified everything using the same variables (--accent-color, border-radius: 3px) and the exact same hover and focus behaviors found across the rest of the theme.
The comment styles, beyond fixing the selector, still need some polish. I’ll leave those for an upcoming pass.
The numbers
Here is the before and after:
Before (v1.5.1):
| Issue | Measured impact |
|---|---|
| Render-blocking CSS | 387 ms critical latency |
| PageSpeed estimated savings | 150 ms |
| Resource size | 3.3 KiB |
After (v1.5.2):
| PageSpeed Metric | Score |
|---|---|
| Performance | 100 |
| Accessibility | 100 |
| Best Practices | 100 |
| SEO | 100 |
100/100 across all four categories. One of those goals you chase without really knowing if you’ll hit it, and when it happens, it brings a disproportionate amount of satisfaction.
A note on inline CSS (and what response headers reveal)
The obvious question is: isn’t it better for the browser to download CSS once and cache it?
In theory, yes. But actual production response headers tell a different story:
Transferred: 9.95 kB (32.83 kB size)
content-encoding: zstd
x-fastcgi-cache: HIT
x-cache-status: HIT
cache-control: public, max-age=7200
cf-cache-status: DYNAMIC
Three key takeaways:
- The entire HTML payload (with inline CSS included) travels compressed with zstd and transfers under 10 KiB. Cloudflare compresses everything together, so inlining doesn’t bloat the page in any meaningful way.
x-fastcgi-cache: HIT. The server has full-page caching enabled. The HTML with the embedded CSS is already precalculated and ready to serve without executing PHP or WordPress on every hit. There is zero penalty for “rebuilding” the CSS each time.- The response travels over HTTP/3, significantly cutting connection latency.
All of this substantially neutralizes the classic argument against inline CSS (“you lose browser caching”). When you have a solid server-side caching layer and an edge CDN in front, your theme CSS doesn’t strictly need to live in a standalone file.
The infrastructure that makes all this possible
These headers aren’t just technical trivia: they prove multiple layers are operating in harmony—FastCGI caching at the server level, Cloudflare as an edge proxy, HTTP/3, modern compression algorithms…
If you’ve read previous articles in this series (on Redis and Memcached as an object cache layer, and on the web server acting as a reverse proxy), this result is the hands-on proof of why those layers matter so much. Inline CSS works this effectively precisely because a rock-solid infrastructure stands right behind it.
Up next is the article covering the most visible layer of all: the edge, the CDN, the entry point where user traffic hits the system before ever reaching origin. That’s coming soon.
What’s next for the theme
The comment selector is fixed, but the section still deserves extra visual refinement. I’ll tackle that in the next iteration.
An important heads-up before you copy this
The inline CSS technique excels within this specific context: a VPS running Nginx configured with full-page caching fronted by Cloudflare at the edge. That setup offsets the lack of browser caching and turns the tradeoff into an absolute net win.
However, not every site runs on this kind of infrastructure. On standard shared hosting lacking server-side caching or a CDN, inlining CSS can backfire: the browser cannot cache CSS across multiple pages because it travels embedded in every HTML payload, meaning every single page view redownloads those same 3.3 KiB.
Because of this, in future theme releases I plan to revert to standard enqueueing with wp_enqueue_style. The goal is for Jure Minimal Blog to perform reliably in any environment, not just in tailored setups. In the meantime, if you want to replicate inlining in your own theme, make sure you have page caching active first—whether at the server level, through a plugin (like W3 Total Cache or WP Rocket), or via a CDN.
The complete theme is available on GitHub under the GPL license: github.com/jure-ve/jureminimalblog
If you’re building your own WordPress theme and aiming for a 100/100 on PageSpeed, take a close look at your actual CSS size and, above all, what infrastructure sits in front of your server. The synergy between those two is usually where the magic happens.
And if you find a bug or have an idea to improve the theme without sacrificing its fast, minimalist nature, feel free to open an issue. I’d love your feedback so we can keep refining this together.