Gradient
Quarantine
The gradient utilities paint a brand’s stroke or fill as a colour gradient instead of a flat colour. Today the bespoke treatment is Lexus copper; any other brand falls back to a branded gradient derived from its secondary accent (e.g. Toyota red), so the utilities always render a gradient rather than a flat swatch.
How it works
Section titled “How it works”There are two utilities, and they are never the same layer:
.tng-gradient-borderrepaints the element’s border as the gradient, clipped to the border region withbackground-clip: border-area— it follows whatever border the element already declares (a full ring, a bottom-only stroke, any radius)..tng-gradient-filldraws the gradient as a full-cover background behind the content.
Rested, the gradient sits at the left edge (reading as a left-to-right sweep); on hover it slides to the centre (a radial bloom). Hover the examples to see the transition.
Gradient border
Section titled “Gradient border”Add .tng-gradient-border to any element that already has a border width.
<div class="tng-gradient-border border-lg radius-md p-xl"> Gradient border</div>Gradient fill
Section titled “Gradient fill”Add .tng-gradient-fill for a full-cover gradient background.
Keeping your own background
Section titled “Keeping your own background”.tng-gradient-border clips the element’s own background-color to the border box, so setting background directly would be erased. A component that needs both a background and a gradient border hands its background to the utility through the --tng-gradient-background property, and applies the same property itself for brands where the utility is inert:
<div class="tng-gradient-border border-lg radius-md p-xl" style=" --tng-gradient-background: var( --tng-color-background-neutral-subtle ); "> Background with border</div>On a gradient brand the utility repaints background as the gradient (on the border ring) over --tng-gradient-background (in the interior); on a non-gradient brand the utility is inert and the element’s own background: var(--tng-gradient-background) paints. One declaration works on both.
Opting out
Section titled “Opting out”Use .tng-no-gradient-border or .tng-no-gradient-fill to suppress the gradient on an element that would otherwise receive it (e.g. an auto-applied Lexus button).
Properties
Section titled “Properties”--tng-gradient-background: the interior fill painted under a gradient border. Defaults tonone(transparent interior). See keeping your own background.