Thread: Combining CSS

Results 1 to 8 of 8
  1. #1
    Join Date
    Apr 2010
    Location
    Rochester, New York
    Posts
    97
    Plugin Contributions
    0

    Default Combining CSS

    Hello All,

    I was wondering how easy it is to combine the stylesheets in my template.

    From what I think it wont be too hard, as all I have to do is combine the content of the stylesheets, then search through all my files to see where the secondary stylesheets are be used then change this to syle.css.

    Am I about Right?

    Thanks,
    Nick

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Combining CSS

    earch through all my files to see where the secondary stylesheets are be used then change this to syle.css.
    ZenCart defaults to

    stylesheet.css
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Apr 2010
    Location
    Rochester, New York
    Posts
    97
    Plugin Contributions
    0

    Default Re: Combining CSS

    Quote Originally Posted by kobra View Post
    ZenCart defaults to

    stylesheet.css
    Yes but i have sytlesheets such as:

    • stylesheet.css
    • print_stylesheet.css
    • style_imagehover.css
    • stylesheet_css_buttons.css


    I would like to combine all these into stylesheet.css file to minimize http requests.

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Combining CSS

    then change this to syle.css.
    You asked about changing into "atyle.css"

    Use stylesheet.css and if you believe that it will hlep combine as you see fit
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Combining CSS

    Quote Originally Posted by NBordeau View Post
    Yes but i have sytlesheets such as:

    • stylesheet.css
    • print_stylesheet.css
    • style_imagehover.css
    • stylesheet_css_buttons.css


    I would like to combine all these into stylesheet.css file to minimize http requests.
    1. you'll need stylesheet.css
    2. you'll want to leave print_stylesheet.css since it's rendered for print only, and thus not ideal to combine into main stylesheet, since it's loaded to the browser separately intentionally
    3. style_imagehover.css is related to the imageHandler addon. If you are actually using that addon AND you're actually using the image-hover functionality of it, then you can either keep the file as-is, or copy its contents into the main stylesheet.css file. Just remember to delete the content later if you remove imageHandler from your site.
    4. If you're actually *using* CSS-based buttons on your site, then you can either keep the stylesheet_css_buttons.css file, OR you can copy its contents into your main stylesheet.css file. If you're not actually using CSS-based buttons, then you can delete that file from your active custom template folder since you don't need it.

    No need to create a separate "style.css" file at all.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Apr 2010
    Location
    Rochester, New York
    Posts
    97
    Plugin Contributions
    0

    Default Re: Combining CSS

    Quote Originally Posted by DrByte View Post
    1. you'll need stylesheet.css
    2. you'll want to leave print_stylesheet.css since it's rendered for print only, and thus not ideal to combine into main stylesheet, since it's loaded to the browser separately intentionally
    3. style_imagehover.css is related to the imageHandler addon. If you are actually using that addon AND you're actually using the image-hover functionality of it, then you can either keep the file as-is, or copy its contents into the main stylesheet.css file. Just remember to delete the content later if you remove imageHandler from your site.
    4. If you're actually *using* CSS-based buttons on your site, then you can either keep the stylesheet_css_buttons.css file, OR you can copy its contents into your main stylesheet.css file. If you're not actually using CSS-based buttons, then you can delete that file from your active custom template folder since you don't need it.

    No need to create a separate "style.css" file at all.
    Yes but wont i have to edit all the files that use the two stylesheets I am combining?

    I will have to edit the header file at least...

  7. #7
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Combining CSS

    No, I can't see any reason why you'd have to touch any other files. And no need to edit any "header file", whatever you meant by that.

    Zen Cart automatically reads the folder, finding files named as "styleXXXXXXXX.css" and automatically includes them when outputting the template to the browser. So, if you combine those files into one and delete any you're not using, then Zen Cart will automatically output just the details needed to load the files you've left in the folder. It's much more intelligent than many other systems that leave all that complicated stuff up to you.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #8
    Join Date
    Apr 2010
    Location
    Rochester, New York
    Posts
    97
    Plugin Contributions
    0

    Default Re: Combining CSS

    Quote Originally Posted by DrByte View Post
    No, I can't see any reason why you'd have to touch any other files. And no need to edit any "header file", whatever you meant by that.

    Zen Cart automatically reads the folder, finding files named as "styleXXXXXXXX.css" and automatically includes them when outputting the template to the browser. So, if you combine those files into one and delete any you're not using, then Zen Cart will automatically output just the details needed to load the files you've left in the folder. It's much more intelligent than many other systems that leave all that complicated stuff up to you.
    Thank you, I saw this when I looked at the header file...

 

 

Similar Threads

  1. Combining Sideboxes?
    By guynumber6 in forum Templates, Stylesheets, Page Layout
    Replies: 15
    Last Post: 11 May 2010, 04:53 AM
  2. combining css/js files
    By damiantaylor in forum General Questions
    Replies: 2
    Last Post: 6 Apr 2010, 08:36 PM
  3. css- combining into one sheet
    By PinkLeopard in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 27 Dec 2009, 05:54 PM
  4. combining stylesheets?
    By ichigoblack in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 23 Oct 2008, 10:40 PM
  5. combining 2 spreadsheets
    By spikebuck77 in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 9 Aug 2008, 03:43 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR