How to consolidating redundant CSS classes?

I have a webflow project with 2500 css classes. About 1500 of them are redundant. For example

Div Block = DIv Block 8
Text Block 3 = Text block 9

etc. How do we consolidation CSS and delete the redundant classes?

Unused classes are already deleted.

Manually is the only way. I normally create global classes, then base classes, then combo classes. This is usually best figured out at the beginning of a project.

Here are some resources that are helpful.

1 Like

@webdev
Are you aware of any good CSS editor programs that find redundant classes? Kind of like how XML into Excel and the convert it back to XML, but CSS to Excel then back to CSS?

@miekwave - I used a ruby gem on a large e-commerce site once.

https://rubygems.org/gems/csscss

You can output the data as .json and could import it into a spreadsheet if you needed to.

I would add that it only shows you where declarations are shared. You can use this information as a pointer on where to look.

1 Like