This is Part 3 of the Divi 5 Mastery Course. In Part 2, you learned where everything lives in the interface. Now you will build the foundation of your design system using Design Variables: named, reusable values that modules, presets, and templates reference instead of hardcoded numbers and colors.
By the end, you will have a complete variable set for typography, colors, spacing, borders, layout, buttons, form fields, and reusable content for a sample Coworking Space website.
Why Design Variables come first
A Design Variable is a named value you reference throughout your site. Instead of typing #2176ff into every module that uses your brand blue, you create a color variable called Primary Color with that value, then reference Primary Color wherever the blue appears. The hex code lives in one place, and every reference points back to it.
Divi 5 supports six variable types: colors, fonts, numbers, images, text, and links. So your system can cover more than styling - it can also store logos, business details, CTA text, and external URLs.
Build variables first because everything else depends on them. In Part 4 you will build Option Group Presets and Element Presets that reference these variables; if the variables do not exist yet, the presets cannot bind to them. Think of variables as the atoms, presets as the molecules, and pages as the organisms. The order matters.
Opening the Variable Manager
Open any page or template in the Visual Builder.
Click the Variable Manager icon
in the Builder Bar on the left side of the screen.The Variable Manager opens, where you create, organize, and manage sitewide variables.
At the top of the manager, use the dropdown to filter by type: Colors, Fonts, Gradients, Images, Links, Numbers, and Text.
Create a desing variable
To create a variable, click the + button in the matching type section, give it a descriptive name, set its value, and save.
π‘Pro tip: The mechanics are simple - the strategic decisions matter. What you name each variable, what value it stores, and how many you create is what makes the system usable later.
A simple naming rule
Use names that describe each variable's role. For broad brand values, names like Primary Color, Secondary Color, and Body Text Color work well because they apply in many contexts.
For values with a specific job, use functional names such as Border β Fields Dark, Background Overlay β Dark, or Rounded Corners β Buttons. This keeps the system easy to scan when you start building presets in Part 4.
Color variables
Colors define brand identity, establish hierarchy, and create contrast between sections. This palette starts from a few base colors, then extends them with Divi 5's Relative Colors system to create transparent variants, overlay tones, and contextual shades.
Base colors
Primary, Secondary, Heading Text, Body Text, and Link colors are already generated for you - update them to match your design. Then add the utility colors. Black and White are rarely used directly on modules; they act as base values for the relative colors below.
Primary Color:
#2176ffSecondary Color:
#ff5700Heading Text Color:
#000000Body Text Color:
rgba(0,0,0,0.7)Link Color: reference Primary Color
Black:
#000000White:
#ffffffBackground β Light Gray:
#f5f5f5
Relative text colors
With the base colors in place, build derived text colors using variable referencing and relative color filters. These create dark-on-light and light-on-dark counterparts, so a section can switch color schemes just by choosing a different preset in Part 4.
Heading Text β Light: reference the White variable directly
Body Text β Light: relative color from White at 90% opacity
Text β Dark Transparent: relative color from Body Text Color at 40% opacity
Text β Light Transparent: relative color from Body Text β Light at 60% opacity
Relative background, overlay, and utility colors
These round out the palette. Some are role-based (Border β Dark, Drop Shadow); others are flexible utilities (Black β Transparent, White β Transparent).
Background Overlay β Dark: relative color from Black at 86% opacity
Background Overlay β Light: relative color from White at 86% opacity
Black β Transparent: relative color from Black at 10% opacity
White β Transparent: relative color from White at 20% opacity
Border β Dark: relative color from Black at 12% opacity
Border β Light: relative color from White at 30% opacity
Border β Fields Dark: relative color from Black at 30% opacity
Border β Fields Light: relative color from White at 50% opacity
Drop Shadow: relative color from Black at 15% opacity
Font variables
Create two font variables: Heading and Body. Divi makes it easy to select Google Fonts and also supports uploaded custom fonts. This build uses Inter for both.
Heading: Inter
Body: Inter
Using a single typeface for both is not required, but it makes a first design system easier to manage - here the difference between headings and body text comes from size, weight, and line height rather than separate families. A single font family can also reduce font-loading complexity, though two well-chosen families will not hurt performance on their own.
Number variables: typography
Number variables hold values in pixels, rems, ems, or CSS functions. Build them in logical groups, starting with typography. For more on units and math functions, see Advanced Units, CSS Functions, and Variables For Divi 5.
Heading sizes
Each heading level gets a fluid size using a CSS clamp() function, which sets a minimum size, a preferred scaling rate, and a maximum size. Headings scale smoothly between mobile and desktop without separate values per breakpoint. To add one, create a new Number Variable, copy the full clamp() value, and paste it in.
H1:
clamp(1.75rem, 4.4975vw + 0.6254rem, 3.75rem)H2:
clamp(1.5rem, 2.2596vw + 0.9534rem, 2.5rem)H3:
clamp(1.25rem, 1.4122vw + 0.9085rem, 1.875rem)H4:
clamp(1.0625rem, 0.9831vw + 0.8155rem, 1.5rem)H5:
clamp(0.9375rem, 0.7007vw + 0.7588rem, 1.25rem)H6:
clamp(0.875rem, 0.2824vw + 0.8067rem, 1rem)H1 Big:
clamp(3rem, 7.3219vw + 1.1924rem, 6.25rem)Eyebrow Subheading:
clamp(0.8125rem, 0.2824vw + 0.7442rem, 0.9375rem)
Body text sizes
Body is the standard paragraph size. Body Small covers secondary text like footers and captions. Body XS is a fixed size for tags and fine print. Fields Text matches Body Small today but stays separate so form field text can be adjusted independently later.
Body:
clamp(0.875rem, 0.2824vw + 0.8067rem, 1rem)Body Small:
clamp(0.8125rem, 0.2824vw + 0.7442rem, 0.9375rem)Body XS:
12pxFields Text:
clamp(0.8125rem, 0.2824vw + 0.7442rem, 0.9375rem)
Line heights
Headings use tight leading because large text already provides structure. Body text uses more generous leading for comfortable reading. Small text sits in between.
Line Height β Headings:
1.3emLine Height β Body:
1.8emBody Small Line Height:
1.55em
Spacing
Spacing variables create a consistent rhythm between elements. Rather than eyeballing padding and margins, reference a spacing variable that enforces the same distance everywhere. Spacing β Fluid scales with the viewport, and Grid Gap β Fluid is similar but capped at 60px for CSS Grid layouts.
Spacing β XSmall:
10pxSpacing β Small:
20pxSpacing β Medium:
30pxSpacing β Regular:
60pxSpacing β Large:
100pxSpacing β Fluid:
clamp(24px, 6vw, 90px)Grid Gap β Fluid:
min(4vw, 60px)
Borders and corners
Structural and field borders share the same value but stay separate so they can evolve independently. Button borders are 0px because this design uses filled backgrounds, not outlines.
The three 8px radii match now but are separated because images, containers, and fields are different concerns - later you might want rounder images but sharper cards. Rounded Corners β Buttons uses 500px for a pill shape.
Border Width:
1pxBorder Width β Fields:
1pxBorder Width β Buttons:
0pxRounded Corners β Regular:
8pxRounded Corners β Images:
8pxRounded Corners β Fields:
8pxRounded Corner β Small:
4pxRounded Corner β Large:
16pxRounded Corners β Buttons:
500px
Buttons
A 2:1 horizontal-to-vertical padding ratio creates a wide, click-friendly button. With Rounded Corners β Buttons and Border Width β Buttons, these define every button's physical dimensions.
Button Font Size:
14pxButton Vertical Padding:
16pxButton Horizontal Padding:
32px
Layout dimensions
Layout variables constrain content to readable line lengths. Row Max Width is the default for standard rows; the narrower options suit blog posts, forms, and compact centered blocks.
Row Max Width:
1080pxMax Width β 900:
900pxMax Width β 700:
700pxMax Width β 510:
510px
Image variables
Image variables store visual assets reused across the site. Every header, footer, and template that displays the logo can reference one of these; replace a logo later, and the change applies everywhere.
Logo Dark: the dark logo for light backgrounds
Logo Light: the light or white logo for dark backgrounds
Note: If you do not have a logo yet, use a placeholder generator like Logoipsum for now.
Text variables
Text variables store words and phrases that repeat across pages and templates. Business details are a strong use case because they appear in headers, footers, contact sections, and templates.
Company Name: Elegant Themes
Address: 1234 Divi St. #1000, San Francisco, CA 94220
Phone Number: (255) 352-6258
Email: the business email address
Opening Hours: Mon-Fri: 10 amβ5 pm / Sat-Sun: Closed
CTA anchor text is also worth planning ahead, so wording stays consistent.
Book Tour: Book Tour
View Plans: View Plans
Learn More: Learn More
Read More: Read More
Link variables
Link variables store URLs referenced across multiple modules. For links inside your WordPress install, dynamic content may be the better choice; for external destinations like social profiles or scheduling tools, Link Variables are convenient. When an external URL changes, update the variable once, and every module that references it follows.
Elegant Themes:
https://www.elegantthemes.com/YouTube:
https://www.youtube.com/
Reviewing the complete system
The finished system contains 21 color variables (8 base, 13 relative), 2 font variables, 38 number variables, 2 image variables, 9 text variables, and 2 link variables - 74 active Design Variables before a single page module is added.
The payoff is consistency and changeability. Apply Spacing β Small to a card's padding and a list's gap, and the distances match because the variable enforces them. If a client decides the brand blue needs to shift, change Primary Color once and the update flows through every preset that references it.
Read the full tutorial
Read the complete step-by-step guide on the Elegant Themes blog: Part 3: Creating A Divi 5 Global Design System With Design Variables.
Previous Course | Next Course |







