@Rombout
Suppose you copy a simple structure like this;
<div class="section-container">
<div class="div-block-23">
<h1 class="main-heading">Heading 1</h1>
...
There can easily be hundreds of elements, each with a mix of classes.
- Some classes might be relevant and consistent between project A and project B, there is no conflict; the class name and definition match, it preserves the name.
- Most classes will not be relevant, or consistent, like
Div Block 23, which was just automatically created by the system. If there’s a name conflict, it’s unlikely the definitions match, and Webflow will create Div Block 23 2
- Some classes might be relevant, and exist in both A and B, however the definitions are inconsistent between A and B. Webflow doesn’t know this so it opts for safety. In the case of a conflict, it assumes case #2, and creates a second version with the correct style settings.
Webflow favors #1 & #2 which are the most common.
#3 is less common because it’s generally unlikely that you’ll have two different identically-styled projects with absolutely identical naming conventions, and it would be exceptionally difficult to maintain that. If you really want centralized styling, that’s what component libraries are for.
Certainly there could be a “class reconciliation tool” where it lists ALL of the classes, shows which are new, shows which exist but match, shows which exist and do not match, and lets you choose class by class. But that’s a lot of UX.
An all-or-nothing dialog as you describe creates other risks of damaging the styling on the pasted content, and then good luck finding and fixing the problem.
Also, the problem of class duplication ( same same but different ) exists as a general design decay problem. You create a new Title 1 heading because you didn’t know Main Heading already existed and is what you wanted. It’s hard to track, especially has Webflow doesn’t maintain any association between element type and class list. Ideally when you drop a heading element, it would recommend 10 classes that are already used on heading elements. Same for tabs, buttons, divs, vdeo elements, etc.
I think I’d prefer it to paste exactly the right content with exactly the right source styling, even if that creates duplicates. I don’t want Webflow to break my design. But then to also have some form of “merge classes” tool which can be used for refactoring on any project.
Each class would have a “signature” based on its definition. Merge classes would list identical and similar classes, and let you preview impact, so that you know whether all elements with class X should be reclassed using class Y ( and X gets removed ).
Doesn’t exist now though.
For now, most devs use utility class design systems, where the class are all pre-defined and therefore always match. Much like Tailwind’s appoach.
Or they use custom classes and a Chrome extension like this one;
Or, there are a number of apps that are extending Webflow.
These are the ones related to classes.