-
Notifications
You must be signed in to change notification settings - Fork 201
feat(tag): migrate to S2 #3682
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(tag): migrate to S2 #3682
Conversation
🦋 Changeset detectedLatest commit: a0495d5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
File metricsSummaryTotal size: 1.37 MB*
tag
* An ASCII character in UTF-8 is 8 bits or 1 byte. |
🚀 Deployed on https://pr-3682--spectrum-css.netlify.app |
937827f
to
f5cf2f3
Compare
|
||
/* border color - transparent unless modified or high contrast mode */ | ||
--spectrum-tag-border-width: var(--spectrum-border-width-100); /* borders remain in WHCM but appear transparent otherwise */ | ||
--spectrum-tag-border-color: var(--highcontrast-tag-border-color, var(--mod-tag-border-color, transparent)); |
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.
Colors have var-stacks at the top level, other properties tend to be numeric or change between sizes, so I left those as-is.
components/tag/index.css
Outdated
|
||
--spectrum-tag-avatar-spacing-block-start: var(--spectrum-tag-top-to-avatar-medium); /* 6px 9px */ | ||
--spectrum-tag-avatar-size: var(--spectrum-avatar-size-100); |
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.
Avatar and thumbnail size don't correspond to the usual 75 = small, 100 = medium, 200 = large sizing conventions.
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.
Do you think we should confirm with design that a avatar sizes for medium and large tags are the same? Instead of what's in Figma (50, 100, 100), I wonder if the avatar sizes should be 50, 75, 100. Thumbnail and the cross icon have different sizes in the token specs based on the tag's t-shirt size, but avatar didn't, so I just wanted to check.
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.
components/tag/index.css
Outdated
margin-block-start: calc(var(--mod-tag-clear-button-spacing-block, var(--spectrum-tag-clear-button-spacing-block)) - var(--mod-tag-border-width, var(--spectrum-tag-border-width))); | ||
margin-block-end: calc(var(--mod-tag-clear-button-spacing-block, var(--spectrum-tag-clear-button-spacing-block)) - var(--mod-tag-border-width, var(--spectrum-tag-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.
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 this is a tough one. If I inspect this in Figma, it's not even a Figma component- it's just a rectangle with that icon in it, where typically the components have been built with the other Figma components so they get all of the usual styles...I might come back to this, but right now, this is a tricky 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.
Leaving a todo comment for myself, since we talked about this: we'll remove the clear button focus outline/remove the clear button from the tabindex. And it would also be nice to make sure that the target for the clear button is of an accessible 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.
Ok, clear button is no longer focusable. I brought the padding back to what it was before (rather than using margin). It looks like there was some onclick event handling that didn't work (it's possible it never worked? I didn't see clear button accepting an onclick arg previously or currently), I did wire that up so that it works as intended but am happy to remove it if we think it's unnecessary. You can't remove a tag on delete as you would be able to on SWC or React, but that feels like it's outside of the scope of what we should be implementing in CSS (the onclick removability is probably outside of the scope by that logic too, which is why I felt weird about fixing it but didn't want to delete it).
I didn't update the spacing on clear button, mainly just because I still have it as a to-do item to update the clear button target to be an accessible size (24px). I kind of think that if we're gonna go and do that, the whole spacing system needs to be refactored. The previous PR #2649 started using :has
, which is a nice idea, and seems to be supported in SWC, but I still feel a little uneasy about making that change (I'd really want to know more about whether this causes other issues downstream). I'm open to taking another look within this PR or moving this to follow-up work.
}, | ||
decorators: [ | ||
withDownStateDimensionCapture, |
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've noticed this sometimes stops working if you switch to the testing grid and back, but this happens with other components too. Something else I'd like to follow up on. It generally works fine if you reload.
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 that in other components, too. I feel like I really noticed it in action button, but I just chalked it up to there being so much markup in the testing grid.
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's a ticket for this!
/** | ||
* Tags have a read-only option for when content in the disabled state still needs to be shown. | ||
* Read-only tags cannot be interacted with or changed. | ||
*/ | ||
export const ReadOnly = TagsDefaultOptions.bind({}); | ||
ReadOnly.storyName = "Read only"; | ||
ReadOnly.tags = ["!dev"]; | ||
ReadOnly.args = { | ||
isReadOnly: true, | ||
}; | ||
ReadOnly.parameters = { | ||
chromatic: { disableSnapshot: true }, | ||
}; | ||
|
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 is a follow-up item also, it wasn't in the design spec but has existed in the S1 design guidelines.
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.
The guidelines also show the label text as being selectable and copyable, but currently it can't be selected and copied. The intended behavior needs some clarification; maybe something else to note for the follow-up.
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 removed user-select: none;
from the tag, so now the text is selectable (but not copy-able, is there a native way to do that in CSS?). Happy to restore it if that causes unintended issues though.
<span class="${rootClass}-itemLabel">${label}</span> | ||
${when(hasClearButton, () => | ||
ClearButton({ | ||
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.
Many of these (clear button, avatar, thumbnail) have their size set by CSS, there doesn't seem to be a lot of value to passing down the size in the template, but let me know if it seems like I'm missing something.
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 agree, especially with the clear button. 👍
I was playing around with avatar and thumbnail, and I found this size mapping (?) approach, which I believe works too:
Thumbnail({
size: [{
s: "50",
m: "75",
: "100",
}[size] || "75"],
imageURL: thumbnailUrl,
}, context)
Avatar({
size: [{
s: "50",
m: "100",
l: "100",
}[size] || "100"],
image: avatarUrl,
}, context)
Is that better than explicitly setting the size in the CSS? I'm not really sure. Maybe it's better to set it with CSS instead of in the template? We could probably get rid of some CSS if we used that ☝️ , but...??? any thoughts on that?
I think both ways achieve the same thing so, I'll leave it up to you which way you think is best!
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 question about which approach is better was the origin of why we decided that it would be nice to have a style guide (and it was also in relation to this tag migration the first time around). I'll take a look at this too, I think my initial thought is always "but we have a token for it, so we should use it" and it helps ensure that we get it shipped with the right size, but on the other hand, extra unnecessary code isn't always the best thing. I'll take another look at this one 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.
Ok, it is size-mapped in the template... but we're also using the tokens. Overkill? It feels like putting in the CSS is nice, because the visuals will be appropriately sized without needing to add it in the implementation, but is there an argument against that?
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.
Another PR, back from the dead! Thanks for the explanation on the padding/margin stuff with all of the new options- very helpful. I think overall the tokens are in a really good spot- there was only one I didn't see in the CSS (about the down state).
I found some style criss-crossing when I started to really mix up the controls, so I left some ideas on how to expand the test file so we covered more of those.
But I had just one extra thing to add, that I couldn't add to the code...
- There's a note about the tooltip on hover to reveal the full text in the docs for text overflow. Is it helpful at all the mention that our component doesn't do that? 😆
name: "Clear button", | ||
description: "True if a button is present to clear the tag.", | ||
name: "Removable", | ||
description: "Has a clear button to clear the tag.", |
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.
Maybe to lean into the "Removable" name for this control, the description could be "Has a clear button to remove the tag from the tag group" or "Has a clear button to remove the chosen tag."
Just a thought.
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.
Control is now removable instead of clear button!
}, | ||
decorators: [ | ||
withDownStateDimensionCapture, |
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 that in other components, too. I feel like I really noticed it in action button, but I just chalked it up to there being so much markup in the testing grid.
|
||
/** | ||
* Tags should always include a label to represent search terms, filters, or keywords. Tags also | ||
* have the option to include an icon, avatar, or thumbnail in addition to the label. |
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.
What do you think about adding links to each of these docs pages?
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.
Links added!
* Read-only tags cannot be interacted with or changed. | ||
*/ | ||
export const ReadOnly = TagsDefaultOptions.bind({}); | ||
ReadOnly.storyName = "Read only"; |
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.
Super tiny thing, but should we have a hyphen here: "Read-only?" I only ask because the description has the hyphens.
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.
Yep, hyphen should be in there!
color: var(--spectrum-tag-content-color-active); | ||
|
||
/* stylelint-disable-next-line spectrum-tools/no-unknown-custom-properties -- height and width are set by implementations */ | ||
transform: perspective(max(var(--spectrum-downstate-height), var(--spectrum-downstate-width) * var(--spectrum-component-size-width-ratio-down))) translateZ(var(--spectrum-component-size-difference-down)); |
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 didn't see component-size-minimum-perspective-down
token in the CSS. Is that supposed to be added to the smallest size tag, sort of like the extra small and small action buttons use that token?
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.
My understanding based on how this is documented on our Foundations page is that we use minimum perspective for little components, and calculated perspective (which needs the down state decorator) for anything with a width larger than 24px. It's true that it's possible for tag-minimum-width-small
to be 21px for desktop, but I believe in that case the height for the small tag would be 24px and so, using the max formula to determine whether the height or width is larger, we'd get the same perspective value as if we'd used the --component-size-minimum-perspective-down
token (which is 24px).
My guess is that --component-size-minimum-perspective-down
might be included in the spec as sort of a catchall that they add to all components that receive the down state treatment?
components/tag/index.css
Outdated
margin-block-start: calc(var(--mod-tag-clear-button-spacing-block, var(--spectrum-tag-clear-button-spacing-block)) - var(--mod-tag-border-width, var(--spectrum-tag-border-width))); | ||
margin-block-end: calc(var(--mod-tag-clear-button-spacing-block, var(--spectrum-tag-clear-button-spacing-block)) - var(--mod-tag-border-width, var(--spectrum-tag-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.
Yeah this is a tough one. If I inspect this in Figma, it's not even a Figma component- it's just a rectangle with that icon in it, where typically the components have been built with the other Figma components so they get all of the usual styles...I might come back to this, but right now, this is a tricky one.
components/tag/index.css
Outdated
inset-block-end: calc(-1 * var(--mod-tag-focus-ring-gap, var(--spectrum-tag-focus-ring-gap)) - var(--mod-tag-border-width, var(--spectrum-tag-border-width)) - var(--mod-tag-focus-ring-thickness, var(--spectrum-tag-focus-ring-thickness))); | ||
inset-inline-start: calc(-1 * var(--mod-tag-focus-ring-gap, var(--spectrum-tag-focus-ring-gap)) - var(--mod-tag-border-width, var(--spectrum-tag-border-width)) - var(--mod-tag-focus-ring-thickness, var(--spectrum-tag-focus-ring-thickness))); | ||
inset-inline-end: calc(-1 * var(--mod-tag-focus-ring-gap, var(--spectrum-tag-focus-ring-gap)) - var(--mod-tag-border-width, var(--spectrum-tag-border-width)) - var(--mod-tag-focus-ring-thickness, var(--spectrum-tag-focus-ring-thickness))); |
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.
Could these 4 inset properties be combined into a single inset
? Would there ever be a time where these would change? Or should we keep them just to offer flexibility, if...the focus ring styles change?
Things are working as is, this was just another thought.
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.
Done!
components/tag/index.css
Outdated
|
||
--spectrum-tag-avatar-spacing-block-start: var(--spectrum-tag-top-to-avatar-medium); /* 6px 9px */ | ||
--spectrum-tag-avatar-size: var(--spectrum-avatar-size-100); |
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.
|
||
border-radius: var(--mod-tag-corner-radius, var(--spectrum-tag-corner-radius)); | ||
border-width: var(--mod-tag-border-width, var(--spectrum-tag-border-width)); | ||
border-style: solid; | ||
|
||
padding-inline-start: calc(var(--mod-tag-spacing-inline-start, var(--spectrum-tag-spacing-inline-start)) - var(--mod-tag-border-width, var(--spectrum-tag-border-width))); | ||
padding-inline-start: calc(var(--mod-tag-label-spacing-inline, var(--spectrum-tag-label-spacing-inline)) - var(--mod-tag-border-width, var(--spectrum-tag-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.
Thanks for this explanation- it's pretty wild to get these spacing values correct.
I did notice an inconsistency with the label's margin-inline-end when it's next to the clear button. I think maybe we don't need to subtract the border width? The medium and large spacing between the label text and clear button is off by one if I compare to Figma. Technically, the small spacing checks out correctly, but that's because the token is set to 9px instead of 8px like Figma says.
Unfortnately, I don't really have a solution to offer. I can spend some time and see what I come up with.
/** | ||
* Tags have a read-only option for when content in the disabled state still needs to be shown. | ||
* Read-only tags cannot be interacted with or changed. | ||
*/ | ||
export const ReadOnly = TagsDefaultOptions.bind({}); | ||
ReadOnly.storyName = "Read only"; | ||
ReadOnly.tags = ["!dev"]; | ||
ReadOnly.args = { | ||
isReadOnly: true, | ||
}; | ||
ReadOnly.parameters = { | ||
chromatic: { disableSnapshot: true }, | ||
}; | ||
|
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.
The guidelines also show the label text as being selectable and copyable, but currently it can't be selected and copied. The intended behavior needs some clarification; maybe something else to note for the follow-up.
isSelected: true, | ||
}, | ||
{ | ||
testHeading: "Emphasized, selected", |
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.
Good callout on this one Marissa. I was wondering the same thing when looking this over. Looking at the desktop file and the playground, Figma only allows turning on emphasized in combination with selected. We don't have updated guidelines but I think you may be right that is only affects the selected state.
In that case, the emphasized Docs entry could be "Default - selected + emphasized" with "The emphasized option uses emphasized colors only when the tag is selected". And tests would need a few updates. Along with styles to make sure just emphasized or emphasized + removable doesn't show emphasized colors.
components/tag/stories/tag.test.js
Outdated
{ | ||
testHeading: "Emphasized, read-only", | ||
isReadOnly: true, | ||
isEmphasized: true, | ||
}, |
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 one was showing emphasized colors but I would expect it to show read-only colors.
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.
components/tag/stories/template.js
Outdated
@focusin=${function() { | ||
if (isReadOnly || isDisabled) return; | ||
updateArgs({ isFocused: true }); | ||
}} | ||
@focusout=${function() { | ||
updateArgs({ isFocused: false }); | ||
}} |
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'd recommend removing this, as the focus events are not the same behavior as :focus-visible
. So currently if you click on the tag in the Default story, the focus indicator will appear when it shouldn't.
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.
Ok! I'm using the keyboard focused instead of focused control now as well. I think that I'd thought it would be nice to see the control toggling when you keyboard focus, but that does have unintended side effects.
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.
Docs addition suggestion: I think it's worth mentioning in the Truncated story description that tags have a maximum width set. Since that might not be expected until it was encountered.
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 shouldn't have had a maximum width set on the custom styles, since tag already has a max inline size set. I updated this story to show the truncated, max-width tag for all 3 sizes.
components/tag/index.css
Outdated
background-color: var(--highcontrast-tag-background-color-focus, var(--mod-tag-background-color-focus, var(--spectrum-tag-background-color-focus))); | ||
color: var(--highcontrast-tag-content-color-focus, var(--mod-tag-content-color-focus, var(--spectrum-tag-content-color-focus))); | ||
&:not(.is-disabled, .is-readOnly):focus-visible, | ||
&:not(.is-disabled, .is-readOnly).is-focused { |
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.
Do we still need .is-focused
for S2 if it's already handled by the :focus-visible
? Is this a legacy thing? If needed for the implementation to apply, it should probably be documented.
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 don't think there's a reason that it needs .is-focused
, it's now using :focus-visible
only and keyboard focused in the controls.
--spectrum-tag-background-color-selected: var(--highcontrast-tag-background-color-selected, var(--mod-tag-background-color-selected, var(--spectrum-neutral-background-color-default))); | ||
--spectrum-tag-background-color-selected-hover: var(--highcontrast-tag-background-color-selected-hover, var(--mod-tag-background-color-selected-hover, var(--spectrum-neutral-background-color-hover))); | ||
--spectrum-tag-background-color-selected-active: var(--highcontrast-tag-background-color-selected-active, var(--mod-tag-background-color-selected-active, var(--spectrum-neutral-background-color-down))); | ||
--spectrum-tag-background-color-selected-focus: var(--highcontrast-tag-background-color-selected-focus, var(--mod-tag-background-color-selected-focus, var(--spectrum-neutral-background-color-key-focus))); |
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.
Could "selected" tokens be used for the value of existing custom properties in .spectrum-Tag.is-selected
, instead of creating new custom properties? For example:
&.is-selected {
--spectrum-tag-background-color: var(--highcontrast-tag-background-color-selected, var(--mod-tag-background-color-selected, var(--spectrum-neutral-background-color-default)));
--spectrum-tag-content-color: var(--highcontrast-tag-content-color-selected, var(--mod-tag-content-color-selected, var(--spectrum-gray-25)));
--spectrum-tag-border-color: var(--highcontrast-tag-border-color-selected, var(--mod-tag-border-color-selected, transparent));
}
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'll have to come back to this one, I made an attempt but started getting tangled when it came to hover/focus/active states. Is button a good component to reference to see where else it's done like this?
9741335
to
51c77f3
Compare
copies CSS tokens and formatting from old PR - Removal of some border-color styles and custom props for specific variant states. These styles are no longer needed as borders have been changed to transparent by default and in WHCM many variants do not change border color between states (hover, active, focus, etc.). - Set border color var-stack at top level - add clear button spacing tokens from previous migration - add min-inline size tokens - clean up passthroughs and consolidate to a single section - remove invalid variant from css - implement down state - adjust avatar and thumbnail sizing - set max inline size - adjust typography tokens - color var stacks up top - nested component cleanup - clear button uses passthroughs - support readonly - whcm updates
- updates to support visual content in storybook template: - icon and avatar controls moved to content section - thumbnail added - add visual control menu to choose visual -remove invalid variant references and options - support active, focus, hover - add documentation - minor refactoring and cleanup - support readonly
- remove selected template - add removable tag to grouped template - prevent showing of duplicate removable tag for in removable story - use grouped template for sizing
ADJUST FOCUS BEHAVIOR: - remove .is-focused states from CSS to use native pseudo-classes - use keyboard focused global state instead of focused global state in Storybook - change of arg from isFocused to isKeyboardFocused in template and tests - removal of focus event listeners to update args ADJUST EMPHASIZED STYLING - .is-emphasized is now .spectrum-Tag--emphasized in CSS and template - emphasized styles only take effect if also selected - update tests and test headings to better display the emphasized variant - small adjustments to story names on docs page to put selected stories next to each other and show emphasized and selected rather than just emphasized ADJUST READ ONLY STYLING - Remove user-select: none to make tag text selectable per guidelines - prevent selected styles from having effect if read-only or disabled - adjust emphasized & read-only tests to include selected state MISC OTHER FIXES - hasClearButton control has been changed to isRemovable - Update of Truncated story to remove max width and rely on component's max width
51c77f3
to
eec2584
Compare
- change avatar size to 75 for medium - use flex-shrink to prevent thumbnail width shrinking when the label is long - use size map in the template for avatar and thumbnail sizing - fix removable tag functionality - remove focusability on clear button (it doesn't remove on delete but is that functionality that's needed here?), revert margin on clear button back to padding where it's not negative - add default sizing info on sizing story - combine inset focus indicator properties to use shorthand
outline: none; | ||
user-select: 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.
Is there a reason to keep this?
|
||
.spectrum-Thumbnail { | ||
/* prevent thumbnail shrinking when label is longer */ | ||
flex-shrink: 0; |
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.
Unclear why only thumbnail seems to shrink when the label is long.
I did think about adding thumbnail/avatar/icon to the truncated section of tests and didn't do it because it would involve moving several things around the test file and the testing grid is already starting to feel a little bloated to me, I'm open to the idea though.
7e8269c
to
4ce8d19
Compare
Description
There was a previous version of this work in #2649 that had been shelved because icons had not been updated yet. That PR will be closed once this one merges.
This work migrates the tag component to Spectrum 2 tokens and specifications:
Additionally, Tag has an expanded testing grid to test more states and state combinations, an updated Docs page in Storybook, and updated Storybook controls to demonstrate Tag's supported content and states.
There are a few outstanding questions that I have, but I don't consider these to be blocking and will make follow-up tickets as needed to address these items:
neutral-selected-background-color-default
and its accompanying hover, key-focus, down tokens don't appear to exist, I used--spectrum-neutral-background-color-default
colors, which seem to mostly match the spec colors.Questions I have now:
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
Here are some things that I generally look at when reviewing other people's migrations that could be used to review this migration, plus a few specific callouts for this work that I'd love feedback on:
Regression testing
Validate:
Screenshots
Spectrum 2:

Spectrum 1:

To-do list