我正在尝试为 bootsrap 定制编译一个简单的 SCSS 文件。按照一些指导方针,我导入了原始的 bootrap SCSS 并添加了一些更改。编译器是“Web 编译器”,一个 Visual Studio 扩展。这是用作源的 SCSS 文件:
$primary: #07689F;
$secondary: #c0dae9;
$success: #0ed663;
$info: #A2D5F2;
$warning: #ffd166;
$danger: #f1293e;
$light: #e0e0e0;
$dark: #4e4e4e;
@import "../lib/bootstrap/scss/bootstrap";
body {
font-family: Poppins;
}
h1, h2, h3, h4, h5, h6 {
margin-left: 15px;
margin-right: 15px;
}
p {
margin-bottom: 0;
margin-left: 15px;
margin-right: 15px;
}
我在最终结果中看到的是,我的指令没有在原始引导 SCSS 文件声明中实现,结果在 CSS 中被覆盖。相反,它们只是作为额外指令添加到文件末尾。
这是 CSS 结果:
/*!
* Bootstrap v4.3.1 (https://getbootstrap.com/)
* Copyright 2011-2019 The Bootstrap Authors
* Copyright 2011-2019 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
:root {
--blue: #007bff;
--indigo: #6610f2;
--purple: #6f42c1;
--pink: #e83e8c;
--red: #dc3545;
--orange: #fd7e14;
--yellow: #ffc107;
--green: #28a745;
--teal: #20c997;
--cyan: #17a2b8;
--white: #fff;
--gray: #6c757d;
--gray-dark: #343a40;
--primary: #07689F;
--secondary: #c0dae9;
--success: #0ed663;
--info: #A2D5F2;
--warning: #ffd166;
--danger: #f1293e;
--light: #e0e0e0;
--dark: #4e4e4e;
--breakpoint-xs: 0;
--breakpoint-sm: 576px;
--breakpoint-md: 768px;
--breakpoint-lg: 992px;
--breakpoint-xl: 1200px;
--font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
//[... other things ...]
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto 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; }
[tabindex="-1"]:focus {
outline: 0 !important; }
hr {
box-sizing: content-box;
height: 0;
overflow: visible; }
h1, h2, h3, h4, h5, h6 {
margin-top: 0;
margin-bottom: 0.5rem; }
p {
margin-top: 0;
margin-bottom: 1rem; }
//[...then, at the end of CSS file...]
body {
font-family: Poppins; }
h1, h2, h3, h4, h5, h6 {
margin-left: 15px;
margin-right: 15px; }
p {
margin-bottom: 0;
margin-left: 15px;
margin-right: 15px; }
我不太喜欢这个,我希望看到这两个东西融合在一起。有没有办法得到它?提前致谢。