Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

SCSS – Is there a 'self' indentifier?

I want to add SCSS on the body, for default, and respecify them on the P and LI tags (not in total control of the site, and wanna stop plugins from hijacking my p’s and li’s).

So I have to do something like this

body{
  color:#000;
  p,li{
    color:#000;
  }
}

But that makes some ugly repetition. So is there a thing in SCSS that refers to self or something like that? So at the end I could have the same styles on body, body p, and body li?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Something like

body{
  [self],p,li{color:#000;}
}

>Solution :

body{
  &,p,li{color:#000;}
}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading