【发布时间】:2021-01-30 16:03:20
【问题描述】:
我正在使用 bulma 作为我主页的 CSS 框架。然而,一个插件正在使用 bootstrap 和 bootstrap-editable,所以我正在寻找一种解决方案,如何在不破坏布局的情况下添加 bootstrap.css 和 bootstrap-editable.css。
<html>
<body>
<!-- header designed with bulma -->
<!-- left column menu designed with bulma -->
<div class="column>
<table class="table-responsive">
...
</table>
</div>
<!- footer designed with bulma -->
</body>
</html>
我使用 npm run css-build 通过 node-sass 创建我的 css 文件,如 here 所述。
@charset "utf-8";
// Set your brand colors
$blue: hsl(217, 71%, 53%);
// Update Bulma's global variables
$primary: $blue;
// Import only what you need from Bulma
@import "../node_modules/bulma/sass/utilities/_all.sass";
@import "../node_modules/bulma/sass/base/_all.sass";
@import "../node_modules/bulma/sass/components/_all.sass";
@import "../node_modules/bulma/sass/elements/_all.sass";
@import "../node_modules/bulma/sass/form/_all.sass";
@import "../node_modules/bulma/sass/grid/_all.sass";
@import "../node_modules/bulma/sass/helpers/_all.sass";
@import "../node_modules/bulma/sass/layout/_all.sass";
@import "my.scss";
现在我正在寻找一个解决方案,如何将引导程序中的两个 css 文件应用到 .table-responsive - 类。
我已经尝试过类似的方法,但这不起作用:
.table-responsive {
@import "bootstrap.min.css";
@import "bootstrap-editable.css";
}
在生成的css-file中,有一个class table-responsive,但是class是空的:
.table-responsive { }
你能告诉我,我怎样才能只为一个类导入一个 css 文件?
托马斯
我的 package.json
"scripts": {
"css-build": "node-sass --omit-source-map-url sass/mystyles.scss css/mystyles.css",
"css-watch": "npm run css-build -- --watch",
"start": "npm run css-watch"
}
【问题讨论】: