Skip to content

Spacing

Elevate CSS features a meticulously crafted 4pt spacing system with three scales to address different design needs: detail, content, and space. This structure ensures consistency across components and layouts, supporting projects of all sizes.


Spacing Scales Overview

1. Detail Scale

The detail scale is for fine-grained adjustments in small components, such as buttons, cards, and inputs. It offers precise control over spacing from 0.25rem to 3.5rem.

TokenValueDescription
d10.25rem4pt
d20.5rem8pt
d30.75rem12pt
d41rem16pt
d51.25rem20pt
d61.5rem24pt
d71.75rem28pt
d82rem32pt
d92.25rem36pt
d102.5rem40pt
d112.75rem44pt
d123rem48pt
d133.25rem52pt
d143.5rem56pt

2. Content Scale

The content scale is optimized for spacing within layouts, such as column gaps or section margins, spanning 4rem to 20rem.

TokenValueDescription
c14rem64pt
c24.5rem72pt
c35rem80pt
c45.5rem88pt
c56rem96pt
c67rem112pt
c77.5rem120pt
c88rem128pt
c99rem144pt
c1010rem160pt
c1112rem192pt
c1216rem256pt
c1320rem320pt

3. Space Scale

The space scale addresses large-scale layouts, ideal for page sections, full-width elements, and major spacing needs. The values range from 24rem to 120rem.

TokenValueDescription
s124rem384pt
s228rem448pt
s332rem512pt
s436rem576pt
s540rem640pt
s648rem768pt
s756rem896pt
s860rem960pt
s964rem1024pt
s1072rem1152pt
s1180rem1280pt
s1290rem1440pt
s13120rem1920pt

Differences Between Scales

AspectDetail ScaleContent ScaleSpace Scale
GranularityFine-grained adjustmentsMedium-scale spacingLarge-scale layouts
Primary UseComponent-level stylingLayout spacing for sectionsMajor page structures
Value Range0.25rem to 3.5rem4rem to 20rem24rem to 120rem

Applying Spacing in Utility Strings

You can mix and match these scales in your designs:

<!-- Detail spacing for components -->
<div class="pd:d4 mg:d8">
<!-- Padding of 1rem and margin of 2rem -->
</div>
<!-- Content spacing for layouts -->
<div class="mg-t:c3 mg-b:c5">
<!-- Top margin of 5rem and bottom margin of 6rem -->
</div>
<!-- Space scale for sections -->
<section class="pd:s3 mg-b:s5">
<!-- Padding of 32rem and margin-bottom of 40rem -->
</section>