Skip to content

Design Theme values not persisting in local storage between page navigations #4145

@whibdev

Description

@whibdev

🐛 Bug Report

When following the Design Theme documentation, theme values do not persist in local storage when navigating between pages. Instead, they are replaced with null.

💻 Repro or Code Sample

  1. Create a Blazor project and configure the Design Theme exactly as described in the documentation.
  2. Change the theme values and confirm they are written to local storage.
  3. Navigate to another page.
  4. Inspect local storage — values have been replaced with null.

🤔 Expected Behavior

Theme values should remain stored in local storage and persist across page navigations.

😯 Current Behavior

Local storage values are overwritten with null whenever navigating between pages.

FluentUiThemePersistIssue.mp4

💁 Possible Solution

The only workaround I’ve found is wrapping routes with:

<Routes @rendermode="InteractiveServer" />

This prevents the null values, but it introduces issues with other links in the application (login, register) and ideally, I don't want to have the whole site in that mode.
Is there a better workaround or a planned fix?

🔦 Context

This issue prevents theme customization from persisting across pages, which disrupts the user experience and breaks the intended design consistency.

🌍 Your Environment

Window 10
VisualStudio 17.14.14
Microsoft.FluentUI.AspNetCore.Components 4.12.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs: author feedbackThe author of this issue needs to respond in order for us to continue investigating this issue.needs: repro code or repositoryThe provided description or code is insufficient to repro the issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions