我有一些Sass代碼只編譯它的一小部分。其餘的部分將被編譯爲無效!我無法弄清楚發生了什麼,爲什麼它不會編譯。請看我的意見,看看它做什麼,不編譯:無法編譯的Sass代碼的第一部分
//wont compile from here down to...
@mixin transition($value) {
transition: $value;
-webkit-transition: $value;
-moz-transition: $value;
-ms-transition: $value;
-o-transition: $value;
}
@mixin transform($value) {
transform: $value;
-webkit-transform: $value;
-moz-transform: $value;
-ms-transform: $value;
-o-transform: $value;
}
@mixin animation($value) {
-webkit-animation: $value;
-moz-animation: $value;
-o-animation: $value;
-ms-animation: $value;
animation: $value;
}
@mixin animation-delay($value) {
-webkit-animation-delay: $value;
-moz-animation-delay: $value;
-o-animation-delay: $value;
-ms-animation-delay: $value;
animation-delay: $value;
}
//Here
//however the below code will compile
@-webkit-keyframes animateMenuItems {
0% { @include transform(translateX(-60%));opacity:0;}
100% { @include transform(translateX(0%));opacity:1;}
}
任何想法,我哪裏出錯了?
編輯
這裏是它應該對文件進行編譯:
.App {
.app-content-wrap {
background:white;
@include transition(all 0.2s ease-out);
float: left;
width: 100%;
-webkit-box-shadow: -2px -1px 14px -1px rgba(0,0,0,0.18);
-moz-box-shadow: -2px -1px 14px -1px rgba(0,0,0,0.18);
box-shadow: -2px -1px 14px -1px rgba(0,0,0,0.18);
}
&.sidenavActive {
.app-content-wrap {
transform: translate(300px,50px);
-webkit-transform: translate(300px,50px);
opacity:0.8;
}
}
}
我使用的WebPack和我越來越控制檯中的錯誤是這樣的:
「no mixin named transition \ n \ n Backtrace:\ n \ tsrc/css/app-containers.scss:4」,
你檢查了你調用這些mixins的地方嗎? –
是的,所以這是編譯錯誤發生的地方,我已更新我的問題與錯誤和它發生在 –