bootstrap-rubygem
bootstrap-rubygem copied to clipboard
Not sure why I'm seeing this error
I'm using the custom and variable files together (downloaded the latest), but for some reason, I'm getting this error:
$color: 'theme-color("primary")' is not a color for "darken"'
If I comment out the entire variables file this error goes away. Any ideas on why this still appears? I saw that it was supposed to be fixed last year? I am running it on Rails 5.2.0.rc1 but that shouldn't matter should it? Do I need to remove the @import "bootstrap/variables"; from the custom file? I tried that but I get a different error: $colors.
Check the imports/requireds in your application.js and application.scss. Things are not getting loaded in the proper order. I had the same error when upgrading to BS4 and finally fixed it by adjusting these.
// Custom bootstrap variables must be set or imported *before* bootstrap.
@import "bootstrap";
my application.js...
//= require jquery
//= require rails-ujs
//= require popper
//= require bootstrap
//= require_tree .
In application.scss, i'm only importing bootstrap. I also removed the bootstrap-sprockets import. Hope this helps.
Thanks @hathcode . It's most likely some order I have missed somewhere but I've already tried different variations to no avail. I'll just have to keep variables commented out for now. In any case thanks for your help.
try import bootstrap/functions before import variables
@import "bootstrap/functions"; @import "bootstrap_variables";
I am seeing the same issue. The docs recommend having the variables imported before bootstrap like
@import "variables";
@import "bootstrap";
But this throws the rails error
$color: 'theme-color("primary")' is not a color for "darken"
This is with a rails new
app on 5.2.2 with ruby 2.6
Edit: Doing @import "bootstrap/functions";
before fixes most problems, but then this crops up:
(en: "Choose file...") isn't a valid CSS value.