Skip to content

MudGlobal: Remove deprecated theming properties#12141

Merged
danielchalmers merged 2 commits intodevfrom
copilot/remove-deprecated-themes-properties
Nov 23, 2025
Merged

MudGlobal: Remove deprecated theming properties#12141
danielchalmers merged 2 commits intodevfrom
copilot/remove-deprecated-themes-properties

Conversation

Copy link
Contributor

Copilot AI commented Nov 23, 2025

Completes removal of theming/appearance properties from MudGlobal that were deprecated in #11415. These experimental properties created maintenance burden, encouraged unpredictable component behavior, and blurred the boundary between behavioral and visual concerns.

Removed from MudGlobal:

  • ButtonDefaults.Color, ButtonDefaults.Variant
  • InputDefaults.ShrinkLabel, InputDefaults.Variant, InputDefaults.Margin
  • LinkDefaults.Color, LinkDefaults.Typo, LinkDefaults.Underline
  • GridDefaults.Spacing, StackDefaults.Spacing
  • PopoverDefaults.Elevation
  • Static Rounded property

Component updates:
All affected components now use hard-coded defaults matching the previous MudGlobal default values:

// Before
public Color Color { get; set; } = MudGlobal.ButtonDefaults.Color;

// After
public Color Color { get; set; } = Color.Default;

Retained non-theming properties:

  • DialogDefaults.DefaultFocus
  • MenuDefaults.HoverDelay
  • PopoverDefaults.ModalOverlay
  • TooltipDefaults.Delay/Duration
  • TransitionDefaults.Delay/Duration
  • UnhandledExceptionHandler

Migration:
Users relying on global theming should migrate to explicit component parameters, theme tokens, or wrapper components.

Checklist:

  • I've read the contribution guidelines
  • My code follows the style of this project
  • I've added or updated relevant unit tests
Original prompt

This section details on the original issue you should resolve

<issue_title>v9: Remove deprecated MudGlobal theming properties</issue_title>
<issue_description>Follow-up to: #11415

Summary

Complete the removal of theming-style properties exposed via MudGlobal (e.g., Rounded, Square, Color, Variant, Margin, etc.) that were deprecated in #11415. Ship their final removal in v9.0.0 after carrying deprecation notices in the last v8 minors.

This issue proposes the scope, rationale, migration plan, and release timeline.


Why this is necessary

  1. Maintainability & surface area

    • MudGlobal accrued parameter mirrors for many components. Keeping global counterparts in sync with component parameters multiplies API surface and review burden across new components and changes.
  2. Bug prevention

  3. Design intent & predictability

    • Material’s guidance favors situational variants per component/purpose. Wide, app-level defaults make component appearances less predictable and harder to reason about in complex UIs.
  4. Clear responsibility boundaries

    • Behavioral/back-end flags can live centrally; visual appearance belongs in component parameters, theming tokens, and CSS. Mixing them in MudGlobal led to awkward logic and #pragma noise across the codebase.
  5. Performance & code noise

    • The “read-from-global-or-parameter” branches show up across many hot paths. Removing them simplifies rendering and drops warning suppressions/obsolete plumbing sprinkled throughout files.
  6. Expectation setting


Scope

  • Remove all theming / appearance properties from MudGlobal and associated indirections:

    • Examples (not exhaustive): Rounded, Square, default Color, default Variant, default Margin, etc.
  • Delete any code paths that read these properties or “default to MudGlobal if unset”.

  • Remove #pragma and [Obsolete] scaffolding introduced by MudGlobal: Deprecate theming properties #11415.

  • Keep non-theming/behavioral globals (if any) that don’t govern visual appearance (to be enumerated below).

Deliverable: a checklist enumerating each removed property & component touch points (see Acceptance Criteria).


Replacement guidance (migration)

1) Prefer component parameters where appropriate

<!-- Before -->
<MudTextField Label="Email" />

<!-- After (explicit, discoverable) -->
<MudTextField Label="Email" Variant="Outlined" Margin="Dense" />

2) Use the theme system for shared styling

  • Encode defaults via theme tokens (colors/typography/shape) and CSS for cross-cutting polish.
  • When many instances must share the same look, wrap with small app-specific components:
@* AppTextField.razor *@
<MudTextField Variant="Outlined" Margin="Dense" Class="app-input @Class" @attributes="AdditionalAttributes" />

@code {
    [Parameter] public string? Class { get; set; }
    [Parameter(CaptureUnmatchedValues = true)] public IDictionary<string, object>? AdditionalAttributes { get; set; }
}

Release timeline

  • v8.13 / v8.14 (already discussed on the PR): Ship deprecation notices so consumers get compile-time warnings with clear messages and upgrade links.
  • v9.0.0: Remove the properties and all bridging code.

Rationale: keeps v8 minors warning-only, gives users one full minor cycle to migrate, and lets v9 drop the obsolete scaffolding.
</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Remove deprecated MudGlobal theming properties Remove deprecated MudGlobal theming properties Nov 23, 2025
Copilot AI requested a review from danielchalmers November 23, 2025 15:53
@danielchalmers danielchalmers marked this pull request as ready for review November 23, 2025 16:01
@mudbot mudbot bot added breaking change This change will require consumer code updates refactor Reorganizes code and has no changes to the API or functionality in the main library labels Nov 23, 2025
@danielchalmers danielchalmers changed the title Remove deprecated MudGlobal theming properties MudGlobal: Remove deprecated theming properties Nov 23, 2025
@danielchalmers danielchalmers merged commit b329b41 into dev Nov 23, 2025
6 of 9 checks passed
@ScarletKuro ScarletKuro deleted the copilot/remove-deprecated-themes-properties branch November 23, 2025 17:21
@ScarletKuro ScarletKuro mentioned this pull request Feb 11, 2026
9 tasks
This was referenced Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change This change will require consumer code updates refactor Reorganizes code and has no changes to the API or functionality in the main library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v9: Remove deprecated MudGlobal theming properties

2 participants