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

How to set actual color for dark/white mode? #2772

Open
itsmaty opened this issue Mar 7, 2024 · 5 comments
Open

How to set actual color for dark/white mode? #2772

itsmaty opened this issue Mar 7, 2024 · 5 comments

Comments

@itsmaty
Copy link

itsmaty commented Mar 7, 2024

So you can chnage between dark & white mode, great.
But how to actually set the color for the background/text for certain mode.

So for drakmode the background is HEX #111111
Ho to chnage it to #00000 or any other color?

@dimaMachina
Copy link
Collaborator

Available in v3, use backgroundColor theme option

@itsmaty
Copy link
Author

itsmaty commented Mar 8, 2024

took some time to figure this out but it works thanks

whats a bit confusing and not "expected behaviour" that you have to set the rgb code in a string and cant use the hex code
but as i looked into how this was actually implemented here: #2732
and how the css variable is used in the css is probably a tailwind thing and so wont be able to support hex codes.

@dimaMachina
Copy link
Collaborator

that you have to set the rgb code in a string and cant use the hex code

yes, it was made since configurable backroundColor is used in some places with opacity and using hex requires more configuration and increasing client bundle size

this will be improved in Nextra v4 and using server components

@dimaMachina dimaMachina mentioned this issue Mar 8, 2024
15 tasks
@mmkal
Copy link

mmkal commented Jul 11, 2024

@dimaMachina exciting to hear! Are there instructions for migrating to v3 (or v4?) - I tried manually installing one of the alpha packages but got peer dependency warnings and some errors when running.

@dimaMachina
Copy link
Collaborator

@mmkal https://the-guild.dev/blog/nextra-3

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

3 participants