簡體   English   中英

Angular 中的兩個主題。 SCSS中的變量問題

[英]Two themes in Angular. Problem with variable in SCSS

我嘗試通過這個流程在 Angular 10 中實現兩個主題。 它僅適用於 css。 我在我的項目中使用 SCSS。 如何修改此示例以使用 scss? 抱歉,我這里沒有任何代碼。 您可以在鏈接中找到它的代碼。 感謝幫助!

您需要指定您在項目中使用 SCSS。

您可以像這樣手動更改 angular.json 文件:

"schematics": {
    "@schematics/angular:component": {
        "style": "scss"
    }
},

And then change your files from CSS to SCSS, including the main styles.css referenced in the angular.json.

app.component.css文件更改為app.component.scss並在 app.component.ts 中將styleUrls更改為app.component.scss

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM