Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

string interpolation and variables with % units #350

Closed
eschmitt opened this issue Aug 20, 2011 · 1 comment
Closed

string interpolation and variables with % units #350

eschmitt opened this issue Aug 20, 2011 · 1 comment

Comments

@eschmitt
Copy link

// the following code uses string interpolation to embed arguments from the mixin into a linear-gradient:
.linear-gradient (@start-color: #ffffff, @end-color: #cccccc, @start: 0%, @EnD: 100%) {
-pie-background: ~"linear-gradient(top, @{start-color} @{start}, @{end-color} @{end})";
}

// and it yields the following in less.js:
-pie-background: linear-gradient(top, #ffffff 0%, #cccccc 100);

Note that there is no percent sign (%) after the "100" value... I tried this with a number of different values and it only seems to be able to parse 0%. Its kind of a mute point for me, as I realized that I didn't need the string interpolation after all, but I thought I would submit it as it may have other implications.

@lukeapage
Copy link
Member

When I test this the unit is always left off (for the 0 and the 100).. therefore you could fix it by adding @{start}%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants