Skip to content
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

Remove unused Color.Surface #8889

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

danielchalmers
Copy link
Contributor

Description

I believe the Color enum member Surface (not the palette color) should not exist because:

  • I could not find it in any styles except the AvatarGroup which has been changed to use it by default.
  • It's misleading/obsolete because it would act the same as Color.Default (try it on a MudButton for example).

Maybe I have missed something fundamentally useful about it.

How Has This Been Tested?

visually

Type of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (fix or improvement to the website or code docs)

Checklist

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

@danielchalmers
Copy link
Contributor Author

I tried to use this color in the button expecting to see the Surface style from the color palette

image

but instead saw the same style as the default button because the color loops don't include surface:

@each $color in $mud-palette-colors {
&.mud-button-filled-#{$color} {
color: var(--mud-palette-#{$color}-text);
--mud-ripple-color: var(--mud-palette-#{$color}-text);
background-color: var(--mud-palette-#{$color});
@media(hover: hover) and (pointer: fine) {
&:hover, &:focus {
background-color: var(--mud-palette-#{$color}-darken);
}
}
&:focus-visible, &:active {
background-color: var(--mud-palette-#{$color}-darken);
}
}
}
}

as it is not defined in mud-palette-colors:

$mud-palette-colors: primary, secondary, tertiary, info, success, warning, error, dark;

nor does it have text, darken, hover, etc

/// <summary>
/// Gets or sets the surface color.
/// </summary>
public virtual MudColor Surface { get; set; } = Colors.Shades.White;

Copy link

codecov bot commented May 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.19%. Comparing base (28bc599) to head (3557366).
Report is 152 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #8889      +/-   ##
==========================================
+ Coverage   89.82%   90.19%   +0.36%     
==========================================
  Files         412      423      +11     
  Lines       11878    12274     +396     
  Branches     2364     2407      +43     
==========================================
+ Hits        10670    11070     +400     
+ Misses        681      669      -12     
- Partials      527      535       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@danielchalmers danielchalmers changed the title Remove obsolete Color.Surface Remove unused Color.Surface May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

2 participants