TL; DR :要出于主题化目的而使用角度服务切换css文件。
我的解决方案(混乱,不喜欢):
entry: {
"polyfills": "./src/polyfills.ts",
"vendor": "./src/vendor.ts",
"light": "./src/app/theme/theme.light.scss",
"dark": "./src/app/theme/theme.dark.scss",
"app": "./src/main.ts"
},
appConfig: {
themes: ["dark", "light", "blue"],
activeTheme: "dark"
}
themes: [
{name: "dark", src: "dark.dsff5468g.css"},
{name: "light", src: "light.dsff5468g.css"}
]
<head>
标记中删除所有非actualTheme
的主题css文件。我对这种方法的关注:
<head>
删除css文件可能:
<head>
标签?