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

Dark theme with CSS variables #8837

Open
Sina7312 opened this issue Oct 15, 2024 · 0 comments
Open

Dark theme with CSS variables #8837

Sina7312 opened this issue Oct 15, 2024 · 0 comments

Comments

@Sina7312
Copy link

What problem does this feature solve?

Right now, there is a developer preview for CSS variables. I wanted to use them in my project because it is completely based on CSS variables. But the problem is I can't figure out how to implement dark theme with CSS variables. It seems the provided CSS variables are only for predefined colors, not backgrounds, borders, etc. So it would be great if we have a way to implement dark theme with CSS variables.

What does the proposed API look like?

I think there are two ways we can approach this.

  1. We can have another theme file for dark variables like the default one. e.g. ng-zorro-antd.variable-dark.css
    So we can use it conditionally in our styles.

  2. We can have variables for all parts of the theme like backgrounds, borders, etc. So we can change every color with CSS variables. Something like what Ionic do:
    https://ionicframework.com/docs/theming/dark-mode

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

2 participants