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 Customization: Dark mode using css custom properties: #8475

Open
abdullah-mjawaz opened this issue Apr 2, 2024 · 0 comments
Open

Theme Customization: Dark mode using css custom properties: #8475

abdullah-mjawaz opened this issue Apr 2, 2024 · 0 comments

Comments

@abdullah-mjawaz
Copy link

abdullah-mjawaz commented Apr 2, 2024

What problem does this feature solve?

Utilizing CSS custom properties provides a more easy approach for theming ant components and addresses the issue of flickering that may occur when loading or refreshing a page using dynamic theme switching.

Expected outcomes include:

  • Switch to dark/default theme via CSS custom properties by applying either the .dark/.default CSS class to the root element,
  • utilizing the color palette through var(--ant-prefix-primary-1) across the application without reliance on LESS variable.

What does the proposed API look like?

Transferring all color operation functions such as fading and darkening from component-specific style files (e.g., table/style/index.less) to the root theme files like dark.less and variable.less would address this problem.
I'm having a similar issue: #3611

I can't override these less variables since they're used as parameters to less color operation functions.

  • @disabled-color: fade(@white, 30%);
  • @btn-text-hover-bg: rgba(255, 255, 255, 0.03);
  • @border-color-split: #303030;
  • @text-color-secondary: fade(@white, 45%);
  • @disabled-color: fade(@white, 30%);

note: I'm using dark theme values for these variables.

prof of concept:
angular-ng-zorro-css-theme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant