ArcaneJaspr Codex
Documentation
Spacing
Reference for padding, margin, and gap enums
Live Demo
Gap sizes
Gap.xs
Gap.sm
Gap.md
Gap.lg
Gap.xl
Padding presets
sm
md
lg
xl

Spacing#

These enums provide consistent spacing throughout your application.

Spacing#

Base spacing scale used by other spacing enums.

ValueCSS OutputUse Case
none0No spacing
xs4pxTight spacing
sm8pxSmall spacing
md16pxDefault spacing
lg24pxLarge spacing
xl32pxExtra large
xxl48pxSection spacing
xxxl64pxLarge sections
huge96pxHero sections
massive128pxFull sections

Properties#

Spacing.md.css    // "16px"
Spacing.md.value  // 16

PaddingPreset#

Preset padding configurations.

Uniform Padding#

ValueCSS OutputDescription
none0No padding
xs4pxExtra small
sm8pxSmall
md16pxMedium
lg24pxLarge
xl32pxExtra large
xxl48pxDouble extra large
xxxl64pxTriple extra large

Compound Padding (vertical horizontal)#

ValueCSS OutputDescription
xsMd4px 16pxTight vertical, medium horizontal
smMd8px 16pxSmall vertical, medium horizontal
mdLg16px 24pxMedium vertical, large horizontal
lgXl 24px 32px Large vertical, extra large horizontal
xsSm4px 8pxTight compact
smLg8px 24pxSmall vertical, large horizontal
mdXl 16px 32px Medium vertical, extra large horizontal

Button Padding#

ValueCSS OutputDescription
buttonSm6px 12pxSmall button
buttonMd10px 20pxMedium button
buttonLg14px 28pxLarge button

Semantic Padding#

ValueCSS OutputDescription
card20pxCard padding
section48pxSection padding
sectionY80px 0Vertical section
heroY120px 0Hero section vertical
hugeY96px 0Huge vertical

Directional Padding#

ValueDescription
horizontalSm0 8px
horizontalMd0 16px
horizontalLg0 24px
horizontalXl0 32px
verticalMd16px 0
verticalLg24px 0
topSm8px 0 0 0
topMd16px 0 0 0
topLg24px 0 0 0
bottomMd0 0 16px 0

Compact Element Padding#

ValueCSS OutputDescription
badge2px 8pxBadge/tag styling
inlineCode2px 6pxInline code snippets
chip4px 12pxChip/pill elements

Usage#

ArcaneDiv(
  styles: const ArcaneStyleData(
    padding: PaddingPreset.lg,
  ),
  children: [...],
)

// Button padding
ArcaneButton(
  styles: const ArcaneStyleData(
    padding: PaddingPreset.buttonMd,
  ),
  label: 'Click Me',
)

MarginPreset#

Preset margin configurations.

Uniform Margin#

ValueCSS OutputDescription
none0No margin
xs4pxExtra small
sm8pxSmall
md16pxMedium
lg24pxLarge
xl32pxExtra large

Auto Margins#

ValueCSS OutputDescription
autoX0 autoHorizontal centering
autoYauto 0Vertical centering
autoautoAll auto

Top Margins#

ValueCSS OutputDescription
topXs4px 0 0 0Extra small top
topSm8px 0 0 0Small top
topMd16px 0 0 0Medium top
topLg24px 0 0 0Large top
topXl32px 0 0 0Extra large top
topXxl48px 0 0 0Double extra large top

Bottom Margins#

ValueCSS OutputDescription
bottomXs0 0 4px 0Extra small bottom
bottomSm0 0 8px 0Small bottom
bottomMd0 0 16px 0Medium bottom
bottomLg0 0 24px 0Large bottom
bottomXl0 0 32px 0Extra large bottom
bottomXxl0 0 48px 0Double extra large bottom
bottomXxxl0 0 64px 0Triple extra large bottom

Axis Margins#

ValueCSS OutputDescription
verticalSm8px 0Small vertical
verticalMd16px 0Medium vertical
verticalLg24px 0Large vertical
verticalXl32px 0Extra large vertical
horizontalSm0 8pxSmall horizontal
horizontalMd0 16pxMedium horizontal
horizontalLg0 24pxLarge horizontal

Directional Margins#

ValueCSS OutputDescription
rightSm0 8px 0 0Small right
rightMd0 16px 0 0Medium right
rightLg0 24px 0 0Large right
leftSm0 0 0 8pxSmall left
leftMd0 0 0 16pxMedium left
leftLg0 0 0 24pxLarge left

Centered Bottom Margins#

ValueCSS OutputDescription
centerBottomMd 0 auto 16px auto Centered with medium bottom
centerBottomLg 0 auto 24px auto Centered with large bottom
centerBottomXl 0 auto 32px auto Centered with extra large bottom
centerBottomXxl 0 auto 48px auto Centered with double extra large bottom

Usage#

// Center a container
ArcaneDiv(
  styles: const ArcaneStyleData(
    maxWidth: MaxWidth.content,
    margin: MarginPreset.autoX,
  ),
  children: [...],
)

// Space between sections
ArcaneSection(
  styles: const ArcaneStyleData(
    margin: MarginPreset.bottomXl,
  ),
  children: [...],
)

Gap#

Flex/Grid gap values.

ValueCSS OutputDescription
none0No gap
xs4pxExtra small
sm8pxSmall
md16pxMedium
lg24pxLarge
xl32pxExtra large
xxl48pxDouble extra large
xxxl64pxTriple extra large

Properties#

Gap.md.css    // "16px"
Gap.md.value  // 16

Usage#

ArcaneDiv(
  styles: const ArcaneStyleData(
    display: Display.flex,
    gap: Gap.md,
  ),
  children: [...],
)

// Grid gap
ArcaneDiv(
  styles: const ArcaneStyleData(
    display: Display.grid,
    gap: Gap.lg,
  ),
  children: [...],
)

Common Patterns#

Card Layout#

ArcaneCard(
  styles: const ArcaneStyleData(
    padding: PaddingPreset.lg,
    margin: MarginPreset.bottomMd,
  ),
  children: [...],
)

Button Group#

ArcaneDiv(
  styles: const ArcaneStyleData(
    display: Display.flex,
    gap: Gap.sm,
  ),
  children: [
    ArcaneButton(label: 'Cancel'),
    ArcaneButton.primary(label: 'Save'),
  ],
)

Page Container#

ArcaneDiv(
  styles: const ArcaneStyleData(
    maxWidth: MaxWidth.container,
    margin: MarginPreset.autoX,
    padding: PaddingPreset.xl,
  ),
  children: [...],
)

Section Spacing#

ArcaneSection(
  styles: const ArcaneStyleData(
    padding: PaddingPreset.sectionY,
  ),
  children: [...],
)