-
Notifications
You must be signed in to change notification settings - Fork 201
fix(tabs): selection indicator scroll overflow border #1513
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
Conversation
🚀 Deployed on https://pr-1513--spectrum-css.netlify.app |
components/tabs/skin.css
Outdated
var(--spectrum-tabs-textonly-tabitem-selection-indicator-background-color-selected) 0, | ||
var(--spectrum-tabs-textonly-tabitem-selection-indicator-background-color-selected) | ||
var(--spectrum-tabs-quiet-textonly-divider-size), | ||
transparent var(--spectrum-tabs-quiet-textonly-divider-size) |
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 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.
With regard to this specific usage, it looks like --spectrum-tabs-quiet-textonly-divider-size
has two purposes: to set the height
of the divider (the bottom border) and to modify its bottom
position placement (-2px
).
The inline styles defined in the example are likely just for the docs example. In a real world application, the implementation would probably have some logic to handle width
& the left
position values.
Can you no longer use --spectrum-tabs-quiet-textonly-divider-size
? If not, what if you were to just manually define it and set it to 2px
?
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 Patrick, I misunderstood how the width is was supposed to work and you helped clarify that.
I updated the PR and it looks correct now. Can I reproduce the issue in the the PR link to make sure this works as expected?
47e25b9
to
fe866b9
Compare
89c854e
to
e8cfb22
Compare
e8cfb22
to
1916e30
Compare
1916e30
to
05d9073
Compare
05d9073
to
f575e3e
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.
Awesome. Looks great to me. Thanks for taking care of this.
I submitted a question in Slack about the design intent of this component to make sure this change isn't misaligned with the design. Originally the bottom border and selection indicator fell outside the block size of the component, leading to the overflow issue. This PR fixes the problem, but it also changes the design. Below is the before (left) and after (right). |
PJ looked at this deploy and confirmed that the indicator is correctly within the Tabs height. |
CSS-242 fix: update solution fix: update vertical variant Still need to update indicator colors and quiet variants fix: all variants correct chore: remove comments
f575e3e
to
251022f
Compare
* main: (53 commits) chore(release): release fix(checkbox): whcm focus states (#1527) chore(release): release feat(fieldlabel)!: migrate to core tokens (CSS-102) (#1476) chore(release): release feat(swatchgroup)!: migrate swatchgroup to core tokens (#1505) chore(release): release feat(swatch)!: migrate swatch to core tokens (#1501) chore(release): release fix(tabs): selection indicator scroll overflow border (#1513) chore(release): release feat(divider)!: migrate to core tokens chore(release): release refactor(checkbox): remove commented out code (#1524) chore(release): release feat(progresscircle)!: migrate to core tokens chore(release): release feat(checkbox)!: migrate checkbox component to core tokens (CSS-99) (#1465) chore(release): release fix(card): increase content area height when necessary ...
Description
Resolves an issue with the selection indicator border when there is scrollable overflow.
Updated with the recommended solution using the background linear gradient rather than background-color.
How and where has this been tested?
Set
.spectrum-Tabs
width to less than the widths of its.spectrum-Tab-item
children combined e.g.200px
. Set.spectrum-Tabs
tooverflow: auto
. See examples of the bug and fix below.Bug
tabs-overflow-border-indicator-bug.mp4
Fixed
tabs-overflow-border-indicator.mp4
Screenshots
To-do list