Skip to content

Prevent color string from getting changed to hex #242

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

Closed
sevmusic opened this issue Sep 30, 2014 · 2 comments
Closed

Prevent color string from getting changed to hex #242

sevmusic opened this issue Sep 30, 2014 · 2 comments

Comments

@sevmusic
Copy link

Let's say I have a long list of colors I would like to use for text, borders and backgrounds.

@purp: #f161f1;

.color-variant(@name; @color){
    .bg-@{name} {
        background-color: @color;
    }
    .b-@{name} {
        border-color: @color;       
    }
    .text-@{name} {
        color: @color;
    }
}

.color-variant(purple; @purp);

I was expecting:

.bg-purple {
  background-color: #f161f1;
}
.b-purple {
  border-color: #f161f1;
}
.text-purple {
  color: #f161f1;
}

what I got was:

.bg-#f161f1 {
  background-color: #f161f1;
}
.b-#f161f1 {
  border-color: #f161f1;
}
.text-#f161f1 {
  color: #f161f1;
}

Is this something I need to work around?

@seven-phases-max
Copy link
Member

This repository is for Less documention issues/requests. For Less language/compiler issues please use https://github.com/less/less.js

Either way this wil be fixed in Less v2.0 (see #1595). As a workaround for Less 1.x use ~"purple" instead of purple.

@seven-phases-max
Copy link
Member

Closing as "wrong repo" (and fixed in v2).

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

No branches or pull requests

2 participants