我正在嘗試將我的 sass(使用 @each)編譯成 css。如:Visual Studio Code SASS compiler 中所述,不再支持 ritwick 的原始 LIVE SASS 編譯器。格倫·馬克斯(Glenn Marks)(同名)的新作品浮出水面,聲稱已更新:
https://github.com/glenn2223/vscode-live-sass-compiler/tree/a1b058d5b1e875efe3b1cf424abd43d40a419540
但是,在編譯時,對于這塊 SASS,我得到了:
//color combinations for eachs and mixins
$colors: blood, red, melon, melon2, blue, blue2, blue3, teal, green, green, green, green4, pink, pink2, pink3, orange, orange2, yellow, yellow2, purple, lavender, lilly, brown, gray, gray2, kosmos, soviet, black
@each $color in $colors
&.color-#{$color}
.explanation-sidebar ul li a:before,
.explanation-actions .button
background: $color
以下錯誤:
Compilation Error
Error: Undefined variable.
?
6546 │ &.color-#{$color}
│ ^^^^^^
我見過的唯一其他編譯器(Dart sass)似乎也沒有編譯我的 sass(僅 scss)那么下一個最佳選擇是什么?其他人以前遇到過這種情況嗎?
uj5u.com熱心網友回復:
我通過以下方式修復它:
1.- 禁用所有擴展(dartjs,實時編譯器)
2.- 使用以下方法手動安裝 sass:
npm install -g sass
3.- 僅從 glenn 標記重新激活“實時 sass 編譯器”。
我仍然對為什么這在以前不起作用感到困惑。dartjs 和其他擴展的奇怪行為仍然超出我的理解,但現在,這將不得不做。
希望這會對將來的某人有所幫助。
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/317405.html
