Border color
Set physical border colors from configured values or a validated arbitrary color.
Color every border, an axis, or an individual physical edge.
Quick reference
| Example class | Expected declarations |
|---|---|
border-ink | border-top-color: var(--zw-color-ink); border-right-color: var(--zw-color-ink); border-bottom-color: var(--zw-color-ink); border-left-color: var(--zw-color-ink); |
border-x-accent/85 | border-left-color: color-mix(in oklab, var(--zw-color-accent) 85%, transparent); border-right-color: color-mix(in oklab, var(--zw-color-accent) 85%, transparent); |
border-y-focus | border-top-color: var(--zw-color-focus); border-bottom-color: var(--zw-color-focus); |
border-b-alert/90 | border-bottom-color: color-mix(in oklab, var(--zw-color-alert) 90%, transparent); |
border-l-ink | border-left-color: var(--zw-color-ink); |
border-r-accent | border-right-color: var(--zw-color-accent); |
border-t-focus | border-top-color: var(--zw-color-focus); |
Example setup
The shared preview base explicitly sets spec 1, reset: "none", strict mode, tokens.spacingUnit: "0.25rem", and no breakpoints. Each named value is configured in that example; there is no inherited palette or theme. wind-demo classes are authored context styles; their CSS is shown separately from the utility declarations.
Examples in use
Color a full border or both sides of an axis
border-ink colors all four edges, border-x-accent/85 colors left and right, and border-y-focus colors top and bottom.
<div class="wind-demo-border-colors"><div class="wind-demo-color-box border-4 border-ink p-2">border-ink · all sides</div><div class="wind-demo-color-box border-4 border-x-accent/85 p-2">border-x-accent/85 · left and right</div><div class="wind-demo-color-box border-4 border-y-focus p-2">border-y-focus · top and bottom</div></div>@layer zw-reset, zw-tokens, zfb-hi, base, components;
@layer zw-tokens {
:root {
--zw-color-accent: #075985;
--zw-color-alert: #8b1e3f;
--zw-color-focus: #0f766e;
--zw-color-ink: #16324f;
--zw-color-panel: #edf4f8;
--zw-color-white: #fff;
--zw-spacing-unit: .25rem;
}
}
.wind-demo-border-colors {
max-width: 34rem;
color: #16324f;
font: 14px / 1.5 system-ui, sans-serif;
}
.wind-demo-color-box {
margin: .7rem 0;
}
.p-2 {
padding-top: 0.5rem;
padding-right: 0.5rem;
padding-bottom: 0.5rem;
padding-left: 0.5rem;
}
.border-4 {
border-top-width: 4px;
border-top-style: solid;
border-right-width: 4px;
border-right-style: solid;
border-bottom-width: 4px;
border-bottom-style: solid;
border-left-width: 4px;
border-left-style: solid;
}
.border-ink {
border-top-color: var(--zw-color-ink);
border-right-color: var(--zw-color-ink);
border-bottom-color: var(--zw-color-ink);
border-left-color: var(--zw-color-ink);
}
.border-x-accent\/85 {
border-left-color: color-mix(in oklab, var(--zw-color-accent) 85%, transparent);
border-right-color: color-mix(in oklab, var(--zw-color-accent) 85%, transparent);
}
.border-y-focus {
border-top-color: var(--zw-color-focus);
border-bottom-color: var(--zw-color-focus);
}Configuration for this example
{
"wind": {
"spec": 1,
"reset": "none",
"strict": true,
"tokens": {
"spacingUnit": "0.25rem",
"colors": {
"ink": "#16324f",
"accent": "#075985",
"focus": "#0f766e",
"alert": "#8b1e3f",
"panel": "#edf4f8",
"white": "#ffffff"
}
},
"breakpoints": {},
"defaultTransitionTimingFunction": "ease",
"authoredClasses": {
"wind-demo-border-colors": true,
"wind-demo-color-box": true
},
"safelist": {
"docs-preview": [
"border-4",
"border-ink",
"border-x-accent/85",
"border-y-focus",
"p-2"
]
}
}
}Authored demonstration CSS
.wind-demo-border-colors { max-width: 34rem; color: #16324f; font: 14px/1.5 system-ui, sans-serif; }
.wind-demo-color-box { margin: 0.7rem 0; }Give individual edges separate colors
The edge utilities change only the named physical side; border-4 supplies a visible width.
<div class="wind-demo-border-colors"><div class="wind-demo-color-box border-4 border-t-focus p-2">top · focus</div><div class="wind-demo-color-box border-4 border-r-accent p-2">right · accent</div><div class="wind-demo-color-box border-4 border-b-alert/90 p-2">bottom · alert</div><div class="wind-demo-color-box border-4 border-l-ink p-2">left · ink</div></div>@layer zw-reset, zw-tokens, zfb-hi, base, components;
@layer zw-tokens {
:root {
--zw-color-accent: #075985;
--zw-color-alert: #8b1e3f;
--zw-color-focus: #0f766e;
--zw-color-ink: #16324f;
--zw-color-panel: #edf4f8;
--zw-color-white: #fff;
--zw-spacing-unit: .25rem;
}
}
.wind-demo-border-colors {
max-width: 34rem;
color: #16324f;
font: 14px / 1.5 system-ui, sans-serif;
}
.wind-demo-color-box {
margin: .7rem 0;
}
.p-2 {
padding-top: 0.5rem;
padding-right: 0.5rem;
padding-bottom: 0.5rem;
padding-left: 0.5rem;
}
.border-4 {
border-top-width: 4px;
border-top-style: solid;
border-right-width: 4px;
border-right-style: solid;
border-bottom-width: 4px;
border-bottom-style: solid;
border-left-width: 4px;
border-left-style: solid;
}
.border-b-alert\/90 {
border-bottom-color: color-mix(in oklab, var(--zw-color-alert) 90%, transparent);
}
.border-l-ink {
border-left-color: var(--zw-color-ink);
}
.border-r-accent {
border-right-color: var(--zw-color-accent);
}
.border-t-focus {
border-top-color: var(--zw-color-focus);
}Configuration for this example
{
"wind": {
"spec": 1,
"reset": "none",
"strict": true,
"tokens": {
"spacingUnit": "0.25rem",
"colors": {
"ink": "#16324f",
"accent": "#075985",
"focus": "#0f766e",
"alert": "#8b1e3f",
"panel": "#edf4f8",
"white": "#ffffff"
}
},
"breakpoints": {},
"defaultTransitionTimingFunction": "ease",
"authoredClasses": {
"wind-demo-border-colors": true,
"wind-demo-color-box": true
},
"safelist": {
"docs-preview": [
"border-4",
"border-b-alert/90",
"border-l-ink",
"border-r-accent",
"border-t-focus",
"p-2"
]
}
}
}Authored demonstration CSS
.wind-demo-border-colors { max-width: 34rem; color: #16324f; font: 14px/1.5 system-ui, sans-serif; }
.wind-demo-color-box { margin: 0.7rem 0; }Custom and named values
Named colors such as border-ink must be configured in tokens.colors; there is no default palette. border-current and border-transparent are supported keywords. A color slash modifier accepts an integer from 0 through 100, such as border-x-accent/85. Bracket values accept validated CSS colors. The border, border-x, border-y, and edge forms select physical sides; combine them with a border-width utility to make the color visible. Width and color share class roots, so numeric suffixes mean width while configured color names mean color.
Related guides: Utility grammar · Variants
Catalog details
border
| Field | Value |
|---|---|
| Catalog identifier | v1.border.color |
| Class pattern | border-<suffix> |
| Grammar | {"acceptedKinds":["keyword","token","arbitrary"],"arbitraryProperty":"border-top-color","allowsFractionSlash":false,"allowsColorOpacity":true} |
| Accepted values | 2 |
| Token categories | colors |
| Negative-value policy | forbidden |
| Conflict group and rank | border-color (25) |
| Order rank | 0 |
| Selector shape | ownElement |
| Spec version | 1 |
| Emitter properties | border-top-color, border-right-color, border-bottom-color, border-left-color |
Accepted values
| Kind | Suffix | Emitted value |
|---|---|---|
keyword | "transparent" | "transparent" |
keyword | "current" | "currentColor" |
Declaration templates
| Property | Value kind | Fixed value |
|---|---|---|
border-top-color | resolved | null |
border-right-color | resolved | null |
border-bottom-color | resolved | null |
border-left-color | resolved | null |
Catalog examples
| Example class | Expected declarations |
|---|---|
border-[red]/40 | border-top-color: color-mix(in oklab, red 40%, transparent); border-right-color: color-mix(in oklab, red 40%, transparent); border-bottom-color: color-mix(in oklab, red 40%, transparent); border-left-color: color-mix(in oklab, red 40%, transparent) |
border-x
| Field | Value |
|---|---|
| Catalog identifier | v1.border.color.x |
| Class pattern | border-x-<suffix> |
| Grammar | {"acceptedKinds":["keyword","token","arbitrary"],"arbitraryProperty":"border-left-color","allowsFractionSlash":false,"allowsColorOpacity":true} |
| Accepted values | 2 |
| Token categories | colors |
| Negative-value policy | forbidden |
| Conflict group and rank | border-color (25) |
| Order rank | 1 |
| Selector shape | ownElement |
| Spec version | 1 |
| Emitter properties | border-left-color, border-right-color |
Accepted values
| Kind | Suffix | Emitted value |
|---|---|---|
keyword | "transparent" | "transparent" |
keyword | "current" | "currentColor" |
Declaration templates
| Property | Value kind | Fixed value |
|---|---|---|
border-left-color | resolved | null |
border-right-color | resolved | null |
Catalog examples
| Example class | Expected declarations |
|---|---|
border-x-[red]/40 | border-left-color: color-mix(in oklab, red 40%, transparent); border-right-color: color-mix(in oklab, red 40%, transparent) |
border-y
| Field | Value |
|---|---|
| Catalog identifier | v1.border.color.y |
| Class pattern | border-y-<suffix> |
| Grammar | {"acceptedKinds":["keyword","token","arbitrary"],"arbitraryProperty":"border-top-color","allowsFractionSlash":false,"allowsColorOpacity":true} |
| Accepted values | 2 |
| Token categories | colors |
| Negative-value policy | forbidden |
| Conflict group and rank | border-color (25) |
| Order rank | 1 |
| Selector shape | ownElement |
| Spec version | 1 |
| Emitter properties | border-top-color, border-bottom-color |
Accepted values
| Kind | Suffix | Emitted value |
|---|---|---|
keyword | "transparent" | "transparent" |
keyword | "current" | "currentColor" |
Declaration templates
| Property | Value kind | Fixed value |
|---|---|---|
border-top-color | resolved | null |
border-bottom-color | resolved | null |
Catalog examples
| Example class | Expected declarations |
|---|---|
border-y-[red]/40 | border-top-color: color-mix(in oklab, red 40%, transparent); border-bottom-color: color-mix(in oklab, red 40%, transparent) |
border-b
| Field | Value |
|---|---|
| Catalog identifier | v1.border.color.b |
| Class pattern | border-b-<suffix> |
| Grammar | {"acceptedKinds":["keyword","token","arbitrary"],"arbitraryProperty":"border-bottom-color","allowsFractionSlash":false,"allowsColorOpacity":true} |
| Accepted values | 2 |
| Token categories | colors |
| Negative-value policy | forbidden |
| Conflict group and rank | border-color (25) |
| Order rank | 2 |
| Selector shape | ownElement |
| Spec version | 1 |
| Emitter properties | border-bottom-color |
Accepted values
| Kind | Suffix | Emitted value |
|---|---|---|
keyword | "transparent" | "transparent" |
keyword | "current" | "currentColor" |
Declaration templates
| Property | Value kind | Fixed value |
|---|---|---|
border-bottom-color | resolved | null |
Catalog examples
| Example class | Expected declarations |
|---|---|
border-b-[red]/40 | border-bottom-color: color-mix(in oklab, red 40%, transparent) |
border-l
| Field | Value |
|---|---|
| Catalog identifier | v1.border.color.l |
| Class pattern | border-l-<suffix> |
| Grammar | {"acceptedKinds":["keyword","token","arbitrary"],"arbitraryProperty":"border-left-color","allowsFractionSlash":false,"allowsColorOpacity":true} |
| Accepted values | 2 |
| Token categories | colors |
| Negative-value policy | forbidden |
| Conflict group and rank | border-color (25) |
| Order rank | 2 |
| Selector shape | ownElement |
| Spec version | 1 |
| Emitter properties | border-left-color |
Accepted values
| Kind | Suffix | Emitted value |
|---|---|---|
keyword | "transparent" | "transparent" |
keyword | "current" | "currentColor" |
Declaration templates
| Property | Value kind | Fixed value |
|---|---|---|
border-left-color | resolved | null |
Catalog examples
| Example class | Expected declarations |
|---|---|
border-l-[red]/40 | border-left-color: color-mix(in oklab, red 40%, transparent) |
border-r
| Field | Value |
|---|---|
| Catalog identifier | v1.border.color.r |
| Class pattern | border-r-<suffix> |
| Grammar | {"acceptedKinds":["keyword","token","arbitrary"],"arbitraryProperty":"border-right-color","allowsFractionSlash":false,"allowsColorOpacity":true} |
| Accepted values | 2 |
| Token categories | colors |
| Negative-value policy | forbidden |
| Conflict group and rank | border-color (25) |
| Order rank | 2 |
| Selector shape | ownElement |
| Spec version | 1 |
| Emitter properties | border-right-color |
Accepted values
| Kind | Suffix | Emitted value |
|---|---|---|
keyword | "transparent" | "transparent" |
keyword | "current" | "currentColor" |
Declaration templates
| Property | Value kind | Fixed value |
|---|---|---|
border-right-color | resolved | null |
Catalog examples
| Example class | Expected declarations |
|---|---|
border-r-[red]/40 | border-right-color: color-mix(in oklab, red 40%, transparent) |
border-t
| Field | Value |
|---|---|
| Catalog identifier | v1.border.color.t |
| Class pattern | border-t-<suffix> |
| Grammar | {"acceptedKinds":["keyword","token","arbitrary"],"arbitraryProperty":"border-top-color","allowsFractionSlash":false,"allowsColorOpacity":true} |
| Accepted values | 2 |
| Token categories | colors |
| Negative-value policy | forbidden |
| Conflict group and rank | border-color (25) |
| Order rank | 2 |
| Selector shape | ownElement |
| Spec version | 1 |
| Emitter properties | border-top-color |
Accepted values
| Kind | Suffix | Emitted value |
|---|---|---|
keyword | "transparent" | "transparent" |
keyword | "current" | "currentColor" |
Declaration templates
| Property | Value kind | Fixed value |
|---|---|---|
border-top-color | resolved | null |
Catalog examples
| Example class | Expected declarations |
|---|---|
border-t-[red]/40 | border-top-color: color-mix(in oklab, red 40%, transparent) |