Skip to content

Instantly share code, notes, and snippets.

@sergej-brazdeikis
Created July 21, 2012 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sergej-brazdeikis/3155973 to your computer and use it in GitHub Desktop.
Save sergej-brazdeikis/3155973 to your computer and use it in GitHub Desktop.
Less.js variables inside CSS property
// example how to use variable inside of CSS property name
.pv(@p,@v)
{
-:~`";@{p}:@{v}".replace(/'/g,"")`;
}
#container {
.pv('border-radius',10px);
}
/*
* Output:
* #container {
* -: ;border-radius:10px;
* }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment