-
-
Notifications
You must be signed in to change notification settings - Fork 79k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Certain Bootstrap Sass color variables error with "is not a color" if used in a Sass function #38735
Comments
Thanks for reporting his issue @svdm. --test: #fd0;
background: darken(var(--test), 20%); Generates a compilation error:
Back to your example, |
This is also issue for example when setting color as
|
I ran into a similar issue on 5.3.1 when trying to override the $primary variable. I've read the docs to the best of my ability and this has worked in versions <5.1, so not sure what's going on. You can reproduce the issue here: https://stackblitz.com/edit/stackblitz-starters-qgqpiu?file=README.md If this bug isn't in the spirit of this one, then happy to make a separate ticket. Thanks! |
from 5.3.1 to 5.3.2 to 5.3.3 to 5.3.4, good thing we are moving away from bootstrap 😥 |
This issue still exists, and prohibits using bootstrap variables and mixins together. Our "solution" is currently to stick with 5.2.3. Using css variables is awesome, but the limitation it imposes here is that you CANNOT use mixins that actually need to calculate values with css variables (since it's a conflict of compile time and run time values) |
``> I ran into a similar issue on 5.3.1 when trying to override the $primary variable. I've read the docs to the best of my ability and this has worked in versions <5.1, so not sure what's going on. You can reproduce the issue here: https://stackblitz.com/edit/stackblitz-starters-qgqpiu?file=README.md
I have created a bug for the bs-primary variable similarly. After doing quite a lot of docs/discussions scanning etc. I arrived at the conclusion that with bs 5.3.x it is relatively easy to override the $primary variable like so: |
Prerequisites
Describe the issue
Calling a Sass color function on a Bootstrap var of which the value is set to a CSS variable will error with an "... is not a color" Sass compilation error.
Given that 5.3.0 has changed the values of a lot of Sass variables to CSS variables, this breaks any code that uses those vars in places where colors are derived (which includes common mixins like
button-variant
). This caused no issues in 5.2.x.I believe this is the same underlying issue as came up in the discussion on #38687 without a test case, see the one below for a minimal reproduction.
Reduced test cases
https://stackblitz.com/edit/stackblitz-starters-tetgwb?file=src%2Fstyles.scss
If that doesn't work, it can be boiled down to:
What operating system(s) are you seeing the problem on?
macOS
What browser(s) are you seeing the problem on?
No response
What version of Bootstrap are you using?
5.3.0
The text was updated successfully, but these errors were encountered: