GithubHelp home page GithubHelp logo

Comments (10)

cloudhead avatar cloudhead commented on May 18, 2024

Hey, I might have something just for you: try the escape function:

foo: e("hello:world");

Output:

foo: hello:world;

from less.js.

cloudhead avatar cloudhead commented on May 18, 2024

There's also a format function:

@var: "world";
%("hello %s", @var);

Output

"hello world"

And they can be used together.

from less.js.

muszek avatar muszek commented on May 18, 2024

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.

muszek avatar muszek commented on May 18, 2024

Thanks. And scratch the last post (started writing before you posted your 2nd)...

from less.js.

cloudhead avatar cloudhead commented on May 18, 2024

great.

from less.js.

jamesfoster avatar jamesfoster commented on May 18, 2024

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.

muszek avatar muszek commented on May 18, 2024

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
v0.1.91-35-g11f673e
muszek@bobek:
/www/fooba/webroot/css$ cat test.less
@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.

muszek avatar muszek commented on May 18, 2024

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.

jamesfoster avatar jamesfoster commented on May 18, 2024
e(%(...))

from less.js.

muszek avatar muszek commented on May 18, 2024

thanks. too bad there's another issue --> http://github.com/cloudhead/less.js/issues/issue/27

from less.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.