Using LESS, how can I subtract values with "px" at the end of the variable. I have the following variable:
@bpMobile: 600px
What I want to do is subtract this by 1px
@media only screen and (max-width: @bpMobile - 1px ) {
}
How can I achieve this with LESS?
Sorry for answering this late, but I had this very problem and it seems LESS is picky about the spacing. You also need ()
around your calculation.
This will not work:
@media screen and (max-width: (@widthSmall-2)) { }
However, this will (notice the space between the variable and the digit):
@media screen and (max-width: (@widthSmall - 2)) { }