Maximum designers don’t measurement issues as soon as. A heading that appears balanced at 56px on desktop can really feel outsized on a telephone, so that you create a smaller cell price, then a pill price between the 2. Then you definately repeat that paintings for font sizes, segment padding, margins, gaps, border radius, widths, and different numeric values around the web site.
Fluid sizing with CSS clamp() solves the issue on the math degree. One price can scale easily between a minimal and most because the viewport adjustments. The problem is that writing just right clamp() expressions by means of hand takes time, and exterior turbines nonetheless go away you copying values into your design machine separately.
Divi 5’s Variable Generator gets rid of that friction. It creates whole sizing scales and provides them immediately in your Design Variables. You’ll generate fluid values for typography, spacing, gaps, radius, border width, width, and extra, then reuse the ones variables in numeric fields around the Visual Builder.
That is the numeric better half to a color-variable workflow. As a substitute of turning one emblem colour right into a complete palette, you flip a couple of base values right into a responsive sizing machine.
The place To To find The Numeric Variable Generator
The Variable Generator lives within the Variable Supervisor.
- Open any web page within the Visible Builder.
- Click on the Variable Supervisor icon within the left sidebar.
- Open or hover over the Numbers team.
- Click on the generator icon for the Numbers team to open the Variable Generator.
The generator opens as a full-screen modal. The configuration panel sits at the left, and the are living preview sits at the proper. As you regulate the settings, the generated scale updates within the preview.
One Generator, More than one Numeric Techniques
A very powerful surroundings is the Variable Kind dropdown. It determines the kind of numeric variables you’re producing and adjustments the controls proven beneath it.
The numeric variable varieties come with:
- Font Measurement: A sort scale for headings, frame textual content, buttons, and different textual content fields.
- Spacing: A spacing scale for margin and padding.
- Hole: A scale for horizontal and vertical gaps in Flexbox and Grid layouts.
- Radius: A scale for border radius values.
- Border Width: A scale for border thickness.
- Width: A scale for component widths, min-widths, and max-widths.
- Clamp (Generic): A versatile clamp-based price for numeric use circumstances.
- Measurement (Generic): A generic mounted sizing price to be used circumstances that shouldn’t have a complete scale.

