-
Notifications
You must be signed in to change notification settings - Fork 201
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: spectrum-two
Are you sure you want to change the base?
feat(table): migrates remaining table styles to s2 part2 #3818
Conversation
|
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
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.
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.
Totally missed this last time. We'd need a changeset for the tokens package too then, right?
&.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!
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.
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.
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.
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.
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.
e8478ca
to
64338cd
Compare
TODO: write the changeset (maybe I can add to the part 1 changeset?) |
781d447
to
6cf3b05
Compare
64338cd
to
1462fcf
Compare
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.
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:
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:
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.
@@ -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))); |
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.
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));
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.
ah yeah, that's a really good point. I like this idea!
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 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?
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.
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?
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.
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
ddc7b29
to
70dcf8c
Compare
@@ -492,6 +492,31 @@ export const TableGroup = Variants({ | |||
isSelected: true, | |||
} | |||
], | |||
}, | |||
{ | |||
testHeading: "Sparkline charts", |
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.
@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?
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.
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", |
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.
@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 🤷♀️ ).
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 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; |
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.
@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!
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.
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.
--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)); |
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.
@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
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.
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?
transform: var(--spectrum-logical-rotation,); | ||
transform: var(--spectrum-logical-rotation); | ||
|
||
&[aria-expanded="true"] { | ||
transform: var(--spectrum-logical-rotation,) rotate(90deg); |
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.
@rise-erpelding fixed!
} | ||
|
||
.spectrum-Table-row { | ||
&:hover, | ||
.spectrum-Table-scroller { |
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.
@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!
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
3360261
to
7594877
Compare
".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", |
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.
[markdownlint-fix] reported by reviewdog 🐶
".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", |
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.
[markdownlint-fix] reported by reviewdog 🐶
".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", |
".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", |
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.
[markdownlint-fix] reported by reviewdog 🐶
".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", |
".spectrum-Table-headRow:focus", | ||
".spectrum-Table-headRow:focus-visible", | ||
".spectrum-Table-headRow:focus-visible:hover", | ||
".spectrum-Table-headRow:focus:hover", | ||
".spectrum-Table-headRow:hover", |
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.
[markdownlint-fix] reported by reviewdog 🐶
".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", |
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.
[markdownlint-fix] reported by reviewdog 🐶
"--mod-button-content-color-default", | |
"--mod-button-border-radius", | |
"--mod-button-content-color-default", |
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 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.
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.
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.
--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)); |
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.
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 { |
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.
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.
@@ -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.
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", |
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 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", |
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.
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?
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