Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

theme handler可否提供缺省值 #9

Open
zhennann opened this issue Jun 16, 2024 · 0 comments
Open

theme handler可否提供缺省值 #9

zhennann opened this issue Jun 16, 2024 · 0 comments

Comments

@zhennann
Copy link
Contributor

诉求

在每个theme bean中指定具体的handler,过于繁琐,可否提供一个缺省值

@Theme()
export class ThemeDefault extends BeanBase<ScopeModule> implements ThemeBase {
  async apply({ name: _name, dark }: ThemeApplyParams): Promise<ThemeApplyResult> {
    const token: ThemeToken = {
      color: {
        primary: '#1976d2',
      },
      var: {
        borderColor: '#297acc',
      },
      component: {
        page: {
          background: dark ? '#121212' : '#fff',
          color: dark ? '#fff' : '#000',
        },
      },
    };
    return { token, handler: 'a-devui.tool.themeHandler' };
  }
}

关键问题

  • 在哪提供缺省值?
  • 如何兼容所有ui库:antdv、element-plus、quasar、vuetify
  • 如何开箱即用,降低心智负担
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant