Streaming live at 10am (PST)

Renaming Global Classes do not change name for same named Combo Classes


#1

Not sure if this exact problem was ever mentioned (I didn’t find any references) so here it goes:

It is impossible to rename a class in a multi-class item when the class renamed is the second and higher up in the name of this item. OK, that sounds incomprehensible even for me so here is an easily reproducible case:

  • create div withe class of “main”
  • create a div with the class of “secondary”
  • create a div, give it first the class “main”, then add class “secondary”
  • rename class “main” to “main-alt” using the first div. Check the third div - it is now correctly named .main-alt .secondary
  • rename class “secondary” to “secondary-alt” using second div. Check the third div - it is still named .main-alt .secondary while we expect it to be named .main-alt .secondary-alt

This leads to a mess when creating complex multi-class based systems where you just add classes responsible for some attributes to the elements and then later decide to rename some class.

Or maybe I am missing something? Thank you!


#2

Hi @dram, at the moment this is expected behavior as combo classes are separate from global classes even though they have the same name.

A couple of notes:

  • ‍The name you use for a combo class will apply styles to combo classes with the same name.
  • ‍We do not recommend using global classes as combo classes as there can be inheritance issues that can break your design across your project.

Learn more about Combo classes here: https://university.webflow.com/article/combo-classes

I hope this helps,

My best,
Dave


#3

Hi Dave!

Of course I know that this technique should be used carefully. I usually create very specific classes for one or another singular purpose, like having a class that creates a bottom margin of 2em, then apply it to various elements. Later when I need to modify this margin to, say 3em, there is no need to change properties on every element with this margin, just for that one special class of bottom-margin.

Anyway cow comes that renaming first class in a combo-classed object is possible but not the following classes? Kinda counter-intuitive.