Does anyone know how to += with SCSS?
Example:
.example {
padding: 2px;
&:hover {
padding: current_padding + 3px; // OR
padding+= 3px //... something like this
}
}
I'm trying to get .example:hover to have 5px padding.
In order to open a SCSS account, the customer must visit the post office or bank branch and fill up the related form. The same form should be attached with KYC documents, age proof, ID proof, Address proof and cheque for deposit amount.
Easy to learn: If you are familiar with CSS already, then you'll be glad to know that Sass actually has a similar syntax, and so you can start using it, even after this tutorial ;) Compatibility: It is compatible with all versions of CSS.
Add the following to the <head> tag of your HTML file. The extension we installed will compile the SASS file index. scss into CSS and store the compiled code in a new CSS file, also called index. css .
I don't think there's a way to do exactly what you want to in SCSS, but you could achieve the same effect by using variables:
SCSS
.example {
$padding: 2px;
padding: $padding;
&:hover {
padding: $padding + 3px;
}
}
Compiles to
.example { padding: 2px; }
.example:hover { padding: 5px; }
See the documentation on variables and number operations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With