Every numeric kind follows the similar elementary workflow.
- Scale Kind: Make a selection whether or not the generator creates a fluid scale with clamp(), a set responsive scale with values in line with breakpoint, or a set unmarried scale with one price throughout display screen sizes.
- Variable Prefix: Set the naming prefix for the generated variables.
- Suffix Taste: Make a selection how generated steps are named, equivalent to T-shirt sizes or numeric steps.
- Base Measurement: Make a selection the anchor step for the dimensions.
- Minimal And Most Values: Outline the smallest and biggest values the dimensions will have to use.
- Ratios: Regulate how aggressively smaller and bigger steps transfer clear of the bottom measurement.
- Generated CSS Devices: Make a selection the output unit, equivalent to px or rem.
- 1rem Equals: Outline the rem-to-pixel conversion used within the preview and generated values.
The preview displays the generated values right away. You’ll assessment the dimensions visually, investigate cross-check the generated CSS, customise particular person values, after which upload the variables in your web site.
Font Measurement: Construct A Fluid Kind Scale
Font Measurement is typically the most efficient position to begin as a result of typography is without doubt one of the maximum visual portions of a responsive design machine.
With Scale Kind set to Fluid Scale (CSS Clamp), Divi generates font measurement variables that scale between a minimal and most price because the viewport adjustments.
You outline the telephone facet of the variability with Base Min. Font Measurement and a minimal ratio. Then you definately outline the desktop facet with Base Max. Font Measurement and a most ratio. The viewport settings decide the variability the place the price grows.
The ratio settings are what make the sort scale really feel intentional. A tighter ratio on small displays helps to keep headings from turning into too huge. A more potent ratio on desktop shall we headings scale up with extra affect.
The preview presentations every generated step, equivalent to text-xs, text-s, text-m, text-l, and bigger heading values. You’ll upload or take away smaller and bigger steps ahead of uploading the dimensions.
The default settings are a just right place to begin if you don’t want to track the maths manually. After uploading the variables, you’ll use them in font measurement fields throughout Textual content modules, Heading modules, Button modules, Blurbs, and different textual content choice teams.
A fluid kind variable covers the entire responsive vary in a single price. That implies you don’t want to manually set separate telephone, pill, and desktop font sizes for each textual content component until a particular design requires an override.
Fluid, Fastened Responsive, And Fastened Unmarried
The Font Measurement generator too can create non-fluid methods.
- Fluid Scale: Outputs clamp() values that scale easily between a minimal and most.
- Fastened Responsive: Outputs separate values for breakpoints equivalent to telephone, pill, and desktop.
- Fastened Unmarried: Outputs one static price throughout display screen sizes.
Fluid Scale is typically essentially the most helpful choice for a contemporary responsive sizing machine. Fastened Responsive works when you need specific breakpoint keep watch over. Fastened Unmarried works when a price will have to no longer trade throughout display screen sizes.
Spacing: Create Constant Margins And Padding
Transfer Variable Kind to Spacing to generate a scale for margin and padding values.
The controls are very similar to Font Measurement. You select minimal and most base values, set ratios, select naming choices, and preview the generated scale. The defaults are tuned for structure spacing somewhat than typography.
A Generate Area-0 toggle can upload a nil price to the dimensions. This turns out to be useful when you need a proper variable for disposing of margin or padding with out typing a handbook price.
The preview presentations every spacing step as a visible block, making it more straightforward to pass judgement on the rhythm of the dimensions.
After uploading, use spacing variables in margin and padding fields throughout sections, rows, columns, and modules.
For instance, you may use:
- space-s for tight interior padding
- space-m for same old module spacing
- space-l for segment padding
- space-xl for greater hero or touchdown web page spacing
A shared spacing scale is helping your layouts really feel attached. As a substitute of opting for random padding values on every web page, you reuse a small set of responsive choices.
Hole: Regulate Area Between Flex And Grid Pieces
The Hole kind creates variables for horizontal and vertical hole fields.
Gaps keep watch over the distance between Flexbox and Grid youngsters. They’re other from padding as a result of they impact the connection between pieces somewhat than the distance inside of an merchandise.
The Hole generator makes use of the similar fluid good judgment and shows a preview with paired pieces so you’ll see how every price impacts the distance between components.
Use those variables in Divi 5’s Format choice team, the place horizontal and vertical hole settings are to be had for Flexbox and CSS Grid layouts.
Fluid hole variables are particularly helpful in responsive card grids, characteristic rows, product layouts, testimonial sections, and navigation layouts. Because the viewport narrows, the space can scale with the remainder of the design as an alternative of staying locked to at least one mounted pixel price.
Radius: Standardize Nook Rounding
The Radius kind creates a scale of border radius values.
Use it to standardize the nook taste of buttons, playing cards, pictures, paperwork, boxes, and different framed components. The Radius generator contains not obligatory settings equivalent to:
- radius-none: A 0-radius price for sq. corners.
- radius-full: An absolutely rounded price for capsules, circles, and strongly rounded shapes.
The preview renders rounded packing containers so you’ll see the curvature of every step.
Follow those variables within the Border choice team’s border radius fields.
A shared radius scale is helping your design really feel intentional. Buttons, playing cards, paperwork, pictures, and boxes can all pull from the similar set of nook values as an alternative of every the use of a relatively other radius.
Border Width: Create Constant Strokes
The Border Width kind generates a scale for border thickness.
Those values are smaller than spacing or width values by means of nature, however they nonetheless take pleasure in standardization. A constant border width scale helps to keep playing cards, inputs, buttons, dividers, and framed components visually aligned.
The generator too can create a border-none token for disposing of borders via a variable.
Use those variables within the Border choice team’s border width fields.
They are able to even be helpful in SVG workflows when a numeric stroke price is to be had. A shared stroke scale is helping line weights really feel constant throughout icons, illustrations, and interface components.
Width: Construct Responsive Width Tokens
The Width kind creates variables for component width values.
Those values are helpful for boxes, playing cards, media blocks, buttons, paperwork, pictures, and structure components that want a managed width or max-width.
The Width generator features a Generate Width-Complete toggle for a full-width token. The preview presentations every generated width as a horizontal bar, so the dimensions is straightforward to match visually.
Use width variables within the Sizing choice team on sections, rows, columns, and modules.
A fluid width variable can let a component develop with the viewport as much as a smart ceiling. That is frequently cleaner than surroundings mounted widths one by one for every breakpoint.
Clamp And Measurement: Generic Numeric Variables
The remaining two numeric varieties are for values that don’t have compatibility well into the principle token households.
Clamp (Generic)
Clamp (Generic) creates a fluid clamp() price for a customized use case.
Use it when you want one responsive price as an alternative of a complete scale. You put the variable identify, minimal price, most price, and viewport vary. Divi generates a variable that scales between the ones values.
This turns out to be useful for one-off fluid values equivalent to a customized icon measurement, ornamental offset, media top, particular container width, or different numeric surroundings that are meant to scale easily.
Measurement (Generic)
Measurement (Generic) creates a set numeric variable to be used circumstances outdoor the principle sizing methods.
Use it when you want a reusable quantity that are meant to no longer change into a part of a bigger scale. Relying at the decided on scale kind, you’ll use it for static or responsive values.
Generic variables are absolute best used sparingly. The primary token households will have to quilt maximum of your design machine. Use generic values when a design wishes one thing particular.
Customise And Investigate cross-check The Generated Values
The preview house contains equipment for reviewing and adjusting the generated variables ahead of you upload them in your web site.
Customise Values
Click on Customise Values to edit particular person generated values. This turns out to be useful when the entire scale is correct, however one step wishes a small adjustment.
Use this in moderation. Too many handbook adjustments can weaken the consistency of the dimensions. It’s best for small corrections, no longer for rebuilding each price by means of hand.
Display CSS
Click on Display CSS to investigate cross-check the generated CSS for every variable. This permits you to assessment the clamp() or calc() output ahead of uploading the variables.

