将LeptonX主题样式更改为暗模式(或亮模式)

huangapple go评论75阅读模式
英文:

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

将LeptonX主题样式更改为暗模式(或亮模式)

英文:

YourProject.Host -> HttpApiHostModule.cs from System to Light

将LeptonX主题样式更改为暗模式(或亮模式)

答案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);
    }
  }
}

huangapple
  • 本文由 发表于 2023年8月10日 14:44:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/76873188.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定