-
Notifications
You must be signed in to change notification settings - Fork 202
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
base: marissahuysentruyt/css-1178-s2-table-migration-layout-pt1
Are you sure you want to change the base?
Conversation
|
36920dd
to
490a4e9
Compare
57cdc81
to
f9f4cd3
Compare
4b76b0c
to
85d324a
Compare
58bd149
to
870191b
Compare
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: EDIT: The focused unselected ONLY has the side focus indicator, while a focused + selected has the side focus indicator AND the background color change. ✅ Possibly need a background color for the table header for "Quiet" styling to prevent this clash on scrollable tables: EDIT: This was a transparent background color before, but with the updates to the header cell background colors, this should be taken care of. ✅ |
870191b
to
73ee64e
Compare
b746cdf
to
1641315
Compare
41a351d
to
e8478ca
Compare
@@ -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); |
There was a problem hiding this comment.
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.
&.spectrum-Table--quiet { | ||
border-block-start: none; | ||
} |
There was a problem hiding this comment.
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.
&.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))); | ||
} |
There was a problem hiding this comment.
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!
e8478ca
to
64338cd
Compare
TODO: write the changeset (maybe I can add to the part 1 changeset?) |
781d447
to
6cf3b05
Compare
- 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
- there's not really color changes specc'd out for the header table cell background states, so they're now removed
- 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 template - handles hasChaartContent in template markkup
64338cd
to
1462fcf
Compare
Description
This PR is part 2 of the table's migration to S2! Table has been updated to include:
Colors
&Typography
have been addressed)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:
Additional validation
Regression testing
Validate:
Screenshots
To-do list