Streaming live at 10am (PST)

How to consolidating redundant CSS classes?

#1

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.

#2

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
#3

@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?

#4

@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