-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Error: $color: "var(--bs-primary-rgb)" is not a color for `rgba' in v5.1.0 #34693
Comments
i have the same problem |
Same here |
Can you provide a reduced test case here? We use these RGB values to form RGBA colors for greater customization. It's not immediately clear here from your report what function or context is failing. |
Line 41 from _functions.scss is :
The original poster is doing the same thing as I am. Importing the following in a custom scss file :
so the variables, mixins, etc can be used in that file. No issues with prior versions... only started happening when I tried BS 5.1.0. |
I'm not seeing issues on my end when compiling Anyone have a reduced test case to show the problem? |
Error while compiling scss file with Koala program. |
@mdo Could be some compilers compatibility issue again, regarding Sass (Ruby but maybe Libsass too) would throw an error since it needs a |
@ffoodd Definitely seems that way. Dart Sass working without issue in our repo and the npm starter kit. @MaxxDelusional Looks like that's not compiling correctly then. What version of Sass are you using? |
@diyadin2 Using Koala here as well. |
@mdo I am also using Koala and get error. |
@mdo I am using the Web Compiler extension for Visual Studio. I am not entirely sure what compiler it uses behind the scenes. |
For what it's worth, those of us using Koala already know that it hasn't been updated/supported in years now, but it looks like quite a lot of others haven't been updated either from the responses coming in. Nothing wrong with the code being used just that a lot of us have compilers that can't handle it yet or are using ones like Koala that will never be updated. Sidenote... someone should really come out with a Koala-like app for Windows as a replacement. I would gladly pay for something with the same features/usability - haven't found anything close to it which is why I still use it. |
Is there any workaround for the time being while I try to find a replacement compiler? I'd prefer not to mod bs's scss files directly, but will do so in the meantime. |
I am using the same compiler and experiencing the same issue. |
Oh boy, that compiler hasn't been updated in 6 years... I'd really suggest finding something else. I don't think we can practically provide support for something that is so far behind our development stack :\ . |
Same here |
I have solved it with Scout App. (¬‿¬) |
@betojaton Scout just doesn't cut it for me... no javascript, can't do input/output maps, and so on. Koala, when it was maintained, killed Scout in features. I'm actually looking to switch over to vs code, but trying to find a way to mimic what Koala did is proving a bit challenging since I've never used it before or know what is out there. |
For those using Web Compiler extension. The default node-sass v4.9.3 not able to compile BS v5.1.0 anymore. Please manually download latest node-sass (at least v5.0) using npm, then replace node-sass folder in C:\Users<your id>\AppData\Local\Temp\WebCompiler1.12.394\node_modules. You also need to upgrade/replace existing Web Compiler's node.exe (located outside of node_modules folder), you can find the file after install node.js x64 for windows. Must use x64 executable file. |
For all those using Visual Studio 2019 and Mad Kristensen's "Web Compiler" extension: yes, this extension is five years old. I uninstalled this extension and instead installed another extension called "Sass Compiler", which is from Mad Kristensen as well. Using this new extension, the errors with BS v5.1.0 went away. |
@softwarea Glad you had found the solution. Indeed it is from the same developer. Sass compiler is using libsass.dll, not sure about this library. I had cloned the Web Compiler source code and compile the vsix with latest node-sass to use on visual studio 2019. There is another developer already done the extension that work on visual studio 2022 x64. But since node-sass already deprecated, so not sure whether these two extensions will continue to work on BS in future. |
Going to close this out as a compiler issue. I've added a mention of this to the v5.1.1 blog post (see draft at twbs/blog#234). Please continue to leave comments here for alternative compilers for folks. Thanks! |
I have just faced this problem and quickly got to know the cause from this discussion. I would also love to use Koala so I tried finding a solution with Koala. Finally I got a solution using Dart Sass as a system sass in Koala. However there are some modification needed. the following steps:
!!! The BAT script here has error with space in scss file path. Please instead use the fixed one from here: oklai/koala#837 (comment)
Remark: Dart Sass will support only 2 options, source mapping [yes/no] and output style [expanded/compressed]. |
@zybersup Just tried your suggestion for Dart with Koala... whenever I try to compile it errors on every file. For example :
Any ideas? Does it not like the spaces in the file location or something? That is the only place I can think of that the word 'Web' is referenced. |
Replied at oklai/koala#837 (comment). |
I think the cause is in the version of 'sass' command. I tested to compile bootstrap 5.0.0 and 5.1.3 on mac, then I got same issue. I checked the version of 'sass' command installed by gem. So, Because I am a beginner, I thought "npm is better ?" Then, it works. ( I chose npm. but I guess just upgrading gem also works, right ? ) |
I'm using Prepros to compile which is using Dart Sass 1.52.1 and I'm using Bootstrap 5.2.0. I'm getting the error: Is there a known issue with this version of Dart Sass and Bootstrap? |
@dogooddesignco - Been using BS 5.2.0 since it came out and haven't had this issue, but I am using Koala with Dart using the info earlier in this thread (not sure if that is the difference or not). |
@dogooddesignco I had similar issue with undefined variable for the same line. It turned out that in bootstrap 5.2 they replaced variable The downgrading bootstrap to 5.1.3 helped me. It worth to try. |
having also this issue with bootstrap 5.2 using scssphp compiler |
Thank you. I did it but I can't open my sass.bat. it's opened just for less than 1 second and it's closed again. What should I do? |
@maheshbokkisam I get the exact same error after updating to angular 14 |
Am I losing my mind or did they rename variables in a dot release? I had to do a diff with my scss/_variables.scss and node_modules/bootstrap/scss/_variables.scss and fix all the changes using a external diff tool. Like: // Prefix for :root CSS variables
$variable-prefix: bs- !default; // Deprecated in v5.2.0 for the shorter `$prefix`
$prefix: $variable-prefix !default; |
I am getting something similar in Angular 15.0.0 (with Angular Material 15.0.0). My app's color theme is customizable by a configuration loaded at runtime. As such, I set the theme to be based on CSS4 variables - eg:
I then alter those variables at runtime. This used to work just fine, but now, Angular Material complains (at compile time) with this:
Based on other responses above, is it possible Angular Material has a bug where it is no longer supporting CSS4 variables in its themes? |
same here (css variables no longer allowed with Angular 15.0.0?) |
I've also just encountered this issue with Angular v15.0.0 |
I do have the same problem. Have you found a solution? |
I'm stuck with this issue at the moment. So annoying... |
In my case node_modules/bootstrap/scss/_variables.scss had been updated. And I had my own scss/theme/_variables.scss now out of date with Bootstrap 5.2. I had to do a diff to bring in the recent 'minor' update to satisfy missing SCSS variables. |
Hi mate, Based on the comments from Angular team before line 16, it seems they have difficulty in set the proper value of track-color. Seems this file was modified by angular team for mdc, and it calls color.adjust function in .scss which requires a 'REAL' color instead of one relying on a css variable. The work round for Angular 15 is to replace line 16 with line 17 in _progress-bar-theme.scss from angular material source code. Cheers
|
not that bad if we change it to: |
I had this problem also, even after getting Visual Studio to compile the file. The issue comes down to the rgba() function sometimes being a SASS extension, not a CSS built-in - which was fine until CSS variables were introduced: |
I try to compile in latest v5.1.0 So, I get error as below. have i wrong anything?
My stylesheet.scss
The text was updated successfully, but these errors were encountered: