Set color to a gradient in theme manager / alternative way?

I want to set the primary color to a gradient.
For example I want the primary color to be pink to orange:

Should I (and how?) set the primary color to it. Or is my best option to create a custom class like I did and add the gradient to that. Then add it to every element? (Would prefer to use the theme manager as much as possible to prevent mistakes/extra work)

PS where are the scss/_variables.scss sass files as found here: shttps://getbootstrap.com/docs/5.0/customize/color/ ?

Do you want to do this for ALL elements using primary color? Or only for the buttons background?
What about the text using the primary color as a text color?

@Teodor Good point.
I wouldn’t want that for the text using the primary color as text. You’re right - my goal is to have this gradient for all buttons background.

Then it’s better to use a separate class for this, or just override the

.btn-primary {
}

class in your custom css.

1 Like

THanks @Teodor

Then I’m guessing I shouldn’t be overriding it directly in the local bootstrap file, correct?

No, you should never edit the bootstrap css files.
Create a separate css file, include it after the bootstrap css include and add your overrides there.

1 Like