【发布时间】:2020-10-04 01:22:42
【问题描述】:
我在保存文件时遇到了一些问题,即我的 css 没有更新。起初我认为这是 VSCode live sass 编译器的问题,因为只有在我重新启动编译器时才会更新更改,但我刚刚对主 scss 文件进行了更改,并且更改立即显示。
我认为可能是主文件或头文件有问题。
我知道这可能是一个错字或我做错了什么,但这是一个好几天的问题,我无法解决。任何建议将不胜感激。
主文件:
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Roboto", sans-serif;
}
@import "./Header";
头文件:
.header {
height: 8vh;
background-color: #131921;
position: sticky;
top: 0;
z-index: 100;
align-items: center;
display: flex;
color: #fff;
padding: 30px 20px;
background-color: hotpink;
&__logo {
width: 100px;
// object-fit: contain;
margin: 0 20px;
}
&__search {
display: flex;
flex: 1;
align-items: center;
border-radius: 35px;
}
&__searchIcon {
padding: 5px;
height: 36px !important;
width: 36px !important;
background-color: #cd9042;
border-radius: 0 6px 6px 0 !important;
}
&__searchInput {
padding: 10px;
border: none;
width: 100%;
border-radius: 6px 0 0 6px !important;
}
&__nav {
display: flex;
justify-content: space-evenly;
}
&__boxes {
display: flex;
flex-direction: column;
align-items: flex-start;
color: #fff;
margin: 0 10px;
text-transform: capitalize;
text-align: left;
}
&__boxesFirstLine {
font-size: 12px;
line-height: 14px;
font-weight: 400;
color: rgba(255, 255, 255, 0.7);
}
&__boxesSecondLine {
font-size: 14px;
font-weight: 700;
line-height: 15px;
padding-bottom: 5px;
padding-right: 9px;
}
&__basketText {
color: #fff;
font-size: 14px;
line-height: 15px;
font-weight: 700;
padding-bottom: 5px;
padding-right: 9px;
text-transform: capitalize;
}
}
头文件名为 Header.scss。
我不知道在编译器运行时会阻止更新,但如果重新启动它就可以了。我已经询问了扩展开发人员,并在此处专门询问了扩展是否存在问题,但没有任何回应。
【问题讨论】:
标签: css reactjs visual-studio-code sass