microsoft / dotnet-podcasts

.NET reference application shown at .NET Conf featuring ASP.NET Core, Blazor, .NET MAUI, Microservices, Orleans, Playwright, and more!
https://dot.net
MIT License
2.75k stars 745 forks source link

Theme always dark after page refresh #216

Open mrlife opened 1 year ago

mrlife commented 1 year ago

After turning off Dark Theme in the Settings page and refreshing the page via the browser, data-theme="Dark" is always added back to <body>.

I'm looking for a way to manage themes within a Blazor app, and was looking here for an example that doesn't flash the light theme when refreshing the page, for which this app is successful. However, I'm not sure if the reason it is successful is because of the issue in the first paragraph.

trba1810 commented 1 year ago

So i've fixed this issue,it was just some local storage preference stuff.