css-vars Use variables in CSS files.

  1. Documentation
  2. Change Log

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.
3 0
4 followers
877 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: User Interface
Tags:
Developed by: gazbond
Created on: Mar 21, 2010
Last updated: 8 years ago

Downloads

show all