Yii application component for using variables in CSS. Based on: http://net.tutsplus.com/tutorials/html-css-techniques/how-to-add-variables-to-your-css-files/
Documentation ¶
Install:
'preload'=>array(
'css'
),
'components'=>array(
'css'=>array(
'class'=>'application.extensions.CSSVars',
'privatePath'=>'application.css',
'publicPath'=>'webroot.css'
),
)
Paths:
webroot
css
main.css <-generated CSS written here (public path)
protected
css
main.css <-create your CSS here (private path)
CSS:
$font: arial, sans-serif;
$main-color: #3D7169; $secondary-color: #000;
h1 {
font: 200% $font;
color: $main-color;
}
p {
background: $secondary-color;
color: $main-color;
font-family: $font;
padding: 10px;
}
Turn off css-vars when your finished:
'preload'=>array(
// 'css'
)
Change Log ¶
March 21, 2010 ¶
- Initial release.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.