【发布时间】:2021-05-31 14:56:18
【问题描述】:
我想覆盖项目中样式的加载顺序。
我创建了我的样式表style.css,并在其中覆盖了默认值,
body {
font-family: "Lato", sans-serif;
font-size: 14px;
font-weight: 400;
font-style: normal;
line-height: 25px;
position: relative;
visibility: visible;
color: #3d3d3d;
background-color: #FFFFFF;
}
同时在项目中我有bootstrapVue通过插件连接使用,
import Vue from "vue";
import BootstrapVue from "bootstrap-vue";
Vue.use(BootstrapVue);
import "bootstrap/dist/css/bootstrap.css";
import "bootstrap-vue/dist/bootstrap-vue.css";
由于我只使用被覆盖样式的子集,我想使用引导程序中的其余样式。
但是,当我运行该项目时,我发现引导风格是第一位的,而不是我的,
_reboot.scss:
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: #212529;
text-align: left;
background-color: #fff;
}
style.css - disabled (I dont know how to show that the text is crossed out, without loading a picture)
body {
font-family: "Lato", sans-serif;
font-size: 14px;
font-weight: 400;
font-style: normal;
line-height: 25px;
position: relative;
visibility: visible;
color: #3d3d3d;
background-color: #FFFFFF;
}
如果不在 /pages/layout.vue 的 <style> 部分中指定样式,如何更改它?
【问题讨论】:
-
你在哪里导入 style.css?
-
在 nyxt.config.js 中:css:["@/assets/css/style.css"],插件:["@/plugins/bootstrapVue"],
标签: javascript css vue.js bootstrap-vue