79415710

Date: 2025-02-05 17:56:51
Score: 3
Natty:
Report link

No dude, you can't use!important with @extend in Sass. @extend works its magic by inlining selectors rather than copying styles, so an!important flag can't be passed through from an @extend statement. The extended classes would inherit the property if a base class has an!important, but not the!important itself. You can only apply it explicitly to an extending class, or directly inside the base class's styles:.

Reasons:
  • No code block (0.5):
  • User mentioned (1): @extend
  • User mentioned (0): @extend
  • User mentioned (0): @extend
  • Single line (0.5):
  • Low reputation (1):
Posted by: Arjad Gohar