docs(demo): add a MudBlazor / Fluent UI adapter selector to the top bar (#490) - #491
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #490.
Closes #490.
Executing the implementation plan task-by-task; the checklist below — and the plan on the issue — are
ticked as each task lands. Opened as a draft — will be marked ready after the final task and a
code-review pass.
Plan
AdapterPreferenceserviceWhat shipped
MudBlazor | Fluent UIsegmented control (aria-pressedbuttons in a labelled group) in the top bar. It is persisted inlocalStorage["fc-adapter"]throughwindow.fcAdapter, and every access is intry/catch. A scopedAdapterPreferenceservice shares it app-wide.:root[data-adapter="fluentui"]intokens.cssoverrides all eight accent tokens with Fluent 2's brand ramp (the Spec's starting values, all AA). An inline pre-boot script inindex.htmlsets the attribute, so the first frame is never violet.getting-started.mdwraps Install / Services / References in::: adapter-mudblazor/::: adapter-fluentuicontainers, shown or hidden by CSS.Deviations from the plan
demo.css: the plan asked forcolor-mix(… 25% …), but the original alpha was.3. I used30%, so the MudBlazor rendering doesn't change.Home.razor: each setup step is@key'd on its source, and the page highlights again after an adapter change.code.jsrewrites the<code>it highlights, so without the key Blazor could not update step 2's text. The browser pass caught this: step 2 stayed on MudBlazor.shell.css:.fc-adapter-notegetswidth: 100%, because as a flex item of.fc-shellthe auto margins shrank it off-centre..fc-nav .fc-btn--smgetswhite-space: nowrap, because at 1440 px the added control made "Get started" wrap.Verification
dotnet build -c Release: 0 warnings, 0 errors.dotnet test -c Release: 2150/2150 passed../build.sh Format: succeeded.DemoAdapterThemeTests(12 tests): the Fluent block covers every accent token and the five AC7 pairs are ≥ 4.5:1. The pre-boot script runs beforeblazor.webassembly.js, usestryand only accepts the literal'fluentui'. Getting Started has exactly one closed container per adapter per section, with the real Fluent UI surface.aria-pressed; no horizontal scroll at 390 px. The accessible names stay "MudBlazor" / "Fluent UI" while the visible labels are "Mud" / "Fluent".data-adapterattribute and--fc-violet: #0F6CBDare already set atDOMContentLoaded.dotnet add package FormCraft.ForFluentUI, and step 2 shows the Fluent calls.localStoragethrowing, the page loads in MudBlazor colours and still switches for the session./simplifieddemo still renders MudBlazor components./simplifiedor getting-started under either adapter.