Is anyone else getting duplicate classes every time they import a component from a library?
I installed the untitled ui library to a project and changed the styling on a header (uui-heading-large) and every time I add a different component from the library it adds a new class (uui-heading-large 2) am I missing something or am I using the libraries wrong?
It goes for every class that gets added, regardless of page, or type of component.
If you changed the styling, then yes I’d expect it to create a new copy of that class to avoid interference.
The namespacing approach you see, like ZM_class is sort of a makeshift way to minimize conflicts with your own classes, but you’ll still get dupes created in the case of class-change conflicts.
The copy paste bug is a much bigger issue actually.
For the library, the only times I’ve seen duplication of classes is when I made a change to a class. So if your workflow is;
Add a lib component
Adjust its styling
Add another lib component from the same library
You’ll run into class collisions and get renaming. It makes sense, although ideally, for advanced users who understand HTML and CSS, Webflow might ask whether you want to use existing classes. That would be cool, but disastrously confusing for someone who doesn’t understand those things.
Change your workflow to;
Add all the lib components you want from a particular library
Now make your styling adjustments
And you’ll get cleaner results with less class-fixing.