26

Is there a way to give SASS styles applied using the @extend feature the status of being !important? I tried this:

.somestyles { width: 1000px; } .importantstyle { @extend .somestyles !important; } 

Didn't work, but how might this be done? Or is it just not possible?

2
  • 1
    Idk, but I feel like this should turn into a feature. Commented Oct 16, 2020 at 13:21
  • That would be a very good idea Commented Jan 9, 2024 at 18:34

1 Answer 1

34

What you're asking for is not possible. You could increase the specificity of the selector that's doing the extending.

body .importantstyle { @extend .somestyles; } 
Sign up to request clarification or add additional context in comments.

1 Comment

Avoid comments like "thanks". Hum sorry but this time really just want to say thanks, it saves me a lot of time for sure.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.