Best practice for repurposing CSS

We have been working on a great web application with Rails for a long time and have created a lot of CSS for our templates. Style definitions are organized into a bunch of css files that grew up with the project. Since people are not always as disciplined as they should be, it seems to me that many definitions have become outdated and useless.

Is there a (semi) automatic way to get rid of this stuff? How do you define useless css in your project?

+3
source share
3 answers

You can use the Dust-Me Selector plugin for Firefox or CSS Redundancy Check .

, , .

, , CSS Tidy . CSS, , CSS :)


, CSS . JSLint jsFiddle.net, , .

+5

"", . firefox Dust-Me Selectors . .

edit:

+2

CSS ( 3500 ), , grep- . (, , xargs ).

After this process, we removed a few CSS styles too much because some of our CSS style names were dynamically generated (a bad idea in retrospect).

For more detailed information about our workflow and results, I wrote several thousand words about our experience of transforming CSS from a Rails 2.x application into a ready-made, responsive and modular Rails 4.2.x SASS./p> setting

CSS refactoring: from append-only to modular CSS

0
source

Source: https://habr.com/ru/post/1775370/


All Articles