--- title: Card gradient summary: Card gradients give a card a colored gradient background, in single-color, multi-color, directional and animated variants. description: Gradient card backgrounds, with color variants, multi-color themes, directions and animation. added-in: '1.5.0' related: [/ui/components/card] source: core/scss/ui/_cards.scss css-vars: card-gradient classnames: component: - class: card-gradient desc: Applied with card, fills the card with a gradient style: - class: card-gradient-{preset} desc: Ready-made blends - disco, gold, love, mellow, ocean, psychedelic, rainbow, snow, sun behavior: - class: card-gradient-animated desc: Slowly shifts the gradient direction: - class: card-gradient-bottom desc: Starts the gradient at the bottom edge color: - class: card-gradient-{color} desc: Any base color as the gradient start - class: card-gradient-start desc: Sets the first color stop with a CSS custom property - class: card-gradient-end desc: Sets the second color stop --- import Example from '@components/Example.astro' export const gradients = ['rainbow', 'sun', 'snow', 'ocean', 'mellow', 'disco', 'psychedelic', 'love', 'gold'] ## Default markup Use the `.card-gradient` class on a `.card` element to apply the default gradient treatment. ```html
Track key metrics in a highlighted card.
Use this variant for visual emphasis on highlight cards.
Use this variant for visual emphasis on highlight cards.