mintao
(Florian Fackler)
February 5, 2010, 11:37pm
1
Ofter you need to add a browser specific css - e.g. for our friend, the IE6. So I was looking for a "conditional" parameter.
instead of:
public void registerCssFile(string $url, string $media='')
I’d request a third parameter:
public void registerCssFile(string $url, string $media='', string $condition='')
so this:
Yii::app()->clientScript->registerCssFile('/css/ie.css', 'screen, projection', 'lt IE 8');
would produce this:
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" href="/css/ie.css" media="screen, projection" />
<![endif]-->
heyhoo
(Mark)
February 22, 2010, 8:04pm
2
Good idea! I was searching for this option as well. At this moment it seems not possible to use registerCssFile for a browser specific css and sometimes you just need that. May I suggest to add this third parameter to the registerScriptFile function as well.
choiceerp
(Goodgoods2007)
May 16, 2010, 10:22pm
3
Very good, I need it
I’m very impatient that future will be integrated in the yii distrib
scriptorum
(Yiiframework)
January 14, 2011, 10:10pm
4
This is just what I was looking for. I’d love to see this in Yii.
samdark
(Alexander Makarov)
January 15, 2011, 11:17pm
5
nothing083
(Nothing083)
January 8, 2014, 10:38am
6
Hi samdark,
how to use conditional classes in <html> tag in case we use a third party library?
ex:
<link rel="stylesheet" href="path/to/font-awesome/css/font-awesome.css">
<!–[if IE 7]>
<link rel="stylesheet" href="path/to/font-awesome/css/font-awesome-ie7.css">
<![endif]–>
We shouldn’t merge font-awesome-ie7.css to font-awesome.css because it hard to migrate to new version
samdark
(Alexander Makarov)
January 8, 2014, 12:18pm
7
If the library is used sitewide as font awesome, you can paste it as HTML in layout file.
nothing083
(Nothing083)
January 10, 2014, 7:01am
8
Thank for your feedback but i think it will more flexible if we have an option to allow insert prefix and suffix for each Css/Javascript file (IE condition or comment for example)
samdark
(Alexander Makarov)
January 13, 2014, 2:11pm
9
Probably. Please create an issue at github and we’ll look into it. Can’t promise that it will be solved and solved fast though. Thanks.