-
Notifications
You must be signed in to change notification settings - Fork 77
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
fix(table): update tokens and add E2E themed tests #9646
Conversation
This reverts commit c1e7945.
@@ -5,11 +5,9 @@ | |||
* | |||
* @prop --calcite-table-row-background: [Deprecated] Use `--calcite-table-row-background-color` instead. Specifies the background color of the component. | |||
* @prop --calcite-table-row-background-color: Specifies the background color of the component. | |||
* @prop --calcite-table-row-background-color-striped: The background color of the component's `striped` rows, when specified. | |||
* @prop --calcite-table-row-secondary-background-color: The background color of the component's `striped` rows, when specified. |
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 discussed this token name change with Skye and Aaron. The use of the "secondary" group here aligns better with our naming schema.
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.
Hm. This seems unexpected to me. The name corresponds directly to the property that causes it to display. We don’t really use secondary elsewhere.
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.
“striped-background-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.
primary / secondary is a common naming pattern for design system colors and one I think we'll be expanding on in the future. "striped" is very specific to table.
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 guess that's my take - it is specific to table. To this point we've been intentional to not use primary / secondary / tertiary, so teams can build their own meaning through our properties. I think that's a fine direction to head in if we choose to in the future, but beginning to add it in now seems strange - this css property can only be used when striped
is used so I think it makes sense. Adding "secondary" verbiage as the only public-facing case of it here seems strange. Maybe a good discussion with the larger team.
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.
does "--calcite-table-row-striped-secondary-background-color" work? That way at least there is some indication to a user it pertains and will only be visible when the striped
property is in use.
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 would agree with this. If the default row color is "--calcite-table-row-background-color", then I would expect the striped prop to correlate to a "--calcite-table-row-striped-background-color" css property. I don't think the word "secondary" is necessary especially since there is no need for a "--calcite-table-row-primary-background-color" for it to correlate to.
); | ||
} | ||
|
||
.selection-cell.selected-cell { | ||
box-shadow: inset 0.25rem 0 0 0 var(--calcite-table-row-selected-accent-color, var(--calcite-color-brand)); | ||
color: var(--calcite-table-selection-cell-icon-color-selected, var(--calcite-color-brand)); | ||
box-shadow: var(--calcite-table-cell-shadow-selected, inset 0.25rem 0 0 0 var(--calcite-color-brand)); |
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 wonder if the accent terminology is more understandable to an end user. It’s really creating a border accent - like we have in alert, notice, etc. this terminology with shadow makes it seem like the shadow is customizable.
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’s also only applicable to the single selection cell that receives the accent so I think the prior naming makes more sense. It should only be set on the row once, and not on an individual component. The cell that receives this color override is rendered internally within the Table Row.
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.
thanks for the catch! But I think naming wise it aligns more with the "indicator" pattern that exists in other components.
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 know Alert uses "accent" for a similar thing, I think we have "highlight" in use (or talked about it). I think as long as we don't use shadow here I'm ok with it.
Really in plain terms this is "the color of the "selected indicator" border (or, for the other props - the icon) in the selectable checkbox cell when that cell is selected" . Because the user can't target this Cell directly, I think using terminology that has Table Row makes sense, since it can be controlled once at the app / table parent level or still individually per row.
"--calcite-table-row-indicator-color-selected", "--calcite-table-row-selected-highlight/indicator", "--calcite-table-row-selection/selected-indicator-color" or some combination like those etc., would maybe solve both our concerns?
color: var(--calcite-table-cell-text-color-selected, var(--calcite-color-brand)); | ||
& calcite-icon { | ||
--calcite-icon-color: var(--calcite-table-cell-text-color-selected, var(--calcite-color-brand)); | ||
box-shadow: inset 0.25rem 0 0 0 var(--calcite-table-cell-indicator-color-selected, var(--calcite-color-brand)); |
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 doesn't address my issue with this naming change - this is really a row-specific visual display and I think we should keep that nomenclature. I still think it should use table-row terminology, and that "--calcite-table-row-selected-accent-color" is a more apt name. "selected-highlight, "selected-indicator") all work for me, as long as its scoped to the row.
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 made some comments about nomenclature, etc., but I think there are some other changes that caused issues - namely moving the row styles around.
I'm seeing double border in most places and some un-set icon color for selection, etc.
It'd also be nice to update the table.html
demo page themed examples with the new properties to ensure we aren't missing any of the combinations. Thank you for tackling this!
This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions. |
This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions. |
This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions. |
Closing as we are tackling component tokens in smaller chunks. Thanks, everyone! ✨💪✨ |
Related Issue: #7180
Summary
Add tokens for table