Skip to content

Instantly share code, notes, and snippets.

@Dare-NZ
Last active December 17, 2015 00:49
Show Gist options
  • Save Dare-NZ/5523537 to your computer and use it in GitHub Desktop.
Save Dare-NZ/5523537 to your computer and use it in GitHub Desktop.
This LESS snippet lets you use a .pv(@p,@v) class to set a property with a value.
//First version
.pv(@p,@v) {
@{p}:@{v}
}
//Second version
.pv(@p,@v) {
-:~`";@{p}:@{v}".replace(/'/g,"")`;
// -:~`";@{p}:@{v}".replace(/'/g,"")`;
}
@Dare-NZ
Copy link
Author

Dare-NZ commented May 6, 2013

This LESS snippet lets you use a .pv(@p,@v) class to set a property with a value.

First version:

  • Ideal version
  • Not sure which versions this compiles but worked with a PHP based LESS compiler when the second version didn't

Second version:

  • This version compiles in winless & was found somewhere (forget where)
  • The second commented out line fixes unfortunate highlighting in some LESS editors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment