Reputation:
I would like to write css code like this. Is there any plugin is available for this?
mcolor = #ff00ff;
body
{
color: mcolor;
}
.ele
{
width: body.width / 2;
}
Upvotes: 4
Views: 116
Reputation: 323
No, Not have any way to use variable in css.
If you want to use varaible then you want to use css in php or javascript or orher language.
For more information. you learn this on
OR
Upvotes: -1
Reputation: 12569
In pure CSS it's impossible. But there is a working draft of the spec. It will not be available in the browsers any time soon so in the mean time use LESS or SASS as @Logan Serman suggests
Upvotes: 0
Reputation: 29860
Take a look at LESS: http://lesscss.org/ or SASS: http://sass-lang.com/
Upvotes: 6