Sorry, I didn't make that clear. The :not([class]) would be for targeting the paragraphs or headings that come from the CMS or whatever, where you don't have the ability to add or target classes.
<main><pclass="lead">Lorem ipsum...</p><!-- other content not generated by the CMS --><divclass="cms-sections"><divclass="cms-section pos-0 cms-section-default"><divclass="cms-block-container"style="/* some inline style */"><divclass="cms-block-container-row row cms-row"><divclass="col-12"data-cms-element-id="somecrypticidstring"><divclass="cms-element-text"><h2>Headline</h2><p>CMS Content. Lorem ipsum...</p></div></div></div></div></div></div>
The lead paragraph would be black, inheriting the color from the body.
So the not selector makes them act like global element styles that you opt out of by simply adding a class to the HTML element (even a blank string).
The assumption is that anything you want custom styling for that isn't regular body copy content (from a CMS or similar), you probably have control over the HTML and would normally be adding classes to style them anyways.
But anyways, this is obviously a whole other conversation! 🙂
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Sorry, I didn't make that clear. The
:not([class])
would be for targeting the paragraphs or headings that come from the CMS or whatever, where you don't have the ability to add or target classes.e.g.
The lead paragraph would be black, inheriting the color from the body.
So the not selector makes them act like global element styles that you opt out of by simply adding a class to the HTML element (even a blank string).
The assumption is that anything you want custom styling for that isn't regular body copy content (from a CMS or similar), you probably have control over the HTML and would normally be adding classes to style them anyways.
But anyways, this is obviously a whole other conversation! 🙂