Hello Everyone,
In this tutorial, I am implementing a feature to switch between light & dark theme for Blazor WebAssembly application. You are going to need to create CSS files for your themes and then create a JavaScript function to switch between these themes. We can use JavaScript Interop to call JavaScript function from Razor Components.

Source Code - https://github.com/CuriousDrive/BlazingChat
Ed’s EBook - https://www.telerik.com/campaigns/blazor/wp-beginners-guide-ebook

  • 0:00 Approach
  • 3:20 Writing JavaScript function to change themes
  • 5:50 Calling JavaScript function from Razor Component
  • 9:30 Setting the theme on User Login

#webassembly #blazor

Blazor WebAssembly : Dark/Light Theme Switch - EP31
8.20 GEEK