-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
MudGlobal: Remove low impact properties #10516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@jperson2000 This may impact your API feature - apologies for the reversal! Also I changed comments if you could take a look and would that be the reason ApiMemberTable_RenderGlobals_WhenExisting no longer passes? |
| /// Defaults to <c>false</c>. | ||
| /// </remarks> | ||
| [Parameter] | ||
| public bool Dense { get; set; } = MudGlobal.DataGridDefaults.Dense; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a global dense might make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wouldn't be complete without also affecting the spacing and margin properties, that would be my concern
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably needs a ground-up overhaul, see: #8946
|
Makes sense. |
|
Why remove global button size? |
Hi Daniel! I'm out for the holidays but can take a look at this on the 26th. I think this test just has to be changed to point to any existing MudGlobal property, so it can test that ApiMemberTable works. Any property is fine. |
|
Friendly reminder @jperson2000 :) |
|
I just stumbled over this PR and wonder why some May I ask for the reason why trimming down the amount of the MudGlobals is preferred? Personally, I am in favour of the changes proposed in #10378, which would provide greater flexibility if I am not mistaken. |
|
@michaelhofer-slg There are certainly some globals which are unnecessary because it is easy enough to set their value on the component directly, i.e. some of the DataGridDefaults. MudDataGrid usage is surely not comparable to MudButton which is used much more frequently and thus the impact of global default values is much higher. We want to get rid of the low-impact defaults to keep the globals manageable as a whole. That being said, we'll listen to the community. Please let us know which properties you have to set over and over (and not just a couple of times per application!) which should not be removed. |
|
Those will be done in follow up PRs. |
|
Removing button size was a mistake, I didn't pay attention. |
|
I did ask about https://github.com/MudBlazor/MudBlazor/pull/10516#issuecomment-2560358907. Think my comment got buried though. I didn't revisit this PR after that, should have followed up. |
|
Maybe my PR wasn't so bad after all... |
|
If I understand correctly @danielchalmers wanted the button size to be somehow automatic similar to what he implemneted with menu icon size but I think we still need individually controlled sizing even if there is some automatism regarding the button's size and in that regard having it in the globals makes sense (it would override automatic button size). |
I think it was cancelled in the end #10627 (comment) as it's now always medium |
|
Why Button.Size and not Switch.Size, Slider.Size, Avatar.Size etc? Would it apply to IconButton, ButtonGroup, ToggleGroup? |
I don't remember automatic button sizing, might have been a misunderstanding.
Correct, I realized Material Design went this way |
|
Sorry, I think I mixed up |
Oh right. Now I see what you mean. Would it be stupid to set |
Something that applies a density to the whole application (regardless of component) would be better but takes a lot of work to implement #8946 |
But all the components you listed are niche, while button is not. Button is widely used in other components as well, like the DataGrid and you can't replace many things with own RenderFragment or apply individual settings. |
|
I've just been caught out by this PR when upgrading to v8. A lot of the globals that we were relying on to reduce noise in our markup have now vanished and I don't see any mention of an alternative in the migration guide or this PR. I'm now faced with the prospect of going through my codebase and adding in properties that were previously being default. I do feel like if you wanted I hope your mind is not made up about this feature. In our experience, we found it very useful to be set global defaults for all components and were looking forward to #10378. It helped us lessen the pressure to write custom code to get a site-wide feel locked down. |
|
@ssttgg what are some of the common globals you used? |
|
After discussing with our team, we are open to preparing Pull Request #10378 again to make it suitable for merging. However, we would need assurance that the changes will be utilized before proceeding. We are happy to adjust the properties and remove any that are not desired. To ensure alignment, we suggest discussing which properties should not be included before moving forward. Please let us know your thoughts! We need the properties that I added in the PR #10378. |
All of them realy, but in particular missing the globals removed on MudCard, MudPaper and MudDataGrid (elevation, outlined etc.) as we have a lot of those on the site. |
We have hundreds of buttons and the majority of them are Small while only a few are Medium or Large. It was nice to have removed the noise of Size=Small from hundreds of buttons. Would prefer to see that one global have stayed as is, the rest are lesser impact. |
|
Hi, thanks for the feedback! Please create a new issue proposal or discussion with specific additions in mind so we can discuss specifics. Note: We will favor a low number of properties (that cascade to multiple different components) over 1:1 property mapping. That said we are always open to ideas. Overriding CSS is sometimes the most effective way of providing consistent styles in your app, but it's perfectly understandable if C# is preferred. |



Description
See #10378 (comment)
*DefaultsclassesWe need to focus on fundamental components and layouts instead of high level ones like DataGrid.
How Has This Been Tested?
Type of Changes
Checklist
dev).