Forums

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

Home Forums CSS one css file or more is better?

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #45255
    moer2237
    Member

    Just doing some house cleaning & looking forward for the pro’s & con’s.

    [master](http://www.mytravel22.com/login/masterstyling1.css “master”)

    [secondary](http://www.mytravel22.com/secondarystyling.css “”)

    [rbar](http://www.mytravel22.com/rbar2.css “”)

    3 css files in one [webpage.](http://www.mytravel22.com/kuala-lumpur-hotels.html “webpage”). Actually I’m trying to avoid redundancy of statement. Or even worse contradiction of statement among the css files.

    #137146
    Paulie_D
    Member

    @Hompimpa The only thing you are adding then is an extra http request.

    I suspect that the difference in file sizes between adding a ‘global’ and ‘thispage’ css file as opposed a combined file would be minimal.

    Have you looked at that?

    My guess is that the load weight /time is probably about the same.

    #137159
    Paulie_D
    Member

    @Hompimpa I didn’t say you didn’t have a good reason just that the difference in loading is probably the same.

    If you are loading a ‘global’ sheet + a ‘page sheet’ it adds an extra request.

    Combining the two sheets eliminates the extra request.

    However, if you have multiple pages (perhaps each with separate sheet) then the extra request MIGHT be justified because a single combined CSS sheet might be take longer to load than 2 sheets with an extra request.

    It’s something one should test.

    #137160
    Paulie_D
    Member

    In the case of the OP, it looks like they are separate sheets for global page components that should, in an ideal world, be combined into a single css file and just loaded once.

    #137164
    TheDoc
    Member

    I suppose if one of the stylesheets that you’re conditionally loading is like 100KB then you’d have reason to separate them.

    As for @moer2237, there’s no way those three files should be separated. If you want, you can have them separated locally but definitely combine (and minify) them during deployment.

    #137346
    Kitty Giraudel
    Participant

    > However, if you have multiple pages (perhaps each with separate sheet) then the extra request MIGHT be justified because a single combined CSS sheet might be take longer to load than 2 sheets with an extra request.

    I hardly think so. Once Gzipped, a clean stylesheet is blazingly fast to load.

    #137348
    Paulie_D
    Member

    Hence the reason why I qualified my statement with a “might” and suggested

    >It’s something one should test.

    #137407
    moer2237
    Member

    Thanks all for the comments, really appreciate it.

    Paulie_D – Suggestion taken. I’ll lump it up in one file then.

    TheDoc – True, it’s far from 100KB. Actually just approx 3KB combine! Should be no loading issues then.

    Hompimpa – Definitely some work on the comment separation but it does help on redundancy & contradiction issues.

    Cheers!

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