Comments (10)
Hey, I might have something just for you: try the escape function:
foo: e("hello:world");
Output:
foo: hello:world;
from less.js.
There's also a format function:
@var: "world";
%("hello %s", @var);
Output
"hello world"
And they can be used together.
from less.js.
Thanks
How about string concatenation?
Example scenario (pseudo code):
.transparent-background(@opacity-level: 5) {
background-image: url(transparent-{@opacity-level}.png);
}
.transparent-background(2);
would output this:
background-image: url(transparent-2.png);
Is something similar implemented?
from less.js.
Thanks. And scratch the last post (started writing before you posted your 2nd)...
from less.js.
great.
from less.js.
I don't understand why the compiler doesn't stop given your input. I get the following error:
Parse Error on line 2:
@url: http://example.com;
----^
we should catch all these when we add tests for error cases
from less.js.
While lessc is running, node takes 100% of my CPU.
I case there's a need for some data:
muszek@bobek:/www/fooba/webroot/css$ node --version/www/fooba/webroot/css$ cat test.less
v0.1.91-35-g11f673e
muszek@bobek:
@url: http://example.com;
div {
something: @url;
}
muszek@bobek:~/www/fooba/webroot/css$ /home/muszek/scripts/less.js/bin/lessc test.less
from less.js.
cloudhead: I tried the format function:
.transparent-background(@opacity_level: 5) {
background: %('url(stripes/1x1t%s.png)', @opacity_level) repeat 0% 100%;
}
but the output of the function is enclosed in quotes as well:
.round1 .box_inner {
background: "url(stripes/1x1t5.png)" repeat 0% 100%;
}
is there any way to shake off the quotes?
from less.js.
e(%(...))
from less.js.
thanks. too bad there's another issue --> http://github.com/cloudhead/less.js/issues/issue/27
from less.js.
Related Issues (20)
- sys import doesn't work with nodejs 18 HOT 3
- "Selector Interpolation with Extend" possibly contains outdated info (doc states not supported, but works) HOT 5
- Adding a default value to a mixin causes arity match failure HOT 2
- Container style queries unexpected space HOT 8
- Can not find variable when a variable be created in plugin. HOT 2
- Nested @layer rule lost scope HOT 1
- Mixin calls with empty parentheses shouldn't match with classes with the same name
- less variables cannot be used under the not selector, delimiter HOT 1
- 网络安全漏洞修复
- Whether the official statement "Selectors with variables will not match" is wrong? HOT 1
- @font-face doesn't respect scope when compiling HOT 2
- In version 4.2.0, a container query in a mixin that uses a LESS variable doesn't use the right value when the mixin is called multiple times with different values
- `mask-repeat: no-repeat` being transformed into `mask-repeat: initial` in production mode HOT 1
- Empty calculation passed to css in 4.2.0 HOT 4
- less does not compile using vite anymore HOT 1
- Variable interpolation with math operator like + is not compiling properly HOT 1
- Comments with doubleslash are not stripped before compile
- @starting-style doesn't nest correctly HOT 1
- Nested pseudo-selectors that take selectors eport missing a closing ')' when separated by commas
- Lessc to provide preserve comments option
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from less.js.