That is useful if you wish to perceive the maths at the back of the dimensions, record your machine, or verify that the generated values fit your supposed vary.
Upload The Variables To Your Web page
When the dimensions seems proper, click on Upload Variables To My Web page.
Divi provides the generated values to the Numbers team within the Variable Supervisor as particular person numeric Design Variables. The names use the prefix and suffix settings you selected within the generator.

Evaluation the brand new variables within the Numbers team, then click on Save Variables to dedicate the adjustments.
After that, the variables are to be had in supported numeric fields all over Divi. Use them for font sizes, margin, padding, hole, radius, border width, width, and different numeric values.
Use Variables With Presets For A Complete Gadget
The Variable Generator creates the values. Presets make a decision the place the ones values get used. A robust Divi 5 workflow seems like this:
- Generate your numeric variables with the Variable Generator.
- Follow the ones variables to module settings equivalent to typography, spacing, borders, and sizing.
- Save the ones settings as Possibility Workforce Presets or Part Presets.
- Use the ones presets throughout your web site so new modules inherit the similar sizing machine.
For instance, you may create a Button Part Preset that makes use of your generated font measurement, padding, radius, and border width variables. You may additionally create a Card Border Possibility Workforce Preset that makes use of your shared radius and border width variables.
Variables cling the reusable numbers. Presets observe the ones numbers to actual design patterns.
Why This Beats Handbook Responsive Sizing
Handbook responsive sizing works, but it surely does no longer scale smartly. You put desktop, pill, and call values on one module, then repeat the similar choices around the web site.
The Variable Generator in Divi 5 will give you a extra systematic workflow. You outline the principles as soon as: base values, ratios, viewport vary, gadgets, and naming. Divi creates the variables and shops them the place you’ll reuse them.
That will give you 3 benefits:
- Consistency: The similar spacing, kind, radius, and width values seem around the web site.
- Responsiveness: Fluid values can scale easily with out separate breakpoint edits.
- Maintainability: Updating a variable can replace each surroundings that references it.
Pair those numeric variables with generated colour variables, and also you get the root of a whole Divi 5 design machine: colours and numbers outlined as soon as, reused via presets, and altered from a central position.
The submit Creating A Fluid Responsive Sizing System With Divi 5’s Variable Generator seemed first on Elegant Themes Blog.



0 Comments