| 1 |
About Conditional Stylesheets |
ABOUT CONDITIONAL STYLESHEETS |
| 2 |
|
----------------------------- |
| 3 |
|
|
| 4 |
Internet Explorer implements a proprietary technology called Conditional |
Internet Explorer implements a proprietary technology called Conditional |
| 5 |
Comments. While web developers frown upon technologies that aren't |
Comments. While web developers frown upon technologies that aren't cross-browser |
| 6 |
cross-browser supported, many CSS developers have found Conditional Comments |
supported, many CSS developers have found Conditional Comments very useful since |
| 7 |
very useful. They can fix the broken rendering of CSS in IE by placing IE-only |
they can be used to fix the broken rendering of CSS in IE by placing IE-only CSS |
| 8 |
CSS inside conditional comments. |
inside conditional comments. |
| 9 |
|
|
| 10 |
This module allows themes to easily add conditional stylesheets to the the |
This module allows themes to easily add conditional stylesheets to the theme's |
| 11 |
theme's .info file. |
.info file. |
| 12 |
|
|
| 13 |
|
|
| 14 |
Theme Users |
THEME USERS |
| 15 |
|
----------- |
| 16 |
|
|
| 17 |
You only need to enable this module if a theme requires that you use it. Once |
You only need to enable this module if a theme requires that you use it. Once it |
| 18 |
it is enabled, the module automatically performs all of its work for any |
is enabled, the module automatically performs all of its work for any theme |
| 19 |
theme requiring it. You don't need to configure anything. |
requiring it. You don't need to configure anything. |
| 20 |
|
|
| 21 |
|
|
| 22 |
Theme Developers |
THEME DEVELOPERS |
| 23 |
|
---------------- |
| 24 |
|
|
| 25 |
Before this module was available the only way to have IE conditional |
Before this module was available the only way to have IE conditional stylesheets |
| 26 |
stylesheets was to hard-code them into your page.tpl.php. This module allows |
was to hard-code them into your page.tpl.php. This module allows you to add |
| 27 |
you to add "conditional-stylesheets" lines to your theme's .info file. |
"conditional-stylesheets" lines to your theme's .info file. |
| 28 |
|
|
| 29 |
The syntax for that is: |
The syntax for that is: |
| 30 |
conditional-stylesheets[CONDITIONAL][MEDIA][] = stylesheet.css |
conditional-stylesheets[CONDITIONAL][MEDIA][] = stylesheet.css |
| 31 |
|
|
| 32 |
where |
where |
| 33 |
CONDITION can be any of the conditions specified in: |
CONDITION can be any of the conditions specified in: |
| 34 |
http://msdn.microsoft.com/en-us/library/ms537512.aspx |
http://msdn.microsoft.com/en-us/library/ms537512.aspx |
| 35 |
MEDIA can be any of the normal CSS media keywords. |
MEDIA can be any of the normal CSS media keywords. |
| 36 |
|
|
| 37 |
For example, to add a stylesheet that only targets IE 6 and below, use: |
For example, to add a stylesheet that only targets IE 6 and below, use: |
| 38 |
conditional-stylesheets[if lt IE 7][all][] = ie6-and-below.css |
conditional-stylesheets[if lt IE 7][all][] = ie6-and-below.css |
| 39 |
|
|
| 40 |
And to add a print stylesheet for IE8 only, use: |
And to add a print stylesheet for IE8 only, use: |
| 41 |
conditional-stylesheets[if IE 8][print][] = ie8.css |
conditional-stylesheets[if IE 8][print][] = ie8.css |
| 42 |
|
|
| 43 |
|
|
| 44 |
|
*** IMPORTANT *** |
| 45 |
|
|
| 46 |
|
Drupal 6 also stores a cache of the data in .info files. If you modify any lines |
| 47 |
|
in your theme's .info file, you MUST refresh Drupal 6's cache by simply visiting |
| 48 |
|
the admin/build/themes page. |