sass

Possible to make SASS @extend styles !important?


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?


Solution

  • 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;
    }