{"id":2127,"date":"2026-09-26T10:00:00","date_gmt":"2026-09-26T10:00:00","guid":{"rendered":"https:\/\/muzi.tw\/thinking\/ucss-strips-css-tmp-en-us\/"},"modified":"2026-10-02T05:29:05","modified_gmt":"2026-10-02T05:29:05","slug":"ucss-strips-css","status":"publish","type":"post","link":"https:\/\/muzi.tw\/en\/thinking\/ucss-strips-css\/","title":{"rendered":"Your CSS is on the server, but it never reaches the browser"},"content":{"rendered":"<p class=\"mz-nt-lead\">Plenty of caching plugins have an option called &#8220;Remove Unused CSS.&#8221; Turn it on and it scans your pages, deletes every selector no element uses, and sends the browser a slimmed-down stylesheet.<\/p>\n<p>Most of the time that works well. The problem is that it decides statically.<\/p>\n<h2>Three things it can&#8217;t read<\/h2>\n<p>First, classes added in the page builder&#8217;s back end. A name typed into an element&#8217;s &#8220;extra class&#8221; field doesn&#8217;t appear anywhere in the templates, so the scanner assumes nobody uses it.<\/p>\n<p>Second, design tokens declared only on <code>:root<\/code>. You define the variables now and plan to use them later, and nothing references them yet. To the scanner, that&#8217;s dead code.<\/p>\n<p>Third, classes that scripts attach at runtime. The scan is done before any of that happens.<\/p>\n<h2>Why it&#8217;s hard to spot<\/h2>\n<p>Every piece of evidence we could get our hands on said things were fine.<\/p>\n<p>The file on the server had the declaration. So did the combined file. In DevTools, the file loaded with a 200.<\/p>\n<p>The one thing that turned out to tell the truth was <code>getComputedStyle()<\/code>, which reports the value the browser actually ended up using. Our first two checks both came back all green because we took &#8220;the file on the server has it&#8221; as proof. Now we verify with <code>getComputedStyle()<\/code> every time.<\/p>\n<h2>What we do now<\/h2>\n<p>Declarations that would get stripped are injected by the plugin as inline styles instead. Inline styles don&#8217;t go through the removal step.<\/p>\n<p>WordPress lets you declare dependencies between stylesheets so that A always loads after B. We used to think a dependency meant we were covered. It guarantees the order. It doesn&#8217;t guarantee the file gets loaded at all.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The file is right, the path is right, and the rule is sitting in the combined stylesheet. It still doesn&#8217;t apply.<\/p>\n","protected":false},"author":1,"featured_media":1027,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[29],"tags":[],"class_list":["post-2127","post","type-post","status-publish","format-standard","has-post-thumbnail","category-web-notes-en-us"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Your CSS is on the server, but it never reaches the browser - Muzi Studio<\/title>\n<meta name=\"description\" content=\"The file is right, the path is right, and the rule is sitting in the combined stylesheet. It still doesn&#039;t apply.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/muzi.tw\/en\/thinking\/ucss-strips-css\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Your CSS is on the server, but it never reaches the browser - Muzi Studio\" \/>\n<meta property=\"og:description\" content=\"The file is right, the path is right, and the rule is sitting in the combined stylesheet. It still doesn&#039;t apply.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/muzi.tw\/en\/thinking\/ucss-strips-css\/\" \/>\n<meta property=\"og:site_name\" content=\"Muzi Studio\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-26T10:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-02T05:29:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/muzi.tw\/wp-content\/uploads\/2026\/09\/muzi-nt-ucss-strip-f1963cfe.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1800\" \/>\n\t<meta property=\"og:image:height\" content=\"1004\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/muzi.tw\\\/en\\\/thinking\\\/ucss-strips-css\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/muzi.tw\\\/en\\\/thinking\\\/ucss-strips-css\\\/\"},\"author\":{\"@id\":\"https:\\\/\\\/muzi.tw\\\/en\\\/#organization\"},\"headline\":\"Your CSS is on the server, but it never reaches the browser\",\"datePublished\":\"2026-09-26T10:00:00+00:00\",\"dateModified\":\"2026-10-02T05:29:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/muzi.tw\\\/en\\\/thinking\\\/ucss-strips-css\\\/\"},\"wordCount\":296,\"publisher\":{\"@id\":\"https:\\\/\\\/muzi.tw\\\/en\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/muzi.tw\\\/en\\\/thinking\\\/ucss-strips-css\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/muzi.tw\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/muzi-nt-ucss-strip-f1963cfe.jpg\",\"articleSection\":[\"Web &amp; Technology\"],\"inLanguage\":\"en\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/muzi.tw\\\/en\\\/thinking\\\/ucss-strips-css\\\/\",\"url\":\"https:\\\/\\\/muzi.tw\\\/en\\\/thinking\\\/ucss-strips-css\\\/\",\"name\":\"Your CSS is on the server, but it never reaches the browser - Muzi Studio\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/muzi.tw\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/muzi.tw\\\/en\\\/thinking\\\/ucss-strips-css\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/muzi.tw\\\/en\\\/thinking\\\/ucss-strips-css\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/muzi.tw\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/muzi-nt-ucss-strip-f1963cfe.jpg\",\"datePublished\":\"2026-09-26T10:00:00+00:00\",\"dateModified\":\"2026-10-02T05:29:05+00:00\",\"description\":\"The file is right, the path is right, and the rule is sitting in the combined stylesheet. It still doesn't apply.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/muzi.tw\\\/en\\\/thinking\\\/ucss-strips-css\\\/#breadcrumb\"},\"inLanguage\":\"en\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/muzi.tw\\\/en\\\/thinking\\\/ucss-strips-css\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\\\/\\\/muzi.tw\\\/en\\\/thinking\\\/ucss-strips-css\\\/#primaryimage\",\"url\":\"https:\\\/\\\/muzi.tw\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/muzi-nt-ucss-strip-f1963cfe.jpg\",\"contentUrl\":\"https:\\\/\\\/muzi.tw\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/muzi-nt-ucss-strip-f1963cfe.jpg\",\"width\":1800,\"height\":1004,\"caption\":\"A row of black sliders on a long metal track with purple light glowing from the bottom\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/muzi.tw\\\/en\\\/thinking\\\/ucss-strips-css\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/muzi.tw\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Your CSS is on the server, but it never reaches the browser\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/muzi.tw\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/muzi.tw\\\/en\\\/\",\"name\":\"Muzi Studio\",\"description\":\"Muzi Studio\",\"publisher\":{\"@id\":\"https:\\\/\\\/muzi.tw\\\/en\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/muzi.tw\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/muzi.tw\\\/en\\\/#organization\",\"name\":\"Muzi Studio\",\"url\":\"https:\\\/\\\/muzi.tw\\\/en\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\\\/\\\/muzi.tw\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/muzi.tw\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/muzi-logo-512.png\",\"contentUrl\":\"https:\\\/\\\/muzi.tw\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/muzi-logo-512.png\",\"width\":512,\"height\":512,\"caption\":\"Muzi Studio\"},\"image\":{\"@id\":\"https:\\\/\\\/muzi.tw\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"email\":\"hello@muzi.tw\",\"description\":\"A brand, web and content studio in Taipei and Tokyo. We look at your growth goals and where you are today before deciding whether design needs to change.\",\"areaServed\":[\"Taiwan\",\"Japan\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Your CSS is on the server, but it never reaches the browser - Muzi Studio","description":"The file is right, the path is right, and the rule is sitting in the combined stylesheet. It still doesn't apply.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/muzi.tw\/en\/thinking\/ucss-strips-css\/","og_locale":"en_US","og_type":"article","og_title":"Your CSS is on the server, but it never reaches the browser - Muzi Studio","og_description":"The file is right, the path is right, and the rule is sitting in the combined stylesheet. It still doesn't apply.","og_url":"https:\/\/muzi.tw\/en\/thinking\/ucss-strips-css\/","og_site_name":"Muzi Studio","article_published_time":"2026-09-26T10:00:00+00:00","article_modified_time":"2026-10-02T05:29:05+00:00","og_image":[{"width":1800,"height":1004,"url":"https:\/\/muzi.tw\/wp-content\/uploads\/2026\/09\/muzi-nt-ucss-strip-f1963cfe.jpg","type":"image\/jpeg"}],"author":"admin","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/muzi.tw\/en\/thinking\/ucss-strips-css\/#article","isPartOf":{"@id":"https:\/\/muzi.tw\/en\/thinking\/ucss-strips-css\/"},"author":{"@id":"https:\/\/muzi.tw\/en\/#organization"},"headline":"Your CSS is on the server, but it never reaches the browser","datePublished":"2026-09-26T10:00:00+00:00","dateModified":"2026-10-02T05:29:05+00:00","mainEntityOfPage":{"@id":"https:\/\/muzi.tw\/en\/thinking\/ucss-strips-css\/"},"wordCount":296,"publisher":{"@id":"https:\/\/muzi.tw\/en\/#organization"},"image":{"@id":"https:\/\/muzi.tw\/en\/thinking\/ucss-strips-css\/#primaryimage"},"thumbnailUrl":"https:\/\/muzi.tw\/wp-content\/uploads\/2026\/09\/muzi-nt-ucss-strip-f1963cfe.jpg","articleSection":["Web &amp; Technology"],"inLanguage":"en"},{"@type":"WebPage","@id":"https:\/\/muzi.tw\/en\/thinking\/ucss-strips-css\/","url":"https:\/\/muzi.tw\/en\/thinking\/ucss-strips-css\/","name":"Your CSS is on the server, but it never reaches the browser - Muzi Studio","isPartOf":{"@id":"https:\/\/muzi.tw\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/muzi.tw\/en\/thinking\/ucss-strips-css\/#primaryimage"},"image":{"@id":"https:\/\/muzi.tw\/en\/thinking\/ucss-strips-css\/#primaryimage"},"thumbnailUrl":"https:\/\/muzi.tw\/wp-content\/uploads\/2026\/09\/muzi-nt-ucss-strip-f1963cfe.jpg","datePublished":"2026-09-26T10:00:00+00:00","dateModified":"2026-10-02T05:29:05+00:00","description":"The file is right, the path is right, and the rule is sitting in the combined stylesheet. It still doesn't apply.","breadcrumb":{"@id":"https:\/\/muzi.tw\/en\/thinking\/ucss-strips-css\/#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/muzi.tw\/en\/thinking\/ucss-strips-css\/"]}]},{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/muzi.tw\/en\/thinking\/ucss-strips-css\/#primaryimage","url":"https:\/\/muzi.tw\/wp-content\/uploads\/2026\/09\/muzi-nt-ucss-strip-f1963cfe.jpg","contentUrl":"https:\/\/muzi.tw\/wp-content\/uploads\/2026\/09\/muzi-nt-ucss-strip-f1963cfe.jpg","width":1800,"height":1004,"caption":"A row of black sliders on a long metal track with purple light glowing from the bottom"},{"@type":"BreadcrumbList","@id":"https:\/\/muzi.tw\/en\/thinking\/ucss-strips-css\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/muzi.tw\/en\/"},{"@type":"ListItem","position":2,"name":"Your CSS is on the server, but it never reaches the browser"}]},{"@type":"WebSite","@id":"https:\/\/muzi.tw\/en\/#website","url":"https:\/\/muzi.tw\/en\/","name":"Muzi Studio","description":"Muzi Studio","publisher":{"@id":"https:\/\/muzi.tw\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/muzi.tw\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en"},{"@type":"Organization","@id":"https:\/\/muzi.tw\/en\/#organization","name":"Muzi Studio","url":"https:\/\/muzi.tw\/en\/","logo":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/muzi.tw\/en\/#\/schema\/logo\/image\/","url":"https:\/\/muzi.tw\/wp-content\/uploads\/2026\/09\/muzi-logo-512.png","contentUrl":"https:\/\/muzi.tw\/wp-content\/uploads\/2026\/09\/muzi-logo-512.png","width":512,"height":512,"caption":"Muzi Studio"},"image":{"@id":"https:\/\/muzi.tw\/en\/#\/schema\/logo\/image\/"},"email":"hello@muzi.tw","description":"A brand, web and content studio in Taipei and Tokyo. We look at your growth goals and where you are today before deciding whether design needs to change.","areaServed":["Taiwan","Japan"]}]}},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/muzi.tw\/wp-content\/uploads\/2026\/09\/muzi-nt-ucss-strip-f1963cfe.jpg","_links":{"self":[{"href":"https:\/\/muzi.tw\/en\/wp-json\/wp\/v2\/posts\/2127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/muzi.tw\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/muzi.tw\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/muzi.tw\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/muzi.tw\/en\/wp-json\/wp\/v2\/comments?post=2127"}],"version-history":[{"count":4,"href":"https:\/\/muzi.tw\/en\/wp-json\/wp\/v2\/posts\/2127\/revisions"}],"predecessor-version":[{"id":2597,"href":"https:\/\/muzi.tw\/en\/wp-json\/wp\/v2\/posts\/2127\/revisions\/2597"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/muzi.tw\/en\/wp-json\/wp\/v2\/media\/1027"}],"wp:attachment":[{"href":"https:\/\/muzi.tw\/en\/wp-json\/wp\/v2\/media?parent=2127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/muzi.tw\/en\/wp-json\/wp\/v2\/categories?post=2127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/muzi.tw\/en\/wp-json\/wp\/v2\/tags?post=2127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}