【问题标题】:Error compiling assets after upgrading bootstrap升级引导程序后编译资产时出错
【发布时间】:2021-09-02 12:23:05
【问题描述】:

我正在尝试升级 Ruby on Rails 应用程序中的引导程序版本。使用纱线从4.0.0-alpha.6 迁移到4.1 后,运行rails assets:precompile 时出现此错误

错误

SassC::SyntaxError: Error: Undefined variable: "$alert-warning-bg".
        on line 32:20 of app/assets/stylesheets/variables/_helpers.scss
        from line 47:9 of app/assets/stylesheets/variables.scss
        from line 9:9 of app/assets/stylesheets/application.scss
        from line 1:9 of app/assets/stylesheets/admin.scss
>>   outline: lighten($alert-warning-bg, 9%);

helper.scss

.highlight {
  outline: lighten($alert-warning-bg, 9%);
}

【问题讨论】:

    标签: ruby-on-rails bootstrap-4 sass bootstrap-ui


    【解决方案1】:

    $alert-warning-bg 已在 4.1 上删除并替换为 theme-color-level($color, $alert-bg-level) mixin(使其干燥?)。用法示例:

    theme-color-level('warning', $alert-bg-level)
    

    或特别针对您的情况:

    lighten(theme-color-level('warning', $alert-bg-level), 9%)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-04-20
      • 1970-01-01
      • 2016-04-25
      • 1970-01-01
      • 2013-10-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多