Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Dynamic CSS (purely discussion)

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #37520
    Schmotty
    Participant

    I read this: http://net.tutsplus.com/tutorials/php/supercharge-your-css-with-php-under-the-hood/ And that tells me how to do what I was thinking was impossible. Now the hard part is…

    I want php to output the page, then go through the page adding all of the classes, ids, and tags, to an array. Then use that array to select the CSS rules that would apply and write a css file to be linked from the page.

    This would create one css file that only has the rules used on that page.

    I’m thinking of this because I audited a site that has 5+ stylesheets and styles in the head, of which an average of 90% of the rules are not being used on one specific page, while being needed on another. So about 150k of data is being transferred for no reason at any given time. Not to mention all of the server requests.

    So what do you guys/gals think of this?

    #100700
    chrisburton
    Participant

    Why not use a totally separate stylesheet for that one specific page?

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.