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
    21,090
    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
    21,090
    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,974
    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
    21,090
    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,486
    Plugin Contributions
    12

    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 ZenCart with a CMS ??
    By pmask in forum General Questions
    Replies: 2
    Last Post: 10 Nov 2010, 11:21 AM
  2. Combining Sideboxes?
    By guynumber6 in forum Templates, Stylesheets, Page Layout
    Replies: 15
    Last Post: 11 May 2010, 04:53 AM
  3. Combining a Sale with a Percentage Off Coupon
    By mlm2005 in forum Setting Up Specials and SaleMaker
    Replies: 9
    Last Post: 4 Sep 2006, 04:42 PM
  4. Need Help Combining Shipping (version 1.2.7)
    By AndrewClarke in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 8 Jul 2006, 07:56 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
  •