0

I have a class that participates in several selectors in several .scss files. In one of selectors there is margin:0 !important; I want to create a clone of this class, but it should exclude margin:0 !important; How is it possible to do? Thanks in advance

4
  • 2
    Sound like you have this round the wrong way. Create the class without the property you don't want then extend it to a new class with the extra property. Also, reconsider the use of !important it's rarely necessary in properly structured CSS.
    – Paulie_D
    Dec 10, 2018 at 17:04
  • @Paulie_D, I thought about this. But it is a huge system -- so I don't want to change anything(or do minimal changes) in an old class. Let's say, old class is named X. This way I would have to rename it to something else (let's say Y), remove margin, and then create a new class named X and extend Y. This a lot of changes...
    – Anton
    Dec 10, 2018 at 17:08
  • Then the answer is... you probably can't without another !important statement to reset the margins again but you could try.
    – Paulie_D
    Dec 10, 2018 at 17:10
  • 1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.