ak-edge

Border and ring colors that follow the current layer.

ak-edge controls border and ring colors for the element’s own ak-layer. Useful for giving borders their own hue, saturation, or opacity without affecting the surface.

ak-edge-* utilities require the static ak-layer class on the same element so the edge color can resolve against that layer.

10% edge opacity
Primary border at 40%
<div class="ak-layer ak-frame ak-frame-border ak-edge-10">10% edge opacity</div>
<div class="ak-layer ak-frame ak-frame-border ak-edge-primary ak-edge-40">
  Primary border at 40%
</div>

Setting the edge color

UtilityDescription
ak-edge-<number>Sets edge alpha (0–100, default 10).
ak-edge-alpha-<value>Explicit alpha alias for ak-edge-<number>. Useful for custom properties (ak-edge-alpha-(--alpha)). Arbitrary/custom-property values are raw alpha values.
ak-edge-<color>Applies a specific edge color.
ak-edge-color-<color>Explicit color-only alias. Useful for custom properties (ak-edge-color-(--edge-color)).
ak-edge-<chroma>Sets chroma from a named preset.
ak-edge-<hue>Sets hue from a named preset.
ak-edge-rawApplies the color exactly as specified, a shorthand for ak-edge-100 + ak-edge-push-0.
ak-edge-inheritUses the edge from the nearest ancestor that explicitly sets a frame border, ring, or bordering width; falls back to the current layer edge when none exists.
ak-edge-contrastKeeps the edge at 3:1 or more against the parent layer. See Contrast floor.

Adjustments

UtilityDescription
ak-edge-lighten-<number>Lightens the edge.
ak-edge-darken-<number>Darkens the edge.
ak-edge-saturate-<number>Increases chroma.
ak-edge-desaturate-<number>Decreases chroma.
ak-edge-warm-<number>Shifts hue toward --hue-warm.
ak-edge-cool-<number>Shifts hue toward --hue-cool.
ak-edge-push-<number>Pushes edge lightness away from the layer for contrast.

Channels and bounds

UtilityDescription
ak-edge-l-<value>Absolute lightness (0–100 for bare numbers, raw 0–1 for arbitrary/custom-property values).
ak-edge-c-<value>Absolute chroma (0–40 for bare numbers, raw OKLCH chroma for arbitrary/custom-property values) or a named preset.
ak-edge-h-<value>Absolute hue. Accepts named hues or degrees, including custom properties.
ak-edge-h-rotate-<number>Rotates hue by degrees.
ak-edge-max-<value>Caps lightness or chroma.
ak-edge-min-<value>Floors lightness or chroma.
ak-edge-max-l-<value>Caps lightness specifically. Arbitrary/custom-property values are raw.
ak-edge-min-l-<value>Floors lightness specifically. Arbitrary/custom-property values are raw.
ak-edge-max-c-<value>Caps chroma specifically. Arbitrary/custom-property values are raw.
ak-edge-min-c-<value>Floors chroma specifically. Arbitrary/custom-property values are raw.

Contrast floor

ak-edge-contrast keeps the edge at 3:1 or more against the parent layer, which is the contrast that WCAG 1.4.11 asks for the boundary of a control such as a text field. The floor aims 2.5% over the ratio, and an edge with a color that already reaches that keeps its color.

<input
  class="ak-layer ak-layer-lighten-6 ak-frame ak-frame-field/field ak-frame-border ak-edge-contrast"
/>
<input
  class="ak-layer ak-layer-lighten-6 ak-frame ak-frame-field/field ak-frame-border ak-edge-warning ak-edge-raw ak-edge-contrast"
/>
  • A neutral edge, without ak-edge-<color>, is black on light parent layers and white on dark ones with the default push. The floor makes it plain black or white, without the tint of the layer, and raises its alpha, and a requested alpha above the floor stays. Over a saturated fill on a dark parent layer, the floor can’t measure the fill exactly, so it measures a gray that is never lighter than the fill, and the alpha can still end up higher than the edge needs, most over red, pink, and purple fills. It measures a border as painted over the element’s own background and a ring from ak-frame-ring as painted over the parent layer, so it holds for raised and recessed fields. A white ring around a field that is lighter than a saturated dark parent layer can stay well under the floor, at about 2.5:1 on red-700, because the floor knows only the luminance of the parent layer. Use ak-frame-border or ak-frame-bordering there. It assumes the default push to black or white, so a neutral edge with ak-edge-raw or a smaller ak-edge-push-* keeps its color and can stay under the floor.
  • An edge with a color becomes solid. Its lightness moves toward the floor, keeping its chroma and hue where the sRGB gamut allows, so it can land a little over it. Pair the color with ak-edge-raw or ak-edge-push-0, because the default push moves the color to black or white first. The floor measures the color clipped to the sRGB gamut, as it paints. A color that passes there keeps its color, even outside sRGB, and a color that has to move is clipped. ak-edge-inherit also counts as a color, so leave the floor off on an edge that inherits.
  • The contrast-more variant raises the floor to 4.5:1. ak-disabled lowers it with --ak-disabled-contrast-scale, to 1.5:1 by default.
  • The floor follows the light or dark scheme of the parent layer. A layer without a parent layer, such as the body canvas, keeps its regular edge.
  • The floor measures colors as browsers paint them on an sRGB display. Saturated colors often leave the sRGB gamut, so the floor measures them clipped to it.
  • Firefox rounds the values that the floor carries between steps to 8 bits, so on a few parent layers, such as ak-layer-lime-600, its edge can land slightly under the ratio. Chrome and Safari stay at or over it.

Use it for edges that identify a control. Decorative seams, such as card borders and dividers, don’t need it. The floor costs more style work than a regular edge, but only on the elements that use it.