bootstrap: V4.beta Argument `$color` of `darken($color, $amount)` must be a color
I have update bootstrap to 4.0.0-beta, and i get this error while compiling:
$link-hover-color: darken($link-color, 15%) !default;
^
Argument $color of darken($color, $amount) must be a color
Backtrace:
node_modules/bootstrap/scss/_variables.scss:168, in function darken
node_modules/bootstrap/scss/_variables.scss:168
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 21
- Comments: 30 (5 by maintainers)
Commits related to this issue
- Update to v4.0.0-beta notice we can't simply copy _variables.scss any more due to https://github.com/twbs/bootstrap/issues/23331 — committed to bassjobsen/empty-bootstrap-project-gulp by bassjobsen 7 years ago
@derkjn you need to import the functions scss before variables
@maxkorz I was working on splitting out my styles and the vendor styles when this started happening. I couldn’t figure out for a while why it was suddenly complaining, but after following the stack trace carefully, I think I found the culprit.
My app.scss just pulls in the Bootstrap variables so I can use them in my own styles for the time being, so I had to make sure I was pulling the functions in first then my own stuff, like so:
Then in my vendor stylesheet, I just pulled in Bootstrap like normal:
I got it working with Webpack 3 and Angular by using:
at the top of my main app.scss and then anytime i import the variables file I do like this:
This got rid of the errors but I don’t remember having to do this with alpha 6
Having exact same issue as @derkjn. Trying to compile bootstrap.scss and getting the same error, even though _functions.scss is the first import in that file.
To resolve, I had to import _functions.scss BEFORE bootstrap.scss.
Not sure if this is an issue with compiler (gulp-sass) or with bootstrap.
Got the same issue. Don’t understand why issue is closed if it still actual???
I’m still stuck on this. I’m not importing anything of my own. My
main.scssis just:and I still get
Any help is greatly appreciated!
@eness just make sure you import
functionsbeforevariablesin every place where you importvariablesstill having the same issue. I miss the days everything was just awesome …
Be sure to check the bootstrap version! bootstrap@4.0.0-beta.2 works like a charm.
My bad, I was compiling two
.scssfiles with Gulp 🤦♂️ . The replica of_bootstrap.scssand another one wich use_variables.scsstoo. @derkjn check in yougulpfile.jsthat your are not compiling another file.We still have them all, they’re just different class names. Instead of
.hidden-xs-up, used-none, etc. And yes, you’ll need the_functions.scssfile.