Y
Y
Yaraife2011-09-23 14:46:38
css
Yaraife, 2011-09-23 14:46:38

Less CSS is a framework for css. Question about lines?

Perhaps the solution is obvious, but I just don't see it?
Here is a description of the language: lesscss.ru/
I'll ask for a little fresh look at the question:
How can I join two strings without a space?
Documentation example:
@var1: 1;
@var2: 2;
@var3: @var1 @var2;
As a result, @var3 will be equal to "1 2".
Any combination of brackets, quotes, and the output function without processing e("some text"); do not give a result.
Tested variants:
@var3: @var1 @var2; // output: "1 2"
@var3: @var1()@var2; // error
@var3: ((@var1)(@var2)); // error
@var3: ( ( @var1 ) ( @var2 ) ); // "1 2"
@var3: e("") @var1 e("") @var2 e(""); // " 12 "
@var3: "@var1 @var2"; // "@var1 @var2"
@var3: '@var1 @var2'; // "@var1 @var2"
Use cases: (in case anyone wonders why?)
1) changing the type, eg 1px -> 1%
2) creating links, eg: @root/@file-name
P.S. any options and theories are allowed. Perhaps your answer will give me the right idea.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Y
Yaraife, 2011-09-23
@Yaraife

The answer is found in the questions on the github .
The solution is to use the "%();" output function, and looks something like this:
@url-root: "sub.site.zone/folder/";
@url-my: "images/arrow.png";
@url-full: e(%("url(http://%s%s)", @url-root, @url-my));

H
Halfi, 2011-11-26
@Halfi

There is a second way if you need to use JavaScript inside: Compile to:
@str: "hello";
@var: ~`"@{str}".toUpperCase() + '!'`;

@var: HELLO!;

S
Sauron918, 2015-09-17
@Sauron918

You can use interpolation:
@url: "@{url-root}@{url-my}";

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question