CSS best practice question

Discussion in 'CSS' started by web_dude, Jan 28, 2008.

  1. #1
    Hi,

    I have a question about best practices using CSS.

    The website that I'm working on is made up of about 8 different stores.

    Each store shares the same html, javascript and java code. Each page also has the same header, footer and page layouts.

    Each store has different colors and images, all css driven.

    Once on page is complete I just copy the css, paste it into the other master pages, change the image paths and the colors and its ready to go. This is giving me a lot of repeat code because each store has a master css page.

    What would be the best practice when breaking the css apart? I don't want to have a ton of style sheets but I also don't want to have a ton of repeated css.

    Any thoughts? I just wanted to get some ideas before I start tearing this stuff apart.

    Thanks.
     
    web_dude, Jan 28, 2008 IP
  2. cbn81

    cbn81 Peon

    Messages:
    160
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You could create two external css files, one for the shared one and one for each sub-style
     
    cbn81, Jan 28, 2008 IP
  3. web_dude

    web_dude Guest

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    That's kind of what I was leaning towards.

    Each page will have one css file that holds the shared styles and one css file that holds the unique styles.

    The only problem with that is there would be one master page for the shared styles and at least 4 other pages holding the unique styles.
     
    web_dude, Jan 28, 2008 IP
  4. cbn81

    cbn81 Peon

    Messages:
    160
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    well, what problem is this?
     
    cbn81, Jan 28, 2008 IP
  5. web_dude

    web_dude Guest

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    The problem is juggling between way too many css pages or repeat code over fewer css pages.

    Think of it this way... Right now I have somestore_master.css that holds all the css for each give store name (right now there are 8 of those).

    If I pull the css out, header for example would be header_master.css (for all the shared styles) and header_store1.css, header_store2.css, header_store3.css....

    That's way too many style sheets because EVERY page will have at least a few different styles.
     
    web_dude, Jan 28, 2008 IP
  6. Dark Rider

    Dark Rider Guest

    Best Answers:
    0
    #6
    you could have one master.css file and then have the other unique css for each page added right into the <head> area.
     
    Dark Rider, Jan 28, 2008 IP