scss nesting wording is a lot of convenience, but the problem is caused by a heavy increase the weight, if you want to modify a style by DOM will find that you want to modify the style is always original cover, do not think, certainly weight value is not enough, but do not want to use !important
, then the solution way is to use scss of the @at-root
directive, which can then your style output on the root level of the document rather than nested under the symbol selector, so that other ways to modify styles do not worry about the style of the original weight value is too high and does not work.
Compile the results
here only .middle-left
is output to the root level, but .left-content
do not use this instruction, .left-content
or output .middle-left
under
Reduce scss style weights
Guess you like
Origin blog.csdn.net/moqiuqin/article/details/104634140
Recommended
Ranking