Generic and exclusive class for all elements

When I add styles without defining a custom class, Bricks adds the styles to the id.

Is there a way to make all elements have a default class to prevent the styles from being added to the id?

Occasionally I’m working on unique elements that don’t require a custom class, but I don’t want the styles to be in the id.

GenerateBlocks does this, and I find it very useful.

It’s an interesting idea, why you don’t want to add it to the id?

Specificity wars. My guess would be it’s too specific. Styling by class is generally preferable to styling by ID for this reason.

1 Like

That’s right. When styles are defined in the id, there is no way to override them in any other way. Hierarchically, the id takes precedence over the classes.

You can override with !important, but it’s generally best to avoid throwing those around for much the same reason. It’s usually a sign of problems when you have to start doing that.

Alternatively, you can be even more specific in your selector like body div#foo.