borodean / less-properties Goto Github PK
View Code? Open in Web Editor NEW[Deprecated] Mixin that adds some variable property support to LESS.
[Deprecated] Mixin that adds some variable property support to LESS.
Have you considered adding a license?
Maybe MIT or Apache? or perhaps the WTFPL if you're into that sorta thing.
Just please not GPL, LGPL or BSD :)
Thanks!
With any value that has spaces in it (e.g. 1px solid red
), fails to generate a proper CSS definition since LESS treats the argument as an array of values. You can get around this in your solution by passing it in as an escaped string (e.g. ~"1px solid red"
). Out of your test cases, the following seem to contain this bug:
.test-compound
.test-function-param-preserve-second
.test-function-param-preserve-first
.test-function-param-preserve-double
.test-nested-coumpoun
Here is an example of the failing output:
.property(transition, all .5s ease, "webkit moz o");
.test-compound {
-test-should: generate a property definition that looks correct;
-less-property: ;
-webkit-transition: [all, 0.5s, ease];
-moz-transition: [all, 0.5s, ease];
-o-transition: [all, 0.5s, ease];
transition: [all, 0.5s, ease];
}
In my solution, I encountered this same problem, but resolved it by escaping the argument before using it. In your mixin, if you escape both the @property
and @value
arguments into new variables, I think it would be more robust. For example:
.property(@property, @value, @prefixes: '', @base: true) {
@prop: e('@{property}');
@vals: e('{@value}');
// ...
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.