Skip to content

feat(table): migrates remaining table styles to s2 part2 #3818

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

Open
wants to merge 17 commits into
base: spectrum-two
Choose a base branch
from

Conversation

marissahuysentruyt
Copy link
Collaborator

@marissahuysentruyt marissahuysentruyt commented May 21, 2025

Description

This PR is part 2 of the table's migration to S2! Table has been updated to include:

  • new color & typography tokens (in the table Figma token specs, only tokens for Colors & Typography have been addressed)
  • new sparkline cell content type and respective story

NOTE: Tokens for layout and storybook template updates were done in part 1 of the table migration here: #3799

All styles for the full migration should now be addressed with this PR.

Jira/Specs

CSS-1179
Figma token specs- colors and typography token columns only

How and where has this been tested?

Please tag yourself on the tests you've marked complete to confirm the tests have been run by someone other than the author.

Validation steps

Please review the following table styles to ensure the color and typography tokens are used as outlined in the tokens spec Figma file:

  • text colors for column headers
  • text colors for "regular" rows
  • icon colors in "regular" rows
  • sort icon (3) colors in column headers
  • disclosure icon colors in column headers
  • background colors for headers and "regular" rows
  • summary row background color
  • section header background color
  • "regular" row hover and active background colors
    • Table rows are not clickable by default. Javascript is usually added to make them clickable, so the reviewer may have to toggle the active state to verify the table row down state token
  • selected row background color and border
    • Stefan confirmed the 1px blue border goes around all cells in a selected row.
  • selected row hover and down background colors
  • rounded corners on a cell's focus indicator
  • row's side focus indicator
    • The side focus indicator should always appear when a row is focused, regardless of its selection status. Stefan confirmed that the 1px blue border around the other cells in a selected row remains when a row is selected AND focused. For an unselected row that is focused, the default gray borders should render.
  • There's a new "with chart content" story. This demonstrates the 4 variants of the sparkline charts found in the desktop Figma file

Additional validation

  • All test cases are covered
  • I'd love feedback on the approach I took to achieving only 1px between adjacent selected rows, since I'm afraid there may be content shift. That is Stefan's preference (to only have 1px of border between adjacent selected cells). But he understands that's a complex thing to achieve without content shift, so he said that the 2px in between would be acceptable if we really needed it.

Regression testing

Validate:

  1. The documentation pages for at least two other components are still loading, including:
  • The pages render correctly, are accessible, and are responsive.
  1. If components have been modified, VRTs have been run on this branch:
  • VRTs have been run and looked at.
  • Any VRT changes have been accepted (by reviewer and/or PR author), or there are no changes.

Screenshots

To-do list

  • I have read the contribution guidelines.
  • I have updated relevant storybook stories and templates.
  • I have tested these changes in Windows High Contrast mode.
  • If my change impacts other components, I have tested to make sure they don't break.
  • If my change impacts documentation, I have updated the documentation accordingly.
  • ✨ This pull request is ready to merge. ✨

@marissahuysentruyt marissahuysentruyt self-assigned this May 21, 2025
@marissahuysentruyt marissahuysentruyt added size-3 M ~18-30hrs; moderate effort or complexity, several work days needed. wip This is a work in progress, don't judge. skip_vrt Add to a PR to skip running VRT (but still pass the action) S2 Spectrum 2 labels May 21, 2025
Copy link

changeset-bot bot commented May 21, 2025

⚠️ No Changeset found

Latest commit: 7594877

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes changesets to release 1 package
Name Type
@spectrum-css/table Major

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@marissahuysentruyt marissahuysentruyt force-pushed the marissahuysentruyt/css-1178-s2-table-migration-layout-pt1 branch 2 times, most recently from 36920dd to 490a4e9 Compare May 21, 2025 22:18
@marissahuysentruyt marissahuysentruyt force-pushed the marissahuysentruyt/css-1179-s2-table-migration-layout-pt2 branch 2 times, most recently from 57cdc81 to f9f4cd3 Compare May 27, 2025 22:16
@marissahuysentruyt marissahuysentruyt force-pushed the marissahuysentruyt/css-1178-s2-table-migration-layout-pt1 branch from 4b76b0c to 85d324a Compare May 28, 2025 13:54
@marissahuysentruyt marissahuysentruyt force-pushed the marissahuysentruyt/css-1179-s2-table-migration-layout-pt2 branch 2 times, most recently from 58bd149 to 870191b Compare May 29, 2025 19:39
@marissahuysentruyt
Copy link
Collaborator Author

