MudBlazor / MudBlazor

Blazor Component Library based on Material design with an emphasis on ease of use. Mainly written in C# with Javascript kept to a bare minimum it empowers .NET developers to easily debug it if needed.
http://mudblazor.com
MIT License
7.25k stars 1.18k forks source link

Components: Normalize sizing #8884

Open danielchalmers opened 1 week ago

danielchalmers commented 1 week ago

Is your feature request related to a problem?

Dimensions are not always consistent between components and some use fractional pixels by default.

MudButton 100% scaling is not pixel perfect which can cause aliasing issues.

Describe the solution you'd like

We keep in mind our ultimate goal of using relative scaling units while defining integer pixel sizes at 100% scaling.

MudButton and ToggleGroup sizes should be staked together. Current (px - small, medium, large):

New (px - small, medium, large):

These new sizes are 175%, 225%, and 275% of the default root font size of 16px. A default M2 button is exactly 36px tall. We should compare all to Material Design.

Which other components should be taken care of in this pass? (sizes taken from measuring the docs):

Important things to consider:

Have you seen this feature anywhere else?

https://m2.material.io/components https://m2.material.io/components/buttons#specs https://m2.material.io/components/snackbars#specs

Describe alternatives you've considered

No response

Pull Request

Code of Conduct

danielchalmers commented 1 week ago

The sizes in the ToggleGroup were changed in #8676 and @henon suggested staking them to the Button sizes for consistency. I said we should explore changing both to a new standard to improve the quality. This issue was opened to let us discuss this idea in a wider context. We need to at least make a decision on the Button and ToggleGroup sizes before v7 is released.

cc @Garderoben @mckaragoz @ScarletKuro @Mr-Technician

henon commented 1 week ago

I am all for standardization of sizes. Currently the elements feel like a zoo if you align them next to each other ;).

Off-Topic: Maybe in the process we could aslo finally center the button text vertically. Currently it is slightly off-center (due to the font underline??) which is funny as the button caption is all capitalized. And even if it weren't, it would still look better were it perfectly centered.

danielchalmers commented 4 days ago

@henon Just to confirm, if the density changes then the dimensions will change with it? Ex: Button 36px, Button Low Margin 34px #8946

henon commented 4 days ago

Yes of course the component dimensions will have to shrink accordingly