Join the Webstudio community

Updated 10 months ago

Support for combinator styling as well as attribute based / ClassName styling

At a glance
Using tokens is super powerful for styling but it comes with its limitations as the team might already know.

There are scenarios where we'd want to apply specific classes for things like .is-active or .is-current and have specific styles associated with them. Even things like styling based on attributes are currently not possible through the visual editor. The way it has to be done is through an HTML embed block. The downside of this is we lose the powerful visual building capabilities that come with Webstudio.

Secondly, ability to target using combinator styling is not possible. It is not possible currently to do things like targeting child element in case like .parent:hover .child. There are also styling for descendant, sibling, etc. isn't possible currently through the visual editor.

It would be great if some of these would be possible to do through the visual editor.
O
M
6 comments
Combo classes are evil because of source order specificity issues.
We are going to solve all these use cases by using css variables much more elegantly.
Meaning you set a state on the container and set css variables on that state.

After that you can use these variables on the same element or any of the children. That's how css variables work in general.
Our goal is to prevent relying on cascade and combo classes.
You can still do all that in custom code, but we won't be encouraging you doing that in the builder UI.
That's fair. CSS variables will make some of these use cases easier. And not everything needs to be doable with the builder UI.
I think all use cases will be covered with variables
Add a reply
Sign up and join the conversation on Discord