marissahuysentruyt commented May 29, 2025

TODO: (from Stephanie in #3799)

For WHCM - I think there should be a difference between "Focused selected" vs. "Focused unselected" just like there is in regular mode:
#3799 (comment)

EDIT: The focused unselected ONLY has the side focus indicator, while a focused + selected has the side focus indicator AND the background color change. ✅
Screenshot 2025-06-03 at 10 43 50 AM

Possibly need a background color for the table header for "Quiet" styling to prevent this clash on scrollable tables:
#3799 (comment)

EDIT: This was a transparent background color before, but with the updates to the header cell background colors, this should be taken care of. ✅
Screenshot 2025-05-29 at 5 03 05 PM

@marissahuysentruyt marissahuysentruyt force-pushed the marissahuysentruyt/css-1179-s2-table-migration-layout-pt2 branch from 870191b to 73ee64e Compare June 2, 2025 15:43
@marissahuysentruyt marissahuysentruyt force-pushed the marissahuysentruyt/css-1178-s2-table-migration-layout-pt1 branch from b746cdf to 1641315 Compare June 2, 2025 15:48
@marissahuysentruyt marissahuysentruyt marked this pull request as ready for review June 3, 2025 12:10
@marissahuysentruyt marissahuysentruyt force-pushed the marissahuysentruyt/css-1179-s2-table-migration-layout-pt2 branch 2 times, most recently from 41a351d to e8478ca Compare June 3, 2025 14:36
@@ -57,6 +57,8 @@

--spectrum-steplist-current-marker-color-key-focus: var(--spectrum-blue-700);

--spectrum-table-selected-row-background-color-rgb: var(--spectrum-blue-800-rgb);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I noticed in Figma that the color for light and dark modes do vary just a bit.

Copy link
Collaborator

@rise-erpelding rise-erpelding Jun 13, 2025

Choose a reason for hiding this comment

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

Totally missed this last time. We'd need a changeset for the tokens package too then, right?

Comment on lines -705 to -712
&.spectrum-Table--quiet {
border-block-start: none;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Quiet tables still have a border-block-start for the header row.

Comment on lines +595 to +665
&.is-selected {
.spectrum-Table-cell {
/* Remove bottom border by default for all selected rows to conditionally add it back. */
border-block-end: none;
}
}

/* Adding the bottom border only to the last selected row in a sequence achieves 1px border between adjacent selected rows */
&.is-selected:not(:has(+ .is-selected)) .spectrum-Table-cell {
border-block-end: var(--mod-table-border-width, var(--spectrum-table-border-width)) solid var(--highcontrast-table-focus-indicator-color, var(--mod-table-focus-indicator-color, var(--spectrum-table-focus-indicator-color)));
}
Copy link
Collaborator Author

@marissahuysentruyt marissahuysentruyt Jun 3, 2025

Choose a reason for hiding this comment

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

I got some help from Cursor with this, so please review and let me know if there's red flags. I'm particularly concerned with the :not(:has()) situation. In order to test this, you'll have to add the is-selected class to an adjacent row.

Basically, this is the code to produce 1px of blue border, between adjacent selected rows. I noted in the PR description that during my talks with Stefan, he said design's preference is to have only 1px of border between adjacent rows. He did say though that he understands it's quite complicated, and had already discussed the possibility of needing 2px in between adjacent selected rows. Although the 2px isn't ideal, if we decide that's probably the best route long-term, it's acceptable.

What are our thoughts on this approach to achieving the single pixel border between adjacent selected rows? I do believe there would be 1px of content shift, so does that mean we should toss this idea out? I couldn't achieve only 1px between ALL adjacent rows, when some are selected and some are not, so maybe this approach is overkill, since there's 2px borders in between other rows anyways?

I'd love to pair on this with someone if there's more ideas I haven't tried or to explain any of that ☝️ more!

Copy link
Collaborator

Choose a reason for hiding this comment

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

hmm, yea this is always tricky. I am seeing the 1px shift when adding and removing selected state. I also noticed in the mockup it looks like the row is retaining its top borders. Not sure if that was an oversight or if its intentional. But if it is we could probably try using something like box-shadow: inset 0 -1px 0 var(--highcontrast-table-focus-indicator-color, var(--mod-table-focus-indicator-color, var(--spectrum-table-focus-indicator-color))); here instead of the border. Using insets my fix the shifting issue. In the end it might come down to whether or not design is okay with a content shift or the 2px border.
Screenshot 2025-06-06 at 9 40 01 AM

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Stefan recently created a bunch of mock ups for me, and we worked through some of this. None of his examples have the top & bottom border like this. There's some inconsistencies in Figma, so I would guess it is not intentional.

stefan-2
stefan

Let me mess around with the inset and box-shadow thing to see if I can fix the content shift. Stefan also said he was happy to look at the storybook link, so I may take him up on that and ask about this.

@marissahuysentruyt marissahuysentruyt force-pushed the marissahuysentruyt/css-1179-s2-table-migration-layout-pt2 branch from e8478ca to 64338cd Compare June 3, 2025 14:55
@marissahuysentruyt
Copy link
Collaborator Author

TODO: write the changeset (maybe I can add to the part 1 changeset?)

@marissahuysentruyt marissahuysentruyt added ready-for-review and removed wip This is a work in progress, don't judge. labels Jun 3, 2025
@marissahuysentruyt marissahuysentruyt force-pushed the marissahuysentruyt/css-1178-s2-table-migration-layout-pt1 branch from 781d447 to 6cf3b05 Compare June 3, 2025 18:36
@marissahuysentruyt marissahuysentruyt force-pushed the marissahuysentruyt/css-1179-s2-table-migration-layout-pt2 branch from 64338cd to 1462fcf Compare June 4, 2025 13:28
Copy link
Collaborator

@rise-erpelding rise-erpelding left a comment

Choose a reason for hiding this comment

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

This looks great! I did check all the color tokens and they all appear to be matching the spec!

I can see that one down side to breaking the migration up like this is that there are certain things that were updated in the code in the previous PR that I can't comment on inline in GitHub because they weren't updated in this PR, but became more relevant as you were working with colors.

One example is this, about the sort Button:
I believe it was Aziz who pointed out that there were particularly some issues with the button in WHCM, colors that aren't behaving as intended. I notice that the variant of button that we're using is the default one, if I remove all the button passthroughs:
Screenshot 2025-06-09 at 7 37 27 PM

It's honestly probably fine as it is, but we might encounter less friction if the variant of button looked more like the design, for instance with the secondary button:
Screenshot 2025-06-09 at 7 40 22 PM

When I was working on Tag Group earlier, I noticed that the variant of action button was specified in the design (Quiet), which I think I'd probably want to surface in documentation so that consumers know that it would be ideal to use the same variant. Wondering if it's a good idea to do something like that here? It may not be if we're already overriding every style.

Within the testing preview, correct me if I'm wrong, but I don't think I noticed any hover states being tested there. That could be a nice addition.

Also within the realm of things that weren't updated in this PR, I noticed a few oddities when I was glancing through the CSS file:

  • We have a place around L352 where we're transitioning the header row color but I don't think the color of the header row ever changes, so it doesn't seem to make a lot of sense to have a transition here (Cursor agreed with me): transition: color var(--highcontrast-table-transition-duration, var(--mod-table-transition-duration, var(--spectrum-table-transition-duration))) ease-in-out;.
  • There was also a place where --highcontrast-table-transition-duration is set to 0, I think that was from before, but I wasn't able to figure out what that does. It might have a totally valid purpose though!
  • We have a couple of places starting around L906 where there's a comma in the CSS custom property transform: var(--spectrum-logical-rotation,);, I don't think this is hurting anything except my desire for perfect CSS punctuation.

A couple of other questions I had:

  • Are drop targets a variant, similar to collapsible, that aren't explicitly in S2? The borders there are a little funny, but not worth fixing if they're not in the spec. What is the plan for those variants that aren't in S2 but we haven't removed? Did design have an opinion on that?
  • For the scrollable + emphasized table, is the missing left/start side border intentional? I can see how having it there would look imbalanced if the scroll bar is on the other side, and I think it only looks off to me because I see it in comparison to the other variants, it would probably look better on its own not next to non-scrolling variants.
    image

@@ -131,11 +140,17 @@
--mod-button-edge-to-text: var(--spectrum-table-cell-inline-spacing);
--mod-button-padding-label-to-icon: var(--spectrum-table-visual-to-text);
--mod-button-height: var(--spectrum-table-min-header-row-height);
--mod-button-focus-ring-border-radius: var(--spectrum-table-focused-cell-border-radius);
--mod-button-focus-ring-border-radius: calc(var(--mod-table-border-radius, var(--spectrum-table-focused-cell-border-radius)) - var(--mod-table-border-width, var(--spectrum-table-border-width)));
Copy link
Collaborator

Choose a reason for hiding this comment

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

This isn't the ideal place for this comment but:

I'm wondering what your thoughts are about the passthroughs here, I've noticed that if you set --mod-table-header-text-color just as one example, that it doesn't go through to the button.

I know we've been talking about how much longer we'll have mods so I'm always hesitant to make suggestions around them, but what are your thoughts on setting the passthroughs to be something like this?

--mod-button-content-color-default: var(--mod-table-header-text-color, var(--spectrum-table-header-text-color));

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah yeah, that's a really good point. I like this idea!

Copy link
Collaborator

Choose a reason for hiding this comment

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

I noticed there's a PR for the pre release of Table part 1 in #3907, any idea what happens with future releases if that merges before this one is done? I thought it was the changeset file that triggered the release PR, will it still pick up the correct changes if we edit an existing changeset file that's already had a release?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That is an excellent question, and I don't know the answer. Do you think it's safer to just create a new changeset for this work, instead of adding it to the prior one?

Copy link
Collaborator

@rise-erpelding rise-erpelding Jun 13, 2025

Choose a reason for hiding this comment

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

It looks like that release PR merged, so I would do a different changeset? I'm not the clearest on what triggers a release but since I don't know better I'd guess that adding to this older changeset might not.

- updates row colors for header row, summary, section header, and
selected row
- updates sort icon colors
- updates disclosure/menu icons
- fixes checkbox indeterminate icon color
- adds .spectrum-Table-headCell--alignEnd class
- selected rows have a 1px border around all cells in blue
- row focus should be indicated by the side-focus-indicator regardless
of selection state. this means a focused+unselected row will have a 1px
gray border around cells, while a focused+selected row will have a 1px
blue border around cells.
- adjacent selected rows have a 1px border between them in blue (avoids
duplicate borders between cells)
- adds support for CJK languages for line-height
- adds missing font tokens for header and body row text
- remove quiet table cell background colors lines
- there's not really color changes specc'd out for the header table cell
background states, so header table cell background states are removed
- quiet and scroller styles fixed up
- in focused unselected rows, the text color was the same as the
background color. This is now fixed, and should also distinguish the
focused+selected rows from the focused+unselected rows as well.
- adds hasChartContent arg to story file and story
- handles hasChartContent in template markup
- add sparkline svgs
- add sparkline test case
- opts for border on the ::after pesudo element for the button's focus
indicator
- styles the button so it fills the header cell's space
- corrects the icon colors in the head cells
- fixes background colors, text colors, icon colors, interactive states,
and border radius in high contrast mode
- removes duplicate quiet styles
- adds forced-color-adjust: none to avoid flash of orange button text
color in WHCM
@marissahuysentruyt marissahuysentruyt force-pushed the marissahuysentruyt/css-1179-s2-table-migration-layout-pt2 branch from ddc7b29 to 70dcf8c Compare June 10, 2025 22:06
@@ -492,6 +492,31 @@ export const TableGroup = Variants({
isSelected: true,
}
],
},
{
testHeading: "Sparkline charts",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@rise-erpelding I'm plopping this comment here to sort of get it in a closer spot.

You mentioned potentially adding hover states. I feel like we've been trying to get rid of storybook only classes in our selectors, in favor of just using the :focus-visible or :hover. If that's the case, I'm not sure I quite know how to add hover tests to the testing grid without args and is-hovered classes. I absolutely don't mind doing it - I think it's a great idea - but is there a better way than just adding an isHover arg to the template so that it adds an .is-hovered class?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, I think so! Now that I'm looking more closely, I think you can also remove the .is-focused class from the css as well unless there's something I'm missing about needing it?

The way I understand it, the PostCSS config will prefix the pseudo-classes listed there ("focus-visible", "focus-within", "hover", "active", "disabled") with .is- and transform it so that in the dist/index.css anywhere where you've used :focus-visible for example should also have an .is-focus-visible class applied as well.

Then, if you change the template to apply the .is-focus-visible class instead of .is-focused for the isFocused arg, those focus styles would be linked to the control. You could do something with :hover also since that .is-hover class is already being applied?

@@ -322,6 +330,7 @@ export const Template = ({
${when(hasMenu || isSortable, () => html`
${when(isSortable, () => Button({
size: "m",
variant: "secondary",
Copy link
Collaborator Author

@marissahuysentruyt marissahuysentruyt Jun 10, 2025

Choose a reason for hiding this comment

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

@rise-erpelding I don't mind changing this to the secondary button, but I feel like I still needed all of the passthroughs anyways. I think I can remove the --mod-button-height, alongside a min-block-size to help out the funky alignment we were seeing, but that felt like that was all 😞

Do you think I should update the docs to mention the "secondary button?" (the button in general wasn't specified at all in the docs- I'm worried that if anything, it should actually be an action button too 🤷‍♀️ ).

Copy link
Collaborator

Choose a reason for hiding this comment

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

I also wondered if it should be an action button. Let's leave it, because you're right, I think it'll need almost all the same passthroughs anyway.

@@ -299,7 +349,6 @@
background-color: var(--mod-table-header-background-color, var(--spectrum-table-header-background-color));
border-block-start: var(--mod-table-border-width, var(--spectrum-table-border-width)) solid var(--highcontrast-table-border-color, var(--mod-table-border-color, var(--spectrum-table-border-color)));

transition: color var(--highcontrast-table-transition-duration, var(--mod-table-transition-duration, var(--spectrum-table-transition-duration))) ease-in-out;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@rise-erpelding This should address your question about whether we need this- no we shouldn't, since the header cells don't have any transition. This was probably left over from part 1, because I know I had header cell styles like this (I read the token specs wrong) but then removed them. Good catch!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Also, about this --highcontrast-table-transition-duration. I believe this is probably set to 0 so that there's not any animation for it. For instance, when a collapsed row expands, in WHCM it would just pop right open, instead of slide/transform. I can't replicate that behavior though, so it's sort of a guess.

Comment on lines +136 to +139
--mod-button-content-color-default: var(--mod-table-header-text-color, var(--spectrum-table-header-text-color));
--mod-button-content-color-hover: var(--mod-table-header-text-color, var(--spectrum-table-header-text-color));
--mod-button-content-color-focus: var(--mod-table-header-text-color, var(--spectrum-table-header-text-color));
--mod-button-content-color-down: var(--mod-table-header-text-color, var(--spectrum-table-header-text-color));
Copy link
Collaborator Author

@marissahuysentruyt marissahuysentruyt Jun 10, 2025

Choose a reason for hiding this comment

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

@rise-erpelding So far, I only updated these to have the table mods included the the button passthrough definitions. Do you think I should do that for any of the other mods?

From this comment

Copy link
Collaborator

Choose a reason for hiding this comment

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

There are --mods for table-cell-inline-spacing and table-visual-to-text, would you want to use those or is there a specific reason not to?

Comment on lines -828 to -831
transform: var(--spectrum-logical-rotation,);
transform: var(--spectrum-logical-rotation);

&[aria-expanded="true"] {
transform: var(--spectrum-logical-rotation,) rotate(90deg);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

}

.spectrum-Table-row {
&:hover,
.spectrum-Table-scroller {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@rise-erpelding I'm going to plop this comment here too, in response to your scrollable question and the borders. Currently, yes it's intentional that the selected row doesn't have inline borders.

So in the non-scrolling tables, it's the cells themselves that end up creating the entire, outermost border of the table. It's easier to target the inline borders of a selected row. But to get a scrolling table, we add an extra wrapper element around the table and that scroller wrapper is what's actually creating the outermost border of the table instead of the cells. I'm sure I could target the same cells and add inline borders for selected rows in a scrolling table, but that would add extra borders inside of the scroll wrapper borders.

Does that make sense at all? We can pair on this if I didn't explain it super well!

@marissahuysentruyt
Copy link
Collaborator Author

@rise-erpelding

Are drop targets a variant, similar to collapsible, that aren't explicitly in S2? The borders there are a little funny, but not worth fixing if they're not in the spec. What is the plan for those variants that aren't in S2 but we haven't removed? Did design have an opinion on that?

Drop targets are a variant that aren't explicitly in S2, and they are not in the spec. I can make a card to revisit the borders (I think I saw the body dropzone is the funkiest, maybe?). When I was talking with Stefan about the dropzones, he referenced React's drag and drop functionality, and that it is currently "beta." Stefan suggested that we could treat our dropzones the same. Design isn't certain if they will work on dropzone/drag and drop stuff specifically, so they don't have a time frame, but it is something they've explored and want to come back to in the future.

- adds table mods to button passthroughs for fallbacks
- removes transition on header cells
- removes unnecessary commas in some property definitions
@marissahuysentruyt marissahuysentruyt force-pushed the marissahuysentruyt/css-1179-s2-table-migration-layout-pt2 branch from 3360261 to 7594877 Compare June 11, 2025 15:58
".spectrum-Table--spacious",
".spectrum-Table-body",
".spectrum-Table-body .spectrum-Table-row .spectrum-Table-cell:first-child",
".spectrum-Table-body .spectrum-Table-row .spectrum-Table-cell:last-child",
".spectrum-Table-body .spectrum-Table-row:first-child .spectrum-Table-cell",
".spectrum-Table-body .spectrum-Table-row:last-child .spectrum-Table-cell",
".spectrum-Table-body.is-drop-target",
".spectrum-Table-body.is-drop-target .spectrum-Table-headRow",
Copy link
Contributor

Choose a reason for hiding this comment

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

[markdownlint-fix] reported by reviewdog 🐶

Suggested change
".spectrum-Table-body.is-drop-target .spectrum-Table-headRow",

".spectrum-Table-headCell.is-sortable:hover",
".spectrum-Table-headCell.spectrum-Table-hasMenuButton",
".spectrum-Table-headCell.spectrum-Table-hasMenuButton .spectrum-Table-sortButton",
".spectrum-Table-headCell.spectrum-Table-hasMenuButton .spectrum-Table-sortButton .spectrum-Button-label",
".spectrum-Table-headCell.spectrum-Table-hasMenuButton .spectrum-Table-sortButton .spectrum-Button-label:after",
".spectrum-Table-headCell.spectrum-Table-hasMenuButton .spectrum-Table-sortButton .spectrum-Icon",
".spectrum-Table-headCell.spectrum-Table-hasMenuButton .spectrum-Table-sortButton:after",
".spectrum-Table-headCell.spectrum-Table-hasMenuButton .spectrum-Table-sortButton.is-focused:after",
".spectrum-Table-headCell.spectrum-Table-hasMenuButton .spectrum-Table-sortButton:focus-visible:after",
".spectrum-Table-headCell.spectrum-Table-hasMenuButton.is-keyboardFocused",
Copy link
Contributor

Choose a reason for hiding this comment

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

[markdownlint-fix] reported by reviewdog 🐶

Suggested change
".spectrum-Table-headCell.spectrum-Table-hasMenuButton.is-keyboardFocused",
".spectrum-Table-headCell.spectrum-Table-hasMenuButton .spectrum-Table-sortButton:hover",
".spectrum-Table-headCell.spectrum-Table-hasMenuButton.is-keyboardFocused",

Comment on lines +89 to +97
".spectrum-Table-headRow.is-drop-target",
".spectrum-Table-headRow.is-focused",
".spectrum-Table-headRow.is-focused:hover",
".spectrum-Table-headRow.is-selected",
".spectrum-Table-headRow.is-selected.is-focused",
".spectrum-Table-headRow.is-selected:active",
".spectrum-Table-headRow.is-selected:focus-visible",
".spectrum-Table-headRow.is-selected:hover",
".spectrum-Table-headRow:active",
Copy link
Contributor

Choose a reason for hiding this comment

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

[markdownlint-fix] reported by reviewdog 🐶

Suggested change
".spectrum-Table-headRow.is-drop-target",
".spectrum-Table-headRow.is-focused",
".spectrum-Table-headRow.is-focused:hover",
".spectrum-Table-headRow.is-selected",
".spectrum-Table-headRow.is-selected.is-focused",
".spectrum-Table-headRow.is-selected:active",
".spectrum-Table-headRow.is-selected:focus-visible",
".spectrum-Table-headRow.is-selected:hover",
".spectrum-Table-headRow:active",

Comment on lines +99 to +103
".spectrum-Table-headRow:focus",
".spectrum-Table-headRow:focus-visible",
".spectrum-Table-headRow:focus-visible:hover",
".spectrum-Table-headRow:focus:hover",
".spectrum-Table-headRow:hover",
Copy link
Contributor

Choose a reason for hiding this comment

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

[markdownlint-fix] reported by reviewdog 🐶

Suggested change
".spectrum-Table-headRow:focus",
".spectrum-Table-headRow:focus-visible",
".spectrum-Table-headRow:focus-visible:hover",
".spectrum-Table-headRow:focus:hover",
".spectrum-Table-headRow:hover",

@@ -390,7 +430,6 @@
"--mod-button-background-color-down",
"--mod-button-background-color-focus",
"--mod-button-background-color-hover",
"--mod-button-border-radius",
"--mod-button-content-color-default",
Copy link
Contributor

Choose a reason for hiding this comment

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

[markdownlint-fix] reported by reviewdog 🐶

Suggested change
"--mod-button-content-color-default",
"--mod-button-border-radius",
"--mod-button-content-color-default",

Copy link
Collaborator

@rise-erpelding rise-erpelding left a comment

Choose a reason for hiding this comment

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

I think this just needs a few little changes that I found places for within the comments! I'm going to double-check that I addressed all your questions as well.

Copy link
Collaborator

@rise-erpelding rise-erpelding Jun 13, 2025

Choose a reason for hiding this comment

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

It looks like that release PR merged, so I would do a different changeset? I'm not the clearest on what triggers a release but since I don't know better I'd guess that adding to this older changeset might not.

Comment on lines +136 to +139
--mod-button-content-color-default: var(--mod-table-header-text-color, var(--spectrum-table-header-text-color));
--mod-button-content-color-hover: var(--mod-table-header-text-color, var(--spectrum-table-header-text-color));
--mod-button-content-color-focus: var(--mod-table-header-text-color, var(--spectrum-table-header-text-color));
--mod-button-content-color-down: var(--mod-table-header-text-color, var(--spectrum-table-header-text-color));
Copy link
Collaborator

Choose a reason for hiding this comment

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

There are --mods for table-cell-inline-spacing and table-visual-to-text, would you want to use those or is there a specific reason not to?

@@ -220,26 +254,22 @@

.spectrum-Table-headCell {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We do have that ticket for WHCM styles, either we'll get some specs for WHCM and refine there or if we decide that a dedicated spec isn't the best idea (because we want to try to let the default colors work where possible) we can further polish WHCM styles later.

I am going to plop one other WHCM callout in this thread since I'm not sure there's a more appropriate space for it, though. The summary row needs just a bit of adjustment, I see this in WHCM, and something similar in the Chrome emulator.
Screenshot 2025-06-13 at 2 10 31 PM

@@ -57,6 +57,8 @@

--spectrum-steplist-current-marker-color-key-focus: var(--spectrum-blue-700);

--spectrum-table-selected-row-background-color-rgb: var(--spectrum-blue-800-rgb);
Copy link
Collaborator

@rise-erpelding rise-erpelding Jun 13, 2025

Choose a reason for hiding this comment

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

Totally missed this last time. We'd need a changeset for the tokens package too then, right?

@@ -322,6 +330,7 @@ export const Template = ({
${when(hasMenu || isSortable, () => html`
${when(isSortable, () => Button({
size: "m",
variant: "secondary",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I also wondered if it should be an action button. Let's leave it, because you're right, I think it'll need almost all the same passthroughs anyway.

@@ -492,6 +492,31 @@ export const TableGroup = Variants({
isSelected: true,
}
],
},
{
testHeading: "Sparkline charts",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, I think so! Now that I'm looking more closely, I think you can also remove the .is-focused class from the css as well unless there's something I'm missing about needing it?

The way I understand it, the PostCSS config will prefix the pseudo-classes listed there ("focus-visible", "focus-within", "hover", "active", "disabled") with .is- and transform it so that in the dist/index.css anywhere where you've used :focus-visible for example should also have an .is-focus-visible class applied as well.

Then, if you change the template to apply the .is-focus-visible class instead of .is-focused for the isFocused arg, those focus styles would be linked to the control. You could do something with :hover also since that .is-hover class is already being applied?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-review S2 Spectrum 2 size-3 M ~18-30hrs; moderate effort or complexity, several work days needed. skip_vrt Add to a PR to skip running VRT (but still pass the action)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants