fluentui-blazor icon indicating copy to clipboard operation
fluentui-blazor copied to clipboard

I got an issue with the theming on the Blazor Hybrid template.

Open mondermurshed opened this issue 1 year ago • 3 comments

🐛 Bug Report

Theme is not working great as it should in Blazor Hybrid app but works great with Blazor standalone app.

I am using the template that you guys provided but my theme (the dark mode the most) is broken on Blazor Hybrid. Please see these two screenshots of my running app.

Image Image

I did the same exact thing on both Blazor Hybrid and the Standalone app projects but some how the Blazor Standalone app works great but the hybrid not.

Here is the simple code i tested on:

@page "/"
@using AIPlatform2.Shared.Services
@inject IFormFactor FormFactor

<PageTitle>Home</PageTitle>

<h1>Hello, world!</h1>

Welcome to your new Fluent app running on <em>@factor</em> using <em>@platform</em>.


<FluentDesignTheme @bind-Mode="@Mode" />
<FluentSelect Label="Theme"
              Width="250px"
              Items="@(Enum.GetValues<DesignThemeModes>())"
              @bind-SelectedOption="@Mode" />
@code {
    public DesignThemeModes Mode { get; set; }
    private string factor => FormFactor.GetFormFactor();
    private string platform => FormFactor.GetPlatform();
}

I apologize if I did anything wrong.

mondermurshed avatar Nov 23 '25 13:11 mondermurshed

Hi,

We can only work on issue that come with ready to run reproduction code. Standard reply follows:

Please supply us with ready-to-run reproduction code in the form of something we can copy/paste, a (zipped) project structure or a GitHub repository.

We do not have capacity to craft or compose a reproduction for every issue that gets raised.

If no code or repository is provided, this issue will be closed in 3 days

Help us to help you. Thanks.

vnbaaij avatar Nov 23 '25 22:11 vnbaaij

Hey vnbaaij!

Sorry for making things difficult for you and i appreciate you editing my opened issue.

Here is a ready-to-run minimal reproduction: https://github.com/mondermurshed/Test.git

1-Please clone this repo 2-Read the README.md file 3-Run the solution file (MauiApp2.slnx) using visual studio 2026. 4-Run the Hybrid app and observe broken dark theme

mondermurshed avatar Nov 24 '25 05:11 mondermurshed

Ok, small simple issue...

When pressing F12 when running the program, I could see in the DevTools that the reboot script could not be loaded (not found). To fix: in the app.css file in MauiApp2.Shared\wwwroot folder, you need to add a '/' at the start of the reboot import statement like this:

@import '/_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css';

Et voila:

Image

vnbaaij avatar Nov 24 '25 09:11 vnbaaij