1

I am just curious, because i am trying to get my site working for both IE and chrome, and I want it to load only a specific css file. Conditional stylesheets arent working for me, as I cannot see the change in the browser when I check it's html file.

3
  • 1
    Why Conditional stylesheets arent working for YOU only ?
    – niksmac
    May 16, 2013 at 12:13
  • @NikhilM I'm gonna take a stab that the OP is using IE10 - Microsoft dropped support for them
    – Clive
    May 16, 2013 at 12:34
  • Anyway, question about .info vs .tpl.php for css is a good question. All points in my answer below are from experience, fixing stuff after guys who didn't bothered to ask it. We can disagree with the idea, but I really appreciate asking!
    – Mołot
    May 16, 2013 at 12:57

1 Answer 1

2

It is bad idea, on so many levels I'm sure I can't list all.

  • Conditionally included stylesheets will get cached by various proxies and served with no respect for original conditions.
  • Modules like CDN will not be able to work on your CSS files to speed things up.
  • Aggregation and cache modules will stop working as well.
  • Search engine bots will get confused and may think you are trying to trick them by serving different version of a page to bot, and other one to bot disguised for an user - risk of google ban.
  • If, in future, someone will redefine page.tpl.php for certain content types, you will have the same file described in many places - easy way for inconsistency and styling bugs.
  • CSS provided by modules might end up in other position to your own than they are now, this can cause hard to diagnose display bugs.
2
  • ok thanks :).Then I guess I should try conditional stylesheets again, could you help me understand how using this statement conditional-stylesheets[if lt IE 7][all][] = ie6-and-below.css how can I have a condition for if it was in chrome. It seems like the stylesheets I specified for other browsers will still show up. May 16, 2013 at 12:05
  • 1
    @user1675999 CSS questions are off topic here, please see Stack Overflow for help with IE conditional comments
    – Clive
    May 16, 2013 at 12:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.