POLL: When changing a style of an element, how would you like the class name to be saved

As we are making very good progress with the new Design Panel, we are looking for better ways to generate CSS classes for your styling than only using inline styles like now.

So if you would have a CSS selector for the current element, how would you like to name it?

  • Generate a single unique CSS class for me, but I can rename it later
  • I want to fully name my element’s CSS class
  • I want to reuse a lot of different CSS classes
  • I want to enter a multi classes selector

0 voters

I voted for option 2, but all four have merits. In any case I think this will be a great improvement.

I agree with @TomD. All four sound fine for the most part.

I think you could easily merge the first three into one:

Well you got the right spot Chad - this is what are we talking about :slight_smile:

However you also pointed exactly the problems we noticed:

  • are you styling now the currently selected element or some other class in the document?
    • this is where webflow got in the wrong direction by allowing changing styles of other classes
  • if you suddenly switch to other class and change the style there - it can have effect on many more elements than your current selection.
  • also how do you name them? by function? by chosen style? you end up with massive amount of classes for everything

So that is why we are thinking more of the workflow:

  • you have a selection
  • so you need to style it and do that by making an unique class for that selection
  • it is better to be automatic to ensure it is unique, but you can give it your own name

Those are some good questions. People seem to be divided on this, but I tend to think if a style is only going to be used once or rarely, then it should be inline. Otherwise, it should be using a stylesheet.

I agree that it would be a nightmare. You are right on that. We have had issues with employees doing that as we’ve discussed elsewhere. They use poor naming and create very bloated stylesheets with no rhyme or reason.

I want to think about this. This is an interesting problem. In the meantime, if I’m understanding correctly, all classes and styles would be removed from the element and a new unique class would be created?

Yes, this is how I would expect it to work.

1 Like

I agree with Chad – i think at the end of we all want to be able to rename. So the first two (or maybe three?) easily merge into some form. However, as many of the comments suggest, all options are potentially important . My experience (limited in comparison to most of you probably) is that the real answer to the question varies based upon the project being worked. That makes it difficult to pull the best answer out of the hat.