Skip to main content

Creating A Divi 5 Global Design System With Design Variables

Learn how to build a complete set of Divi 5 Design Variables - colors, fonts, numbers, images, text, and links - that power a reusable design system.

Divi 5 - Creating A Divi 5 Global Design System With Design Variables

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

Divi 5 - Opening the Variable Manager
  1. Open any page or template in the Visual Builder.

  2. Click the Variable Manager iconin the Builder Bar on the left side of the screen.

  3. 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

Divi 5 - Create a design 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

Divi 5 - Base Color Variables

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: #2176ff

  • Secondary Color: #ff5700

  • Heading Text Color: #000000

  • Body Text Color: rgba(0,0,0,0.7)

  • Link Color: reference Primary Color

  • Black: #000000

  • White: #ffffff

  • Background – Light Gray: #f5f5f5

Relative text colors

Divi 5 - Setting Relative Text Color Variables

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

Divi 5 - Setting Relative Color Variables

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

Divi 5 - Setting Heading Font Size Variables

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: 12px

  • Fields 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.3em

  • Line Height – Body: 1.8em

  • Body 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: 10px

  • Spacing – Small: 20px

  • Spacing – Medium: 30px

  • Spacing – Regular: 60px

  • Spacing – Large: 100px

  • Spacing – 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: 1px

  • Border Width – Fields: 1px

  • Border Width – Buttons: 0px

  • Rounded Corners – Regular: 8px

  • Rounded Corners – Images: 8px

  • Rounded Corners – Fields: 8px

  • Rounded Corner – Small: 4px

  • Rounded Corner – Large: 16px

  • Rounded 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: 14px

  • Button Vertical Padding: 16px

  • Button 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: 1080px

  • Max Width – 900: 900px

  • Max Width – 700: 700px

  • Max 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.

Did this answer your question?