Forums

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

Home Forums Other Separate style sheets based on Media?: Best Practice

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #177698
    codeaholic
    Participant

    Just wondering what the best practice consensus was.

    Is it better to have a separate style sheet for all media types responding to iphone and screen-only devices or is it better to keep the style “in-line” below the corresponding style it’s modifying?

    #177699
    Paulie_D
    Member

    Not sure what you mean by ‘inline’ but it’s generally considered (I think) ideal to have a single stylesheet (thus only 1 http request) with all the styles and media queries in it.

    Oh, you might have another stylesheet that only applies to one page but, even then, unless it’s radically different from all the other pages it’s probably not worth it.

    #177700
    Alen
    Participant

    I’m using pre-processor (Sass) to manage different partials and everything gets compiled into single file. This way I get the befit of being organized. In addition, I get to serve one single file == one request. If you need to optimize for PageSpeed there is a module for Apache/Nginx

    Hope that helps.

    #177704
    Paulie_D
    Member

    css obfuscator

    Never heard of that…what would it actually do?

    #177707
    Paulie_D
    Member

    There are a great number of CSS minifiers out there already..not sure what ‘obfuscation’ as such would benefit you.

    Add in GZip compression and that would get the job done.

    In general, you would save more by optimizing image (which one should be doing anyway) etc.

    #177710
    Alen
    Participant

    I don’t see any major benefits of obfuscation.

    I second @Paulie_D, add GZip and minify all your CSS and JavaScript. But most importantly focus on optimizing images, as they account for 75% of weight on average site.

    Screen grab from one of my clients websites.

    If you look at the chart, where do you want to focus? Images at ~60+ % or CSS at ~7%. Biggest bang for your buck will be dealing with images.

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