less.js icon indicating copy to clipboard operation
less.js copied to clipboard

I can't understand how works this code

Open Pestov opened this issue 14 years ago • 9 comments

.gradient (@gradientType, @direction, @color1, @point1, @color2, @point2) {}
.gradient (linear, @direction, @color1, @point1, @color2, @point2) {
background-image: linear-gradient(@direction, @color1 @point1, @color2 @point2);
background-image: -o-linear-gradient(@direction, @color1 @point1, @color2 @point2);
background-image: -moz-linear-gradient(@direction, @color1 @point1, @color2 @point2);
background-image: -webkit-linear-gradient(@direction, @color1 @point1, @color2 @point2);
background-image: -ms-linear-gradient(@direction, @color1 @point1, @color2 @point2);
}

.block {width: 100px; height: 100px; .gradient(linear, right, #000000, 10%, #fff, 70%); display: inline-block;}  

<div class="block"></div>

It's work. But if i write

.border (@px, @solid, @color) {
    border: @px, @solid, @color;
}
.block2 {width: 100px; height: 100px; .border(10px, solid, #000000); display: inline-block;}  

<div class="block2"></div>

It's no work, i must write "border: @arguments". Why?

Pestov avatar Oct 05 '12 19:10 Pestov

sigh. not that you meant it, but @spam

px avatar Oct 05 '12 19:10 px

I am not understant. Why @spam? I write to example. In first example i am not declare variables and don't write @arguments, as a result work. Second example works if I specified @arguments. Why?

I want create gradient mixin, which will work in any case. But i am not programmer, i know html and css.

Pestov avatar Oct 08 '12 01:10 Pestov

It's the commenting system on @github. It now supports @'ing people like @twitter. Due to the CSS Syntax of @px I get email notifications and references.

px avatar Oct 08 '12 01:10 px

yes please give examples in code format, then notifications are not generated (note below.. no bold) - http://github.github.com/github-flavored-markdown/

e.g. 4 spaces before the code

@px

or in a sentence with backticks @px

lukeapage avatar Oct 08 '12 08:10 lukeapage

to answer your question I'd need to have a go with your example and see if I can reproduce. haven't had time.

lukeapage avatar Oct 08 '12 08:10 lukeapage

Update issue

Pestov avatar Oct 11 '12 00:10 Pestov

ah I understand now. This bug is a duplicate.. see #946.. There is a lot of discussion about this

Do you agree?

lukeapage avatar Oct 18 '12 11:10 lukeapage

Sorry, but my english is bad. I understand, that as a result, in LESS all work logically correct and can not be otherwise?

Pestov avatar Oct 22 '12 23:10 Pestov

closing as duplicate

lukeapage avatar Nov 25 '12 17:11 lukeapage