Nasir
Nasir

Reputation: 4865

How to escape html characters in LESS?

I was wondering how escape the + symbol using LESS?

My code so far(no luck):

 &.blocked {
    color:#fff;
    &:after {
      content:"\+";
    }
 }

Any help would be greatly appreciated, Thanks

Upvotes: 0

Views: 84

Answers (2)

Nasir
Nasir

Reputation: 4865

Thanks for your help guys, but I found a workaround where I don't need to use any characters at all. Solution: A span with a background-color and a solid border

Upvotes: 0

Danield
Danield

Reputation: 125433

How about:

&.blocked {
    color:#fff;
    &:after {
      content:'\002B';
    }
 }

Also, here's a handy link for escaping in CSS

Upvotes: 1

Related Questions