I am trying to change bootstrap primary color to linear-gredient
but I am getting an error:
$theme-colors: (
"primary": linear-gradient(to right, #373b44, #4286f4)
);
error:
$link-hover-color: darken($link-color, 15%) !default; ^ Argument `$color` of `darken($color, $amount)` must be a color
By adding a .bg-gradient class, a linear gradient is added as background image to the backgrounds. This gradient starts with a semi-transparent white which fades out to the bottom. Do you need a gradient in your custom CSS? Just add background-image: var(--bs-gradient); .
Gradients and shadows# Bootstrap 4 has built-in custom variables which begin with $enable- (see Sass options). You can enable gradient and shadow effects with setting $enable-gradients and $enable-shadows to true .
Step 1: Apply a basic background to the body tag and align the text to center of the page. Step 2: Do some basic styling like font-size and family etc. Step 3: Apply the linear gradient property with any colors of your choice.
The problem is that linear-gradient
is used for background-image
, not foreground color
. When the SASS compiler attempts to build Bootstrap it can't use the darken(..) function on a background-image.
Instead you can just change the primary
color for the elements that have a background like this...
.bg-primary,
.btn-primary,
.badge-primary,
.alert-primary {
background-image: linear-gradient(to right, #373b44, #4286f4);
}
https://www.codeply.com/go/XXUxFr6tEZ
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With