Skip to content

[6.x] Hover fill on table rows - #20645

Merged
brandonkelly merged 4 commits into
craftcms:6.xfrom
thupsi:feature/index-row-hover
Nov 13, 2026
Merged

brandonkelly merged 4 commits into
craftcms:6.xfrom
thupsi:feature/index-row-hover

Conversation

@thupsi

@thupsi thupsi commented Nov 12, 2026 •

Copy link
Copy Markdown

Rows in element index tables only change color once they're selected (.cp-table-row.sel > td, --c-color-accent-fill-quiet). Hovering a row shows nothing, so on a wide table it's easy to lose track of which row you're on between the title and a column far to the right.

This gives a hovered, unselected clickable row (.cp-table-row--clickable) a light fill through a new --c-table-row-hover token, next to --c-table-border-color in tokens.css. It's a fainter tint of the accent fill a row gets once it's selected (--c-color-accent-fill-quiet), so hover and selection read as the same color at two strengths:

  • Light theme: the accent fill at 50%.
  • Dark theme: the accent fill at 25%. The dark accent fill is more saturated, and at 50% a hovered row looked almost like a second selection.

Like the selected state, the fill goes on the cells, so it spans the content padding in the first and last cells. It only applies with a real hover (@media (hover: hover)), so a tap on a touch screen doesn't leave a row highlighted. Selected rows keep their own fill.

Light

Before After
Light, before Light, after

Dark

Before After
Dark, before Dark, after

🤖 Generated with Claude Code

https://claude.ai/code/session_01Nc1PhEEDdkm4yces1vwQzV

Clickable data table rows only changed color once selected. A hovered,
unselected row now gets --c-table-row-hover: the details pane surface in the
light theme, and base-100/base-50 mixed half and half in the dark theme,
where the details surface is the panel's own. Only for real hover devices.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nc1PhEEDdkm4yces1vwQzV
@thupsi
thupsi marked this pull request as ready for review November 12, 2026 18:58
@brianjhanson

Copy link
Copy Markdown
Contributor

I'm thinking the hover color should take on the tint of the accent color rather than be neutral since the accent color is what you see once a row is selected. Can you adjust that? Probably maybe just via a color-mix of accent and transparent but I've also toyed with the idea of an even more subtle variant (quieter or hushed or something).

A hovered row now takes a fainter tint of the selected row's accent fill
instead of a neutral surface, so hover and selection read as one family:
--c-color-accent-fill-quiet at 50% in the light theme and 25% in the dark
theme, where that fill is more saturated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nc1PhEEDdkm4yces1vwQzV
@thupsi

thupsi commented Nov 12, 2026

Copy link
Copy Markdown
Author

Done, it's now a tint of --c-color-accent-fill-quiet: 50% in light, 25% in dark, where the accent fill is more saturated and 50% looked almost like a selection. Screenshots in the description are updated.

[ci skip]

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The hover selector overrides child-drop target feedback and omits supported row-header cells, obscuring drag intent and leaving gaps in row highlighting.

2 open issues
What changed in this PR

Adds a subtle hover fill to selectable rows in the shared control-panel DataTable, making wide element index tables easier to follow.

Changes:

  • Applies cell-level hover backgrounds to unselected clickable rows on hover-capable devices.
  • Adds a theme-aware token using 50% of the accent fill in light mode and 25% in dark mode.
File Description
resources/​js/​common/​components/​DataTable.vue Adds the hover rule while excluding selected rows.
packages/​craftcms-ui/​src/​styles/​shared/​tokens.css Defines light- and dark-theme row-hover colors.

Review effort: Balanced

Row headers (`meta.cellTag: 'th'`) have a background of their own, so
painting only `td` cells left them unfilled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brandonkelly
brandonkelly merged commit fc9029b into craftcms:6.x Nov 13, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants