Warning: This topic assumes you have a good understanding of CSS. If you don't, you may find this confusing!
As of version 3, Squirrelcart supports stylesheet variant files. If you are new to this, read through the "Customizing > Stylesheets" section of our documentation.
By default, each theme setting uses 3 stylesheet files - for example:
style_main.css.php
style_variant1_gray.css.php
style_variant2_1024.css.php
Each of these files is used to control the appearance of your store. If you have created a custom theme and you are using 3 files but do not wish to allow the customer to choose theme variants, you can simplify your CSS by combining all of these 3 into a single file as follows. This should only be done with files inside your custom theme folder (squirrelcart/themes/YOUR_THEME) and NOT with the default squirrelcart theme folder (squirrelcart/themes/squirrelcart):
Now, if you want to simplify your CSS a bit more, you can look through the code you pasted to find redundancies in CSS selectors. For example, at the top of style_main.css.php you normally have something like this:
- Open style_main.css.php in an editor
- Scroll to the bottom
- Open style_variant1_gray.css.php in an editor
- Scroll to the top
- Select all lines EXCEPT for this line at the very top:
PHP Code:<?php include '../../stylesheet_header.php' ?>- Copy
- Switch to style_main.css.php
- Paste the contents of your clipboard at the bottom
- Close style_variant1_gray.css.php
- Open style_variant2_1024.css.php
- Select all lines EXCEPT for this line at the very top:
PHP Code:<?php include '../../stylesheet_header.php' ?>- Copy
- Switch to style_main.css.php
- Paste the contents of your clipboard at the bottom
- Close style_variant2_1024.css.php
- Save style_main.css.php
You now have all the CSS in one file - style_main.css.php.- Delete style_variant1_gray.css.php and style_variant2_1024.css.php
- Because theses 2 files are gone, you'll need to go into the control panel and change your default theme to something else (any "squirrelcart" theme variant), and then back to your custom theme
Then, in style_variant1_gray.css.php you have:Code:body { margin: 0; }
So, you can remove the 2nd declaration of the body CSS selector, and merge it's attributes with the first:Code:body { background-color: #dfdfdf; }
Code:body { margin: 0; background-color: #dfdfdf; }




Reply With Quote