CSS Variable assign -


is possible use variables within css document, possibly using javascript?

for example if have overall variable "colorone" assigned "#ffffff".

is possible to call "colorone" later? e.g. "color: colorone;"?

i use find , replace replace instances becomes tedious, there alternative?

you can use preprocessor, instance: http://lesscss.org/

what enables write css this

@colorone: #ffffff;  .main_links {   color: @colorone; } h2 {   color: @colorone; } 

and output once it's compiled be

.main_links {   color: #ffffff; } h2 {   color: #ffffff; } 

there more reasons use less assigning variables, it's powerful , allows lot more, nested styles, have @ documentation: http://lesscss.org/#synopsis


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -