# Using WeWeb Classes

**URL:** <https://community.weweb.io/t/using-weweb-classes/3882>\
**Category:** How do I?\
**Created:** [August 14, 2023, 5:16pm UTC](https://community.weweb.io/t/using-weweb-classes/3882 "2023-08-14T17:16:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![chadsmithclt](https://avatars.discourse-cdn.com/v4/letter/c/8797f3/32.png) [@chadsmithclt](https://community.weweb.io/u/chadsmithclt)\
**Post date:** [August 14, 2023, 5:16pm UTC](https://community.weweb.io/t/using-weweb-classes/3882/1 "2023-08-14T17:16:12Z")

</div>

Hi Community,

Has anyone figured out a nice way to use States and Classes together?

My specific challenge is having a Primary, Secondary and Tertiary button. I want for each of the button styles to have their own unique Hover and Focus states, but it seems like the states are being applied globally.

Thank you in advance,  
Chad

---

<div class="post-metadata">

**Author:** ![chadsmithclt](https://avatars.discourse-cdn.com/v4/letter/c/8797f3/32.png) [@chadsmithclt](https://community.weweb.io/u/chadsmithclt)\
**Post date:** [August 15, 2023, 5:09pm UTC](https://community.weweb.io/t/using-weweb-classes/3882/2 "2023-08-15T17:09:54Z")

</div>

@Quentin your live stream demo was really helpful, curious if you have any insight here as well?

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [August 16, 2023, 8:37pm UTC](https://community.weweb.io/t/using-weweb-classes/3882/3 "2023-08-16T20:37:12Z")

</div>

Hi @chadsmithclt 👋

Mmm I’ve been thinking a lot about it because I’d like to record a video where we put together a complete style guide page similar to what many Webflow templates have.

Buttons are what I’m struggling with most because you can have buttons with icons, without icons, with icons on the left or on the right, etc.

The best I’ve come up with so far is what I show in [this video](https://youtu.be/rhFVpfGTU78?t=294).

Instead of having a `button` class and `primary`, `secondary` subclasses, I have:

- 2 classes on each button (the `btn` class and a `btn-primary` class for example), and
- I have state subclasses on related to my `btn-whatever` subclass

What do you think?

Would that approach play well with your use case?

Don’t hesitate to let us know if not! I know the product team is still very eager to get feedback to improve the class system in WeWeb.

---

<div class="post-metadata">

**Author:** ![chadsmithclt](https://avatars.discourse-cdn.com/v4/letter/c/8797f3/32.png) [@chadsmithclt](https://community.weweb.io/u/chadsmithclt)\
**Post date:** [August 18, 2023, 3:33pm UTC](https://community.weweb.io/t/using-weweb-classes/3882/4 "2023-08-18T15:33:08Z")

</div>

Hey Joyce,

I like that idea a lot, thanks for sharing! I think that will work for us.

Folders may be a nice addition. For example we have a Primary, Secondary, Tertiary and Link buttons. Each of these buttons have S, M, L and XL which results in about 16 classes just for buttons.

The number of permutations is growing more rapidly in other areas such as Table or Data Grid rows.

Also would be amazing if Classes were available by default across the entire Workspace! 😍

If I understand you correctly regarding Webflow, it would definitely be nice to define project level constraints or classes for page level styling.

For your example about icons in the buttons, I would love to handle icon classes separately. How this might work is creating various classes for my icons that I could then reference within my buttons depending on the state.

---

<div class="post-metadata">

**Author:** ![chadsmithclt](https://avatars.discourse-cdn.com/v4/letter/c/8797f3/32.png) [@chadsmithclt](https://community.weweb.io/u/chadsmithclt)\
**Post date:** [August 18, 2023, 4:15pm UTC](https://community.weweb.io/t/using-weweb-classes/3882/6 "2023-08-18T16:15:43Z")

</div>

Duplicate class including subclasses 🙂

---

<div class="post-metadata">

**Author:** ![Zacharyb](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/zacharyb/32/3567_2.png) [@Zacharyb](https://community.weweb.io/u/Zacharyb)\
**Post date:** [August 19, 2023, 11:24am UTC](https://community.weweb.io/t/using-weweb-classes/3882/7 "2023-08-19T11:24:30Z")

</div>

IMO weweb should allow multiple classes collection like for primitive ones ( with all the variants classes ) and a cleaner one with a more component vibe that will reduce the number of classes to apply each time

Once a component has his primitive it can then be sort of component ready, changing the primitives would impact the main classes collection  
Basically like figma variable  
Don’t know if it’s the right path but it’s atm the way I do it  
And I use a « . » for the main classes group in order to have them on top

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [August 22, 2023, 9:21am UTC](https://community.weweb.io/t/using-weweb-classes/3882/8 "2023-08-22T09:21:11Z")

</div>

Great suggestions! Passing them allow to the product team for exploration 🙂
