【问题标题】:Import react-bootstrap in sass在 sass 中导入 react-bootstrap
【发布时间】:2022-01-05 17:06:33
【问题描述】:

我正在尝试在引导程序中自定义一个反应应用程序。

在 src/custom.scss 中 @import "~bootstrap/scss/bootstrap";

但是,有什么方法可以导入 react-bootstrap

【问题讨论】:

    标签: reactjs sass react-bootstrap bootstrap-5


    【解决方案1】:

    自定义引导 如果您希望自定义 Bootstrap 主题或任何 Bootstrap 变量,您可以创建自定义 Sass 文件: /* 以下块可以包含在 custom.scss 中

    /* make the customizations */
    $theme-colors: (
        "info": tomato,
        "danger": teal
    );
    
    /*import bootstrap to set changes */
    @import "~bootstrap/scss/bootstrap";
    

    ... 并将其导入到 Sass 主文件中。

    /* The following line can be included in a src/App.scss */
    
    @import "custom";
    

    【讨论】:

      猜你喜欢
      • 2019-01-12
      • 2016-01-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-07
      • 2019-06-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多