Color mixins (bg, text-color, text-on-color, gradient, adaptive-contrast) and the color name resolver shared with border-color.
Generated from the doc blocks in the core source when the site is built, so it always matches the current release of @wovenui/core. Every example is compiled against core during the build; open Compiled CSSunder an example to see its output. Guide: Colors. The A to Z index lists every public mixin and function.
Sets background-color and the higher contrast text color, both computed at compile time; under prefers-contrast: more the background moves away from the text color (darker under light text, lighter under dark text) for a higher ratio.
The output is resolved color values, not var(--wu-*) tokens, so the result does not follow themes.
@mixinadaptive-contrast($color)
Parameter
Type
Default
Description
$color
String|Color
Required
A role or palette name (resolved with get-color()) or a color value
See also: bg, text-on-color. Source: utilities/_colors.scss:247
bgmixin
Sets background-color from a role, palette name, theme word or color, emitting the matching var(--wu-*) token.
bg(brand) gives var(--wu-brand) and bg(red) the fixed var(--wu-red-500); a shade outside 50 to 950 raises an error, and a raw color with a shade is shaded at compile time.
@mixinbg($color, $shade: null)
Parameter
Type
Default
Description
$color
String|Color
Required
A role (brand, danger), role state (danger-subtle, brand-hover), palette name (red), theme word (base, surface, alternate, raised, hover, selected, disabled), color value or var()
$shade
Number|Null
null
A shade stop (50, 100 to 900, 950) for a role or palette name
Sets color from a role, palette name, theme word or color, emitting the matching var(--wu-text-*) token.
text-color(brand) gives var(--wu-text-brand) and text-color(red) the theme aware var(--wu-text-red); with a shade the token is var(--wu-{name}-{stop}).
@mixintext-color($color-name, $shade: null)
Parameter
Type
Default
Description
$color-name
String|Color
Required
A role (brand, danger), palette name (red), theme word (regular, muted, subtle, inverted, link, link-hover), color value or var()
$shade
Number|Null
null
A shade stop (50, 100 to 900, 950) for a role or palette name, giving the fixed palette token
See also: bg, text-on-color. Source: utilities/_colors.scss:308
text-on-colormixin
Sets the text color for content placed on a filled color: a role gives its var(--wu-text-on-*) token, anything else the higher contrast text color computed at compile time.
A role with a shade, a palette name or a color value gives a fixed color that does not follow themes.
@mixintext-on-color($color-name, $shade: null)
Parameter
Type
Default
Description
$color-name
String|Color
Required
A role (brand, danger), palette name (purple) or color value
$shade
Number|Null
null
Shade stop of the fill (50, 100 to 900, 950); defaults to 500 when the color is not a role
Sets background-image to a linear-gradient with the given direction and color stops; color names resolve like bg() (roles, palette names, theme words), other colors and positions are written as passed.
An unknown color word raises the same error as bg().
@mixingradient($direction, $colors...)
Parameter
Type
Default
Description
$direction
String|Number
Required
A direction such as to right or an angle such as 135deg
$colors
Any
Required
Color stops: a role (brand), palette name (red), theme word (surface), color value or var(), each optionally followed by a position (brand 20%)