Skip to content

MudCard: Add ContentPadding property#12446

Merged
danielchalmers merged 7 commits intoMudBlazor:devfrom
91378246:feature/add-gutters-option-to-mud-card
Jan 18, 2026
Merged

MudCard: Add ContentPadding property#12446
danielchalmers merged 7 commits intoMudBlazor:devfrom
91378246:feature/add-gutters-option-to-mud-card

Conversation

@91378246
Copy link
Contributor

@91378246 91378246 commented Jan 14, 2026

This PR adds a ContentPadding property to MudCard, which MudCardContent and MudCardActions use to be able to disable the inner padding of these components.

@mudbot mudbot bot changed the title Add InnerPadding flag to MudCardContent and MudCardActions MudCard: Add InnerPadding flag to MudCardContent and MudCardActions Jan 14, 2026
@mudbot mudbot bot added the enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library label Jan 14, 2026
@Anu6is
Copy link
Contributor

Anu6is commented Jan 14, 2026

I'd rename to Gutters to be consistent with other components

@danielchalmers
Copy link
Member

I'd rename to Gutters to be consistent with other components

And I think adding this to the MudCard and letting all the children use that CSS class could be more elegant (instead of needing to set this flag on all the subcomponents individually)

@mudbot mudbot bot added the needs: changes A maintainer has asked for further modifications to be made to this pull request label Jan 15, 2026
@91378246
Copy link
Contributor Author

@Anu6is I initially also wanted to name it Gutters but it doesn't really fit in with the other components using Gutters; All of those use only horizontal padding. Therefore I took InnerPadding from MudField which also applies padding on all sides.

/// </remarks>
[Parameter]
[Category(CategoryTypes.Card.Appearance)]
public bool ContentPadding { get; set; } = true;
Copy link
Member

@danielchalmers danielchalmers Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@henon Is ContentPadding the right name for this? Or Gutters etc

@91378246
Copy link
Contributor Author

@ScarletKuro DebouncedTextFieldFormatChangeRerenderTest just randomly failed:

Failed DebouncedTextFieldFormatChangeRerenderTest [2 s]
  Error Message:
   Expected textField.ReadText to be the same string, but they differ at index 0:
   ↓ (actual)
  "12/07/2023aaaaaaaa"
  "01/01/0001"
   ↑ (expected).
  Stack Trace:
     at AwesomeAssertions.Execution.LateBoundTestFramework.Throw(String message)
   at AwesomeAssertions.Primitives.StringAssertions`1.Be(String expected, String because, Object[] becauseArgs)
   at MudBlazor.UnitTests.Components.TextFieldTests.DebouncedTextFieldFormatChangeRerenderTest() in /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.UnitTests/Components/TextFieldTests.cs:line 1129
   at NUnit.Framework.Internal.Commands.TestMethodCommand.Execute(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.DelegatingTestCommand.RunTestMethodInThreadAbortSafeZone(TestExecutionContext context, Action action)

@danielchalmers danielchalmers requested a review from henon January 16, 2026 17:26
@danielchalmers danielchalmers removed the needs: changes A maintainer has asked for further modifications to be made to this pull request label Jan 16, 2026
@danielchalmers danielchalmers changed the title MudCard: Add InnerPadding flag to MudCardContent and MudCardActions MudCard: Add ContentPadding property Jan 18, 2026
@danielchalmers danielchalmers merged commit 33a6e9d into MudBlazor:dev Jan 18, 2026
1 check passed
@danielchalmers
Copy link
Member

Thank you!

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

enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants