Announcement

Collapse
No announcement yet.

Css

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Css

    Is there anyway of using a customvar on a normal catalog page (i.e. not a product?).

    My CSS is really bloated and I want to know if it is possible to split the css into multiple sections; one normal css and others which have page specific css.

    For example, I could have something like <LINK type="text/css" media="screen" REL=STYLESHEET HREF="<CUSTOMVAR:CSSNAME>">

    then for each page I set a cssname...

    thanks,
    paul.

    #2
    It might be easier to split the CSS into separate files for Brochure, Catalog and Checkout and directly refer to separate files in each Primary Template.

    However it seems a lot of unnecessary effort as the single big css file will be loaded from the browser cache on all subsequent pages.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Agree with Norman - not worth the hassle and can make maintenance a nightmare further down the line. Don't forget CSS2 supports short hand which can cut down on the bloat and you can combine common elements eg: pseudo classes for link, active and visited if they are the same statements


      Bikster
      SellerDeck Designs and Responsive Themes

      Comment


        #4
        Hi guys,

        what would a normal css size be? Mine add up to about 11k (actual size).

        I know it gets cached on first load, but there are certain sections like forms that use a fair bit of css but which is hardly used, if at all, by the general user so didnt want to load them until actually needed (I count that I would need 5 css files to make this work how I wanted).

        I know I have a lot of bloat in my css, so I will go through stripping it bare of all the doubled up properties and see what I have left.

        Thanks,
        Paul.

        p.s. does actinic shrink css files?

        Comment


          #5
          I don't think 11K is too large - considering a smallish jpg would be about that size.

          Comment


            #6
            How long is a piece of string? It depends on what you are doing with the CSS and how much you have stripped out of Actinic. On a site where I have stripped out all tables other than the cart my CSS is 25kb - but with no tables to self style in most of the templates the CSS has some serious work to do.

            Splitting them down will save a fraction of a second but add extra work to update - one of the main reasons for CSS is to make sweeping changes to the style of a page in a few quick clicks - if this is split over 5 stylesheets you are causing more work than is necessary


            Bikster
            SellerDeck Designs and Responsive Themes

            Comment


              #7
              CSS should be plain text. Try opening the css code file in something like word (or something simpler with word/character counting functinality?) and see how many characters you have. If you have FAR fewer characters than bytes in your file (i.e. far less than 11,000 characters) then you might be using a text editor that is planting those invisible line breaks and stuff to enable correct word wrapping and unix compatibility. In that case, you could retype (or carefully copy and paste) all your code into another plain text file created in notepad or something (a great free advanced text editor is PSPad (http://www.pspad.com/en)). When you save that, you should find the file size is dramatically reduced.

              11k IS rather large for a normal css code file. But how many lines do you have? Its worth checking out to see where you can save.

              Comment


                #8
                Hi guys,

                thanks for all your help. I have got my main css which was 6.5k (actual) down to below 3k by stripping it bare and removing unneeded stuff.. I had a lot of back-ground and color properties duplicated for no reason whatsoever! Might even get it down a bit more once I have run through my divs and checked whats being duplicated too.

                Off to do the others, and then link them all in one.

                Thanks,
                Paul.

                Comment

                Working...
                X