Closed 1aron closed 11 months ago
This base unit determines the spacing scale and ensures visual consistency across products.
Most spacing systems are built around a base unit of 4 or 8 pixels.
We have to define all spacing beforehand. For example, base unit 4:
export default { variables: { spacing: { '1x': 4, '2x': 8, '3x': 12, ..., '40x': 160 } } }
Apply the custom spacing variables:
<div class="m:1x">margin: 0.25rem</div>
Isn’t it a bit clumsy?
Introducing the new config.baseUnit:
config.baseUnit
export default { baseUnit: 4, // default }
Use the new Master CSS multiplier unit x:
x
This is a new feature built for spacing and dimensions in a design system.
Description
This base unit determines the spacing scale and ensures visual consistency across products.
Most spacing systems are built around a base unit of 4 or 8 pixels.
Current
We have to define all spacing beforehand. For example, base unit 4:
Apply the custom spacing variables:
Isn’t it a bit clumsy?
Expect
Introducing the new
config.baseUnit
:Use the new Master CSS multiplier unit
x
:This is a new feature built for spacing and dimensions in a design system.