Skip to content

Prevent color string from getting changed to hex #242

Closed
@sevmusic

Description

@sevmusic

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions