英文:
Change LeptonX theme style to Dark mode (or Light mode)
问题
ABP商业版的默认主题是LeptonX主题。LeptonX主题有4种样式:亮色、暗色、昏暗和系统。
我的应用程序使用Angular UI。默认主题样式似乎是系统样式 - 当操作系统设置更改时,它会自动切换为亮色或暗色。
我找不到任何关于如何更改此行为的文档。我想在Angular UI中始终将样式固定为亮色模式。
有人知道如何吗?
英文:
ABP commercial has LeptonX theme as its default theme.
There are 4 styles in LeptonX:
Light, Dark, Dim, and System.
My app has Angular UI. And the default theme style seems to be System - it changes to Light or Dark automatically when the OS settings change.
I cannot find any documentation on how to change this behaviour. I want to fix the style to Light mode always in Angular UI.
Does anyone know how?
答案1
得分: 0
YourProject.Host -> 从System到Light的HttpApiHostModule.cs
答案2
得分: 0
找到解决方案。
-- app.component.ts --
import { ThemeService, StyleNames, lightTheme } from '@volosoft/ngx-lepton-x';
export class AppComponent {
constructor(private themeService: ThemeService) {
if (this.themeService.selectedStyle.styleName != StyleNames.Light) {
this.themeService.setTheme(lightTheme);
}
}
}
英文:
Found the solution.
-- app.component.ts --
import { ThemeService, StyleNames, lightTheme } from '@volosoft/ngx-lepton-x';
export class AppComponent {
constructor(private themeService: ThemeService) {
if (this.themeService.selectedStyle.styleName != StyleNames.Light) {
this.themeService.setTheme(lightTheme);
}
}
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论