Hello everyone I am working with a client his website is build on shopify wcuniforms. But there is a problem I am unable to minify the CSS on his website because of this his page speed is getting hit. Can someone help in this regard?
Topic summary
A developer is struggling to minify CSS on a Shopify client’s website (wcuniforms.com), which is negatively impacting page speed performance.
Proposed Solution:
A community member provided a detailed troubleshooting approach:
-
Check theme file structure: Verify if the theme uses
.scss.liquidor.css.liquidfiles, which compile but don’t automatically minify CSS -
Manual minification process:
- Export CSS from theme code editor
- Use online minification tools (cssminifier.com or Toptal’s CSS minifier)
- Replace existing CSS or create new minified file (
theme.min.css) - Update
theme.liquidto reference the minified version
-
Alternative: Use Shopify apps for easier implementation without manual coding
Status: The discussion remains open with one proposed solution provided, awaiting implementation feedback from the original poster.
Hello @Michaelsteve
- Check if your theme already uses
.scss.liquidor.css.liquid
- Most Shopify themes use SCSS or CSS Liquid files.
- If your theme has
theme.scss.liquidortheme.css.liquid, it will automatically compile CSS, but not minify it. - You can minify manually before uploading or use a Shopify app.
-
**Manual Minification (Recommended for developers)
Step 1 :- Export your CSS:**
-
Go to Online Store → Themes → Actions → Edit Code
-
Open your CSS file (
theme.css,theme.scss.liquid, or similar). -
Copy all the content.
Step 2 :- Use a CSS Minifier:
-
Online tools: https://cssminifier.com/ or https://www.toptal.com/developers/cssminifier
-
Paste your CSS and get the minified version.
Step 3 :- Replace or create a minified file:
-
Either replace the existing CSS file or create a new file
theme.min.css. -
If creating a new file, update your
theme.liquidlayout to load the minified CSS instead:
<!-- Replace this -->
{{ 'theme.css' | asset_url | stylesheet_tag }}
<!-- With this -->
{{ 'theme.min.css' | asset_url | stylesheet_tag }}
- Use Shopify Apps (Easier for non-developers)