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 using InteractiveAuto #3792

Open
manuelelucchi opened this issue Apr 9, 2024 · 4 comments
Open

Theme using InteractiveAuto #3792

manuelelucchi opened this issue Apr 9, 2024 · 4 comments

Comments

@manuelelucchi
Copy link
Contributor

Hi,
I'm experimenting with Ant and InteractiveAuto in the .NET 8 Blazor WebApp. Everything seems to work fine and fast, but I noticed that if I set the Dark Theme with the ConfigProvider (let's say it's fixed as dark), it first loads the white theme (supposedly the SSR?) and then switches to dark. This is not great to see. Is there a way to anticipate the theme loading while it's doing the SSR part?

@ElderJames
Copy link
Member

Hi @manuelelucchi , this is a common problem of SSR, that is, the corresponding theme needs to be output in the SSR stage. AntBlazor is not currently supported. You can try using JS to fix the theme. Just load different files.

  • dark:
_content/AntDesign/css/antd-design-blazor.dark.css
  • default:
_content/AntDesign/css/antd-design-blazor.css

@manuelelucchi
Copy link
Contributor Author

Makes sense, thank you. Can i use the same concept for the primary color? This is more of broader question, but since we don't have the css variables yet

@ElderJames
Copy link
Member

ElderJames commented Apr 10, 2024

We have css variables, _content/AntDesign/css/antd-design-blazor.variable.css

@manuelelucchi
Copy link
Contributor Author

Oh, is there an example somewhere? It's really an obscure topic

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

2 participants