Skip to main content

Border

Open in ChatGPT

The border properties are used to control the component border style and width. See available border styles.

Example

.element {
border: var(--dwc-border-width) var(--dwc-border-style) var(--dwc-border-color);
}

Variables

VariableDefault Value
--dwc-border-width1px
--dwc-border-stylesolid
--dwc-border-colorvar(--dwc-border-color-default)
--dwc-border-color-emphasisvar(--dwc-border-color-default-emphasis)

Per-palette border colors

Each color palette generates its own border color variables:

Variable PatternDescription
--dwc-border-color-{name}Mode-aware border color tinted with the palette hue.
--dwc-border-color-{name}-emphasisStronger variant for hover, focus, and active states.

Where {name} is one of: primary, success, warning, danger, info, gray, default.

Border radius

Border radius variables define how rounded the corners of a component are. All sizes scale from a single seed value (--dwc-border-radius-seed). Changing the seed rescales the entire radius system proportionally.

Example

.element {
border-radius: var(--dwc-border-radius-m);
}

Variables

VariableDefault ValueComputed (at seed=8px)
--dwc-border-radius-seed0.5rem8px
--dwc-border-radius-2xs0.0625rem1px (fixed)
--dwc-border-radius-xs0.125rem2px (fixed)
--dwc-border-radius-scalc(seed * 0.5)4px
--dwc-border-radius-mcalc(seed * 0.75)6px
--dwc-border-radius-lvar(--dwc-border-radius-seed)8px
--dwc-border-radius-xlcalc(seed * 1.5)12px
--dwc-border-radius-2xlcalc(seed * 2)16px
--dwc-border-radius-3xlcalc(seed * 3)24px
--dwc-border-radius-4xlcalc(seed * 4)32px
--dwc-border-radius-round50%
--dwc-border-radius-pillcalc(var(--dwc-size-m) / 2)
--dwc-border-radiusvar(--dwc-border-radius-seed)8px

Usage guidelines

  • Items inside containers: use s (0.5x seed)
  • Structural borders (between item and container): use m (0.75x seed)
  • Containers and surfaces: use l (1x seed)
  • Large overlays: use xl (1.5x seed)