![]() I also like to use comments to give structure and make it easier to read for the next person that works on the site.įor CSS minify suggestions coming from apps, you’ll have to request them to minify it. ![]() To add the custom css file, paste this code into the “head” section of your theme.liquid: Any customizations you make put them here.Include it in your theme.liquid after your main stylesheet.If you make custom edits you could add them to the end of that file, but then if/when you update your theme, your customizations will get overwritten. ![]() Your theme will usually have a (or style.css) file that controls the styles for the theme. When the site loads fine, you know the bug is in the commented section, so you can check there instead of reading the whole CSS file. Debug by commenting out sections of code then save and preview.Use CSS lint to paste your CSS and test for errors.If you can’t locate the error, you have a couple options: If you you made recent change that triggered the jumble, just go back and reread to make sure there are no typos, like if you forgot a semicolon. If there are errors in your CSS, the minified file could break your layout so you’ll have to fix those. This technique works great if your CSS files are clean. Typically CSS files are pretty small, so you won’t notice a significant change in load speed, but with each incremental improvement to performance optimization, you collectively make your site faster, and Google likes that. The output after – you have compressed code like this: The output before – you have organized code how it looks in your editor: Now that CSS file will get served up as a smaller file and save page weight.įile name change in the load command (in theme.liquid):.Like magic, Shopify will compress your file on their server before serving it up.Using the same example, you’d change “ebay-styles.css” to “”.This command is usually in theme.liquid, most likely in the “head” section. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |