0

I have the following css declaration in a .less file:

.qb-select-content {
    width: calc(100% - 26px);
    float: left;
}

When I compile this code, the angular-cli converts the width: calc(100% - 26px); to width: calc(76%).

Any one can explate why this is happening and how can I prevent this behavior?

Luca
  • 9,259
  • 5
  • 46
  • 59
Ricardo Rocha
  • 14,612
  • 20
  • 74
  • 130

1 Answers1

1

you can escape your declaration (notice the ~ tilde):

.qb-select-content {
    width: calc(~100% - 26px);
}

the above will output after compilation:

.qb-select-content {
    width: calc(100% - 26px);
}

keep in mind that it's not the angular-cli but your LESS compiler doing this bit

alternatively you can look into interpolation which is a pretty useful feature in other situations too: https://github.com/SomMeri/less4j/wiki/Less-Language-String-Interpolation

Luca
  • 9,259
  • 5
  • 46
  • 59