DEV Community

Vladimir Schneider
Vladimir Schneider

Posted on

2 1

Automate cleaning css rules

Hi, dev.to community!

Today I researched normalize.css and I thought about how I could improve css files of plugins.

Each of us wrote css rules for specific browsers and if change supported browsers list for a project the rules remain in code. You may search it and remove, but it so slowly.

Problems that can be solved:

  1. your css rules and css of plugins if current project does not support this browser will have been removed
  2. If you change supported browsers css rules will have been removed too

I think about a tool for automate it.

For example input:

/* only for: IE 10 */
template {
  display: none;
}

a {
  color: red;
}
Enter fullscreen mode Exit fullscreen mode

and output will be

a {
  color: red;
}
Enter fullscreen mode Exit fullscreen mode

I can do it as PostCSS plugin and check browserslist for compares.

What do you think about it?

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay