Variables
Variables enable you to create a cohesive design system by defining reusable values for colors, sizes, and other properties that can be referenced throughout your styles.
Designer tools require the MCP Bridge App to be open in the Webflow Designer. Ensure it’s connected before using these tools.
When to use
Use Variables tools to:
- Build design systems: Define brand colors, spacing scales, and typography
- Maintain consistency: Use variables instead of hard-coded values
- Theme support: Create modes for light/dark themes or brand variations
- Update site-wide: Change one variable to update all references
Tool details
Tool name: variable_tool
Available actions
Create variable collection
Establish a new collection to group related variables.
Action: create_variable_collection
Parameters:
Example usage:
Get variable collections
Retrieve all collections or filter by specific IDs.
Action: get_variable_collections
Parameters:
Example usage:
Create variable mode
Add a mode to a collection for variations (light/dark theme, brand variations).
Action: create_variable_mode
Parameters:
Example usage:
Get variables
Fetch variables from a collection.
Action: get_variables
Parameters:
Example usage:
Create color variable
Define a color variable.
Action: create_color_variable
Parameters:
Example usage:
Create size variable
Define a size variable with units.
Action: create_size_variable
Parameters:
Example usage:
Create number variable
Define a pure numeric variable (no units).
Action: create_number_variable
Example usage:
Create percentage variable
Define a percentage variable (0-100).
Action: create_percentage_variable
Example usage:
Create font family variable
Define a font family variable.
Action: create_font_family_variable
Example usage:
Update variables
All variable types support update actions with the same parameters as creation, plus optional mode_id for mode-specific values.
Variable modes
Modes enable variations within a collection:
Common use cases:
- Light/Dark themes
- Brand variations (primary/secondary brand)
- Seasonal themes
- Localized designs
Example:
Best practices
Organize by purpose
Create collections by purpose:
- Colors
- Spacing/Sizing
- Typography
- Animation
Clear organization makes variables easy to find.
Use semantic naming
Name variables by purpose, not appearance:
- ✅
color-primary,color-text,color-background - ❌
color-blue,color-dark-gray,color-light
Purpose-based names survive design changes.
Reference variables in styles
Link variables to style properties instead of hard-coding values. This creates a true design system.
Document your system
Keep a reference of your variables:
- What each variable is for
- When to use each one
- Relationships between variables
This helps maintain consistency.
Limitations
- Type matching: Can only link compatible variable types to properties
- Designer required: Must have Bridge App connection