Gradient Utilities

The gradient utilities provide a set of classes to adjust the color background-image properties of elements for the purpose of creating gradients.

Gradient Type

Class NamePropertyValue
.gradientbackground-imagelinear-gradient(var(--graupl-gradient-direction), var(--graupl-gradient-from) var(--graupl-gradient-from-position), var(--graupl-gradient-to) var(--graupl-gradient-to-position))
.gradient-linearbackground-imagelinear-gradient(var(--graupl-gradient-direction), var(--graupl-gradient-from) var(--graupl-gradient-from-position), var(--graupl-gradient-to) var(--graupl-gradient-to-position))
.gradient-radialbackground-imageradial-gradient(var(--graupl-gradient-direction), var(--graupl-gradient-from) var(--graupl-gradient-from-position), var(--graupl-gradient-to) var(--graupl-gradient-to-position))

Custom Gradient Properties

Used to customize gradient types.

Custom PropertyDescriptionDefault Value
--graupl-gradient-fromStarting color used by generated gradientstransparent
--graupl-gradient-from-positionStart color stop position used for generated gradients0%
--graupl-gradient-toEnding color used by generated gradientstransparent
--graupl-gradient-to-positionEnd color stop position used for generated gradients100%
--graupl-gradient-directionDirection/shape keyword consumed by gradient utilitiesto right (gradient-linear), circle (gradient-radial)`

Gradient Direction

Class NamePropertyValue
.gradient-direction-to-top--graupl-gradient-directionto top
.gradient-direction-to-right--graupl-gradient-directionto right
.gradient-direction-to-bottom--graupl-gradient-directionto bottom
.gradient-direction-to-left--graupl-gradient-directionto left
.gradient-direction-circle--graupl-gradient-directioncircle
.gradient-direction-circle-at-top--graupl-gradient-directioncircle at top
.gradient-direction-circle-at-right--graupl-gradient-directioncircle at right
.gradient-direction-circle-at-bottom--graupl-gradient-directioncircle at bottom
.gradient-direction-circle-at-left--graupl-gradient-directioncircle at left
.gradient-direction-ellipse--graupl-gradient-directionellipse
.gradient-direction-ellipse-at-top--graupl-gradient-directionellipse at top
.gradient-direction-ellipse-at-right--graupl-gradient-directionellipse at right
.gradient-direction-ellipse-at-bottom--graupl-gradient-directionellipse at bottom
.gradient-direction-ellipse-at-left--graupl-gradient-directionellipse at left
.gradient-direction-closest-side--graupl-gradient-directionclosest-side
.gradient-direction-closest-corner--graupl-gradient-directionclosest-corner
.gradient-direction-farthest-side--graupl-gradient-directionfarthest-side
.gradient-direction-farthest-corner--graupl-gradient-directionfarthest-corner

Gradient From Color

Class NamePropertyValue
.from-transparent--graupl-gradient-fromtransparent
.from-primary--graupl-gradient-fromvar(--graupl-theme-active--primary)
.from-primary-100--graupl-gradient-fromvar(--graupl-theme-active--primary--100)
.from-primary-200--graupl-gradient-fromvar(--graupl-theme-active--primary--200)
.from-primary-300--graupl-gradient-fromvar(--graupl-theme-active--primary--300)
.from-primary-400--graupl-gradient-fromvar(--graupl-theme-active--primary--400)
.from-primary-500--graupl-gradient-fromvar(--graupl-theme-active--primary--500)
.from-primary-600--graupl-gradient-fromvar(--graupl-theme-active--primary--600)
.from-primary-700--graupl-gradient-fromvar(--graupl-theme-active--primary--700)
.from-primary-800--graupl-gradient-fromvar(--graupl-theme-active--primary--800)
.from-primary-900--graupl-gradient-fromvar(--graupl-theme-active--primary--900)
.from-secondary--graupl-gradient-fromvar(--graupl-theme-active--secondary)
.from-secondary-100--graupl-gradient-fromvar(--graupl-theme-active--secondary--100)
.from-secondary-200--graupl-gradient-fromvar(--graupl-theme-active--secondary--200)
.from-secondary-300--graupl-gradient-fromvar(--graupl-theme-active--secondary--300)
.from-secondary-400--graupl-gradient-fromvar(--graupl-theme-active--secondary--400)
.from-secondary-500--graupl-gradient-fromvar(--graupl-theme-active--secondary--500)
.from-secondary-600--graupl-gradient-fromvar(--graupl-theme-active--secondary--600)
.from-secondary-700--graupl-gradient-fromvar(--graupl-theme-active--secondary--700)
.from-secondary-800--graupl-gradient-fromvar(--graupl-theme-active--secondary--800)
.from-secondary-900--graupl-gradient-fromvar(--graupl-theme-active--secondary--900)
.from-tertiary--graupl-gradient-fromvar(--graupl-theme-active--tertiary)
.from-tertiary-100--graupl-gradient-fromvar(--graupl-theme-active--tertiary--100)
.from-tertiary-200--graupl-gradient-fromvar(--graupl-theme-active--tertiary--200)
.from-tertiary-300--graupl-gradient-fromvar(--graupl-theme-active--tertiary--300)
.from-tertiary-400--graupl-gradient-fromvar(--graupl-theme-active--tertiary--400)
.from-tertiary-500--graupl-gradient-fromvar(--graupl-theme-active--tertiary--500)
.from-tertiary-600--graupl-gradient-fromvar(--graupl-theme-active--tertiary--600)
.from-tertiary-700--graupl-gradient-fromvar(--graupl-theme-active--tertiary--700)
.from-tertiary-800--graupl-gradient-fromvar(--graupl-theme-active--tertiary--800)
.from-tertiary-900--graupl-gradient-fromvar(--graupl-theme-active--tertiary--900)

Gradient To Color

Class NamePropertyValue
.to-transparent--graupl-gradient-totransparent
.to-primary--graupl-gradient-tovar(--graupl-theme-active--primary)
.to-primary-100--graupl-gradient-tovar(--graupl-theme-active--primary--100)
.to-primary-200--graupl-gradient-tovar(--graupl-theme-active--primary--200)
.to-primary-300--graupl-gradient-tovar(--graupl-theme-active--primary--300)
.to-primary-400--graupl-gradient-tovar(--graupl-theme-active--primary--400)
.to-primary-500--graupl-gradient-tovar(--graupl-theme-active--primary--500)
.to-primary-600--graupl-gradient-tovar(--graupl-theme-active--primary--600)
.to-primary-700--graupl-gradient-tovar(--graupl-theme-active--primary--700)
.to-primary-800--graupl-gradient-tovar(--graupl-theme-active--primary--800)
.to-primary-900--graupl-gradient-tovar(--graupl-theme-active--primary--900)
.to-secondary--graupl-gradient-tovar(--graupl-theme-active--secondary)
.to-secondary-100--graupl-gradient-tovar(--graupl-theme-active--secondary--100)
.to-secondary-200--graupl-gradient-tovar(--graupl-theme-active--secondary--200)
.to-secondary-300--graupl-gradient-tovar(--graupl-theme-active--secondary--300)
.to-secondary-400--graupl-gradient-tovar(--graupl-theme-active--secondary--400)
.to-secondary-500--graupl-gradient-tovar(--graupl-theme-active--secondary--500)
.to-secondary-600--graupl-gradient-tovar(--graupl-theme-active--secondary--600)
.to-secondary-700--graupl-gradient-tovar(--graupl-theme-active--secondary--700)
.to-secondary-800--graupl-gradient-tovar(--graupl-theme-active--secondary--800)
.to-secondary-900--graupl-gradient-tovar(--graupl-theme-active--secondary--900)
.to-tertiary--graupl-gradient-tovar(--graupl-theme-active--tertiary)
.to-tertiary-100--graupl-gradient-tovar(--graupl-theme-active--tertiary--100)
.to-tertiary-200--graupl-gradient-tovar(--graupl-theme-active--tertiary--200)
.to-tertiary-300--graupl-gradient-tovar(--graupl-theme-active--tertiary--300)
.to-tertiary-400--graupl-gradient-tovar(--graupl-theme-active--tertiary--400)
.to-tertiary-500--graupl-gradient-tovar(--graupl-theme-active--tertiary--500)
.to-tertiary-600--graupl-gradient-tovar(--graupl-theme-active--tertiary--600)
.to-tertiary-700--graupl-gradient-tovar(--graupl-theme-active--tertiary--700)
.to-tertiary-800--graupl-gradient-tovar(--graupl-theme-active--tertiary--800)
.to-tertiary-900--graupl-gradient-tovar(--graupl-theme-active--tertiary--900)

Customization

To customize the gradient utilities, you can use the following variables.

VariableDescriptionDefault Value
$selector-baseBase selector for utility classes."."
$selector-prefixThe selector prefix for all utility classes.""
$selector-suffixThe selctor suffix for all utility classes.""
$selector-separatorThe selector separator for all utility classes.""
$use-importantAppends !important to generated utility declarations.true
$generate-base-utilitiesGenerates the base utility classes.true
$screen-awareEnables screen-aware utility variants.false
$theme-awareEnables theme-aware utility variants.false
$scheme-awareEnables scheme-aware utility variants.false
$state-awareEnables state-aware utility variants.false
$container-awareEnables container-aware utility variants.false
$screen-aware-selector-prefixPrefix to the screen-aware portion of utility selectors.""
$screen-aware-selector-suffixSuffix to the screen-aware portion of utility selectors.""
$screen-aware-selector-separatorSeparator inserted for screen-aware utility selectors."\\:"
$theme-aware-selector-prefixPrefix to the theme-aware portion of utility selectors.""
$theme-aware-selector-suffixSuffix to the theme-aware portion of utility selectors."-theme"
$theme-aware-selector-separatorSeparator inserted for theme-aware utility selectors."\\:"
$scheme-aware-selector-prefixPrefix to the scheme-aware portion of utility selectors.""
$scheme-aware-selector-suffixSuffix to the scheme-aware portion of utility selectors."-mode"
$scheme-aware-selector-separatorSeparator inserted for scheme-aware utility selectors."\\:"
$state-aware-selector-prefixPrefix to the state-aware portion of utility selectors.""
$state-aware-selector-suffixSuffix to the state-aware portion of utility selectors.""
$state-aware-selector-separatorSeparator inserted for state-aware utility selectors."\\:"
$container-aware-selector-prefixPrefix to the container-aware portion of utility selectors."cq\\:"
$container-aware-selector-suffixSuffix to the container-aware portion of utility selectors.""
$container-aware-selector-separatorSeparator inserted for container-aware utility selectors."\\:"
$utility-propertiesMap of utility properties.()
$utility-valuesMap of utility values.()
$utility-mapMap of utility property/value pairs.()

Responsive Variants

Generating responsive utility classes can be done by setting $screen-aware, $theme-aware, $scheme-aware, $state-aware, or $container-aware to true.

By default, no responsive utility classes are generated for gradient.

✏️ Note

For more information on responsive variants, refer to the Responsive utility classes documentation.