CSS: Yes

There are many developers who hate CSS; don’t understand, don’t want to get it, etc. Most of the reasons are either inefficiencies in the language or misunderstandings on how to properly structure the website. I like CSS best, but I always hate certain parts of the language, such as having to repeat very similar selectors.This is why I am so happy when I see CSS :is ; A way to avoid duplication in the selector structure!

You all remember this unconscious CSS repetition:

section h1,
section h2, 
section h3,
article h1,
article h2,
article h3 {
  /* styles here */

I always hate doing this-a lot of maintenance costs and bloated CSS files.This is where :is Come to the rescue:

:is(section, article) :is(h1, h2, h3) {
  /* styles here */

is: It is a perfect summary of how a small addition to the CSS language makes developers’ lives easier!

Post CSS: Yes First appeared in David Walsh Blog.

Leave a Reply

Your email address will not be published. Required fields are marked *