microsoft / fluentui-blazor

Microsoft Fluent UI Blazor components library. For use with ASP.NET Core Blazor applications
https://www.fluentui-blazor.net
MIT License
3.77k stars 363 forks source link

fix: Initial theme breaks after update to v4.9.0 #2349

Closed bpsc-wkubis closed 3 months ago

bpsc-wkubis commented 3 months ago

🐛 Bug Report

I bumped my app to v.4.9.0 and now my theme's acting weird. I'm using theme.js to set up my default theme (accent color, density, etc.), same as Aspire project. But here's the thing: when my app loads, my custom styles show up for a sec and then they get replaced by the default styles. I found that this behavior was introduced by https://github.com/microsoft/fluentui-blazor/commit/544a9c4fb7ba5363794b9ed6e7c45e6fca0745e6, so when i use any of design tokens it's importing new file with suffix 4.9.0 which i overwriting theme.

💻 Repro or Code Sample

https://github.com/bpsc-wkubis/fluentui-v4.9.0-breaks-theme

🤔 Expected Behavior

Default theme is applied and not overwritten when using any of DesignTokens

😯 Current Behavior

Default theme is overwritten when using any of DesignTokens, in repro i used Density.

💁 Possible Solution

🔦 Context

Set default theme for app

🌍 Your Environment

liaan-mynhardt commented 3 months ago

I was just researching this same issue, as soon as you use design tokens it changes the theme back to defaults

vnbaaij commented 3 months ago

I'm undoing the add suffix for the next release (4.9.1).

vnbaaij commented 3 months ago

Confirmed this is fixed with reverting add of suffix. Will be in 4.9.1