Results 1 to 10 of 10
  1. #1
    Join Date
    Apr 2008
    Posts
    42
    Plugin Contributions
    0

    Default Combining Stylesheets

    Is it possible to combine stylesheets from add ons with the main stylesheet without causing any problems or major customization of the stylesheet?

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Combining Stylesheets

    Definitely possible.

    Website speed optimization programs will even tell you that you should always do it, though there can be ease-of-use advantages to having separate files for discrete mods.

    If a mod's styles extend or modify a distinct area of the main stylesheet, it would be good to merge it in that location so as to avoid overlapping or conflicting declarations; otherwise, you can always just add the contents of a mod stylesheet to the end of the main stylesheet.

  3. #3
    Join Date
    Apr 2008
    Posts
    42
    Plugin Contributions
    0

    Default Re: Combining Stylesheets

    so i could basically add them to the end of the stylesheet and put comments around the ones that go to certain mods so it is easier to see which styles apply to those mods. then of course I would have to go through the files of each mod and change the name of the style sheet.

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Combining Stylesheets

    No, you wouldn't have to change any stylesheet references in mod files. The mod doesn't know or care which stylesheet file the styles come from; any declarations that apply to the classes/ids in the mod are used by Zen Cart.

  5. #5
    Join Date
    Apr 2008
    Posts
    42
    Plugin Contributions
    0

    Default Re: Combining Stylesheets

    so why don't the people that make the mods just add on to the main stylesheet of zen cart?

  6. #6
    Join Date
    Mar 2008
    Location
    Cape Town & London (depends on the season)
    Posts
    2,975
    Plugin Contributions
    0

    Default Re: Combining Stylesheets

    Quote Originally Posted by fsicody View Post
    so why don't the people that make the mods just add on to the main stylesheet of zen cart?
    ... because the stylesheets are one of the most "customizable" aspects of the program... they don't know how or where users have modified their stylesheet, and in order to provide a (relatively) easy way of making comparisons between a mod stylesheet and the user's stylesheet, keeping things separate makes sense.

    As indicated, there is nothing wrong with "blending" stylesheets, as long as there is a good understanding of how stylesheets behave (chronology, structure, order, etc).

  7. #7
    Join Date
    Apr 2008
    Posts
    42
    Plugin Contributions
    0

    Default Re: Combining Stylesheets

    would it make a big difference as far as load time to combine the stylesheets?

  8. #8
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Combining Stylesheets

    It would probably not make a noticeable difference... depending on the current behavior of your cart. If it loads slowly even for users with a fast connection, then every little thing is worth trying.

  9. #9
    Join Date
    Jul 2009
    Posts
    5
    Plugin Contributions
    1

    Default Re: Combining Stylesheets

    What is the best way to merge stylesheets?

  10. #10
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Combining Stylesheets

    Quote Originally Posted by gjh42 View Post
    It would probably not make a noticeable difference... depending on the current behavior of your cart. If it loads slowly even for users with a fast connection, then every little thing is worth trying.
    This may not be correct in all cases, it does make noticeable difference especially on sites where a large number of css and js files are used.

    CJ Loader will help you to do the task:
    http://blog.rubikintegration.com/200...ader-released/
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

 

 

Similar Threads

  1. Combining Attributes
    By michaelg in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 10 Dec 2011, 03:02 PM
  2. Combining Stylesheets
    By autoace in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 11 May 2011, 02:28 AM
  3. Combining CSS
    By NBordeau in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 7 Jun 2010, 05:35 AM
  4. Combining Stylesheets
    By neighbornick in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 23 Mar 2009, 07:30 PM
  5. combining stylesheets?
    By ichigoblack in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 23 Oct 2008, 10:40 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