Styles, variables, & naming

Choose what to reuse and name it so your team and agents know how to use it.

Styles, variables, & naming

Choose what to reuse and name it so your team and agents know how to use it.

Variables provide reusable values. Styles put those values to work in your design system, alongside settings for layout, typography, and more.

As you build, you’ll decide whether to reuse existing styles, adapt them, or create something new. Those choices affect how easily your team can make changes later.

Choose which styles to reuse

Tag styles

Use a tag style when elements of the same type should share a default. Add a class for more specific styling.

For example: Set the font and line height for paragraphs across the site.

Classes

Use a class when several elements should share a set of styles.

For example: Buttons might share a background, typography, padding, and border radius. Apply an existing button class or create one rather than recreating those styles.

Combo classes

Use a combo class for a variation of an existing class.

For example: Give a registration button an outlined treatment by changing its background and border color while keeping the base class’s typography, padding, and border radius.

Utility (global) classes

A utility class handles a narrow styling need across different elements.

For example: Reuse a text-alignment utility class to center headings and paragraphs instead of setting alignment separately in multiple classes.

These approaches can work together. A button can use a combo class for its background and inherit its border radius from a base class. That radius can get its value from a variable.

A registration button uses the button base class and is-secondary combo class. Annotations show that its transparent background is set on the combo class, while its border radius is inherited from the base class.

Styles and variables

Classes let you share a set of styles. But what if different classes need to share just one value?

A section heading and a button need different styling, but both can use the same spacing variable. The heading’s class uses space-s for the gap between its text elements. The button’s class uses it for padding.

The featured-webinars-header class uses space-s for its row gap, while the button class uses the same variable for padding.
Two classes use the same space-s variable: one for row gap (top) and one for padding (bottom).

Each class defines how that spacing is applied. Changing the heading’s alignment won’t affect the button. Changing space-s affects both wherever they reference it.

Decide what should change together

But should a button’s padding and a section heading’s text gap share the same spacing variable? Think about what you’d want to happen if your team changed that value later.

  • Both follow your spacing scale. To make small spaces larger across the site, update space-s. Both the heading’s text gap and the button’s padding increase.
  • Only the heading needs more space. If the button’s padding still looks right, keep space-s unchanged and use a larger spacing variable for the heading’s gap.

Different purposes can still share a spacing value intentionally. But matching values alone aren’t a reason to connect them.

An image’s width and opacity might both be 75%. If they shared one variable, changing it to 100% would make the image both wider and fully opaque. Those are separate design choices, so their values should stay independent.

Key takeaway
Before connecting a style property to a variable, ask: If this value changes, should the other places using it change too?

Naming classes

Choose names that help your team tell where a class belongs and when to reuse it. For example, related names such as card-heading and card-image identify parts of a card, while a prefix in u-text-center identifies a global utility.

The exact punctuation or prefix matters less than agreeing on what it means and using it consistently. Document your convention and note any exceptions so the next person doesn’t have to guess.

Tip. Explore the naming approaches in Mast, Lumos, or Client-First. These frameworks include broader building strategies too, so consider how an approach fits the way your team builds and maintains sites.

Up next

Continue to the next lesson to build a variable system with primitives, semantics, and theme modes.

1

Getting started

Coming soon

1

Background & preview
3:00
Background & preview
Coming soon

1

Intro to design systems in Webflow
8:40
Intro to design systems in Webflow
Coming soon

1

How the parts work together
3:30
How the parts work together
Coming soon

2

Styles & variables

Coming soon

2

Intro to variables
5:48
Intro to variables
Coming soon

2

Styles, variables, & naming
3:00
Styles, variables, & naming
Coming soon

2

Variables as a system
8:33
Variables as a system
Coming soon

2

Build a flexible variable system
2:30
Build a flexible variable system
Coming soon

3

Components

Coming soon

3

Intro to components
5:03
Intro to components
Coming soon

3

Build flexible components
3:00
Build flexible components
Coming soon

3

Properties, variants, & slots
4:28
Properties, variants, & slots
Coming soon

3

Components for teams & AI agents
3:00
Components for teams & AI agents
Coming soon

4

Pages & CMS content

Coming soon

4

Page templates
3:00
Page templates
Coming soon

4

Create a static page template
3:08
Create a static page template
Coming soon

4

Add components to CMS rich text
2:25
Add components to CMS rich text
Coming soon

4

Components in CMS rich text
2:30
Components in CMS rich text
Coming soon

5

Share & maintain your system

Coming soon

5

Shared Libraries
8:59
Shared Libraries
Coming soon

5

Bring in an existing site
4:00
Bring in an existing site
Coming soon

5

Use your system with AI
3:00
Use your system with AI
Coming soon

5

Best practices & resources
2:00
Best practices & resources
Coming soon

Course progress

0%

Assessment

Up next

Variables as a system

Build a variable system with primitive and semantic variables, theme modes, and clear guidance for AI agents.
Continue to next lesson
→
Complete course
✓