-
Notifications
You must be signed in to change notification settings - Fork 461
Closed
Labels
status:needs-investigationNeeds additional investigationNeeds additional investigation
Description
🐛 Bug Report
FluentDesignTheme will set document.body.dataset.theme in UpdateBodyDataSetTheme, but loading-theme does not.
💻 Repro or Code Sample
<script src="@Assets["/_content/Microsoft.FluentUI.AspNetCore.Components/js/loading-theme.js"]" type="text/javascript"></script>
<loading-theme storage-name="theme" mode="system" primary-color="#dc7a04"></loading-theme>
<FluentDesignTheme StorageName="theme" @bind-Mode="@_mode"></FluentDesignTheme>
<FluentButton Disabled="@(!RendererInfo.IsInteractive)" Autofocus="false" IconStart="@(new Regular.Size24.Lightbulb().WithColor(Color.Neutral))" aria-label="dark/light" Appearance="Appearance.Outline" OnClick="@OnTheme"></FluentButton> private DesignThemeModes _mode = DesignThemeModes.System;
private void OnTheme()
{
_mode = _mode == DesignThemeModes.Light ? DesignThemeModes.System : DesignThemeModes.Light;
}@media (prefers-color-scheme: dark) {
body:not([data-theme="light"]) {
background-color: pink;
}
}- Show page with system configured for dark: background: pink
- click lightbulb: background white
- refresh page: background pink <-- error
🤔 Expected Behavior
data-theme always set on body.
😯 Current Behavior
FluentDesignTheme sets theme after CHANGE of mode.
🌍 Your Environment
4.11.6
Metadata
Metadata
Assignees
Labels
status:needs-investigationNeeds additional investigationNeeds additional investigation