-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
FormTokenField: Fix token styles #66640
Conversation
@@ -90,7 +95,6 @@ | |||
position: absolute; | |||
top: 1px; | |||
right: 0; | |||
padding: 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.
Removing as redundant.
|
||
&.is-disabled { | ||
.components-form-token-field__remove-token { | ||
cursor: 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.
Removing as redundant.
@@ -134,20 +131,19 @@ | |||
.components-form-token-field__token-text { | |||
border-radius: $radius-x-small 0 0 $radius-x-small; | |||
padding: 0 0 0 8px; | |||
line-height: 24px; |
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.
Moving here because it's overwritten for the remove token button on line 143 anyway.
white-space: nowrap; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
} | ||
|
||
.components-form-token-field__remove-token.components-button { | ||
cursor: pointer; |
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.
Removing as redundant.
border-radius: 0 $radius-x-small $radius-x-small 0; | ||
padding: 0 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.
Removing the 2px side padding as unnecessary.
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: -44 B (0%) Total Size: 1.81 MB
ℹ️ View Unchanged
|
Flaky tests detected in 364ffbe. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11613729725
|
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.
LGTM 👍
While testing, I noticed that the hover colors with a dark color scheme when borderless and potentially when disabled as well might be off, but this seems to be the same in trunk. Not for this PR, but could definitely use some love, like many other use cases of other components when using dark background 😅
Ooh, I love how you tried the color theme tool! To clarify on the status there, we were in the midst of experimenting internally with theming, and only a few components fully support all the (experimental) color parameters. Accent color theming is fully supported though, at least. |
* FormTokenField: Fix token styles * Add changelog Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: tyxla <tyxla@git.wordpress.org>
In preparation for #65751
What?
Tweak the token component so it uses fewer style overrides, as well as fix some minor style bugs when
isBorderless
.Testing Instructions
See the Storybook for FormTokenField. Test for combinations of the
disabled
andisBorderless
props.Screenshots or screencast
Default
The remove button is now a nice square using the "small" variant of Button.
Disabled
No visual changes aside from right padding on the remove button.
isBorderless & Disabled
Before
CleanShot.2024-10-31.at.22.59.12.mp4
The token text and remove button both look interactive, even though they are disabled.
After
CleanShot.2024-10-31.at.22.59.42.mp4
A version 2 of this component is planned, and a comprehensive design review would take place then, but cc @WordPress/gutenberg-design anyway for awareness.