Skip to content

MudRating: Remove the grey block on click and color the ripple#13362

Merged
danielchalmers merged 1 commit into
MudBlazor:devfrom
danielchalmers:claude/rating-ripple-color
Jun 23, 2026
Merged

MudRating: Remove the grey block on click and color the ripple#13362
danielchalmers merged 1 commit into
MudBlazor:devfrom
danielchalmers:claude/rating-ripple-color

Conversation

@danielchalmers

@danielchalmers danielchalmers commented Jun 23, 2026

Copy link
Copy Markdown
Member

Two grey artifacts appear when you click a star:

  1. Whole-block grey. .mud-rating-root:active paints background-color: var(--mud-palette-action-default-hover) over the root. CSS :active matches the activated element and its ancestors, so clicking any star greys the entire group. (It was added in Fix sticky hover effects on mobile #8256 on top of the keyboard-focus rule from Rating: Keyboard Navigation #3399.)
  2. Grey ripple. The per-item ripple has no --mud-ripple-color, so it falls back to --mud-palette-text-primary (grey).

Changes

  • Drop :active from the root background rule; keep :focus-visible as the keyboard focus affordance.
  • Set --mud-ripple-color: currentColor on .mud-rating-item so the ripple matches the star color instead of grey.

Clicking a star no longer greys the whole block, and the ripple takes the star's color rather than grey.

Before

before

After

after

Checklist:

  • I've read the contribution guidelines
  • My code follows the style of this project
  • I've added or updated relevant unit tests (CSS-only change; not observable in bUnit — existing tests pass)

Clicking a star painted a grey background over the entire rating
(`.mud-rating-root:active`, which matches ancestors so any star greyed the
whole block), and the per-item ripple fell back to grey `text-primary`
because no `--mud-ripple-color` was set.

- Drop `:active` from the root background rule (keep the `:focus-visible`
  keyboard affordance).
- Set `--mud-ripple-color: currentColor` so the ripple matches the star color.
@mudbot mudbot Bot added the bug Unexpected behavior or functionality not working as intended label Jun 23, 2026
@danielchalmers danielchalmers merged commit fc467db into MudBlazor:dev Jun 23, 2026
9 checks passed
@danielchalmers danielchalmers deleted the claude/rating-ripple-color branch June 23, 2026 19:25
This was referenced Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unexpected behavior or functionality not working as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant