Is there something like "+ =" in SASS?

Is it possible to override a numeric attribute in SASS by increasing or decreasing? Consider something like this:

h1 {
    font-size: 10px;
}

h1.important {
    font-size: += 10px;
}

I know I can get around this by specifying a variable. Can this be done without?

+5
source share
1 answer

Not sure if it works +=, but you can use a base variable and then add to it in another class.

$baseFontSize: 10px

h1
  font-size: $baseFontSize


.border 
  font-size: $baseFontSize + 10px
+4
source

All Articles