And*_*rew 5 ruby ruby-on-rails sass twitter-bootstrap webpack
我正在使用 Webpacker 在 Rails 6 应用程序中实现 Bootstrap 4.4,并且主题在生产中不起作用。
我覆盖了一些 Bootstrap 变量并将自定义主题放在一个名为bootstrap_variables.scss. 我确保functions在app/assets/stylesheets/application.scss文件中的自定义变量之前导入 Bootstrap ,如此处和此处所述。
@import "bootstrap/scss/functions";
@import "bootstrap_variables";
@import "bootstrap/scss/bootstrap";
Run Code Online (Sandbox Code Playgroud)
当我在本地运行应用程序时,它工作正常。当我尝试推送到生产 (Heroku) 时,构建失败并出现以下错误:
SassC::SyntaxError: Error: argument `$color` of `darken($color, $amount)` must be a color
on line 181:43 of app/assets/stylesheets/bootstrap_variables.scss, in function `darken`
from line 181:43 of app/assets/stylesheets/bootstrap_variables.scss
$link-hover-color: darken($link-color, 15%) !default;
Run Code Online (Sandbox Code Playgroud)
这引用了自定义bootstrap_variables.scss文件中的以下几行:
$link-color: theme-color("primary") !default;
$link-decoration: none !default;
$link-hover-color: darken($link-color, 15%) !default;
Run Code Online (Sandbox Code Playgroud)
为什么这可能在本地工作但不在生产中?
| 归档时间: |
|
| 查看次数: |
403 次 |
| 最近记录: |