- Example 1 (just in case): "Are your sure you nee any factory in this case at all?"
- Example 2: ["Factory"](http://less2css.org/#%7B%22less%22%3A%22%5Cn%2F%2F%20usage%3A%5Cn%5Cndiv%20%7B%5Cn%20%20%20%20.opacity-animation(show-my-element%2C%200%2C%201)%3B%5Cn%7D%5Cn%5Cnspan%20%7B%5Cn%20%20%20%20.color-animation(mutate-my-element%2C%20blue%2C%20red)%3B%5Cn%7D%5Cn%5Cn%2F%2F%20impl%3A%5Cn%
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.localise(@-) { | |
.ie, .au, .gb, // <- langs "variable" | |
.localise & | |
{@-();}} | |
// usage: | |
.localise({ | |
.button { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foo:extend(.font-size-xxl) {} | |
.font-size-xxl { | |
@media (min-width: 768px) { | |
font-size: 48px; | |
} | |
@media (max-width: 767px) { | |
font-size: 32px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// example for http://stackoverflow.com/questions/44007852 | |
@font-base: 16; | |
@font-scale: 1.2; | |
@line-height: 1.5; | |
// ............................................ | |
@tags: h1, h2, h3, h4, p; |
Of course numbers as selectors, like 1 + 2
, do not make any sense on their own (considering that they are not valid CSS selectors),
but they can be used to form more complex things:
1, 2 {
foo-& > bar-& {color: red}
}
So even if (I suppose) such feature was not really intentional, it could be worth to keep unless it gets totally broken.
"Mixin Antigenerator" example for less-plugin-lists
docs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test { | |
left-etc { | |
.FluidGutter(margin, 1, 2, 3, 4); | |
} | |
vert-horz { | |
.FluidGutter(padding, @v: 22, @h: 33); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.FluidGutter(@property, @top, @right, @bottom, @left, @vertical, @horizontal, @all) when | |
(@property = margin), | |
(@property = padding) { | |
.MakeFluidGutter() when (% either of trbl is not 0 %) { | |
.MakeGutter(@property, @top @right @bottom @left); | |
} | |