-
Notifications
You must be signed in to change notification settings - Fork 81
feat(input): add component tokens #8767
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
…ve) component token
| * @prop --calcite-input-button-background-color-active: defines the background color of an :active button element in the component. | ||
| * @prop --calcite-input-icon-color: defines the color of an icon element in the component. | ||
| * @prop --calcite-input-icon-color-hover: defines the color of an icon element when it's parent is hovered in the component. | ||
| * @prop --calcite-input-prefixsuffix-text-color: defines the text color of a prefix/suffix element in the component. |
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 could see users wanting to customize these individually pretty easily, wdyt cc @SkyeSeitz @ashetland
| * @prop --calcite-input-button-background-color-hover: defines the background color of a :hover-ed button element in the component. | ||
| * @prop --calcite-input-button-background-color-active: defines the background color of an :active button element in the component. | ||
| * @prop --calcite-input-icon-color: defines the color of an icon element in the component. | ||
| * @prop --calcite-input-icon-color-hover: defines the color of an icon element when it's parent is hovered in the component. |
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.
Can the user set this with calcite-input: hover or is it for a different icon besides the one from ‘icon’ prop?
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 different.
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 input-button-icon-color and input-button-icon-color-hover just to be clearer? From the name / description it just sounds like the hover color for the icon set above (which can be affected with a parent-level pseudo state override)
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.
input-icon-color is used for static icons as well. I'll keep this name but update the input-button-icon-color-hover to be clearer.
| * These properties can be overridden using the component's tag as selector. | ||
| * | ||
| * @prop --calcite-input-corner-radius: defines the border radius of the component. | ||
| * @prop --calcite-input-text-color: defines the text color of the component. |
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.
Can we add an input-shadow that defaults to none?
| * | ||
| * These properties can be overridden using the component's tag as selector. | ||
| * | ||
| * @prop --calcite-input-corner-radius: defines the border radius of the component. |
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.
I already have the styles there to prevent an example like you've shown above. The input will not add a rounded border when a ::slotted action is added. However, I can not style the button as shown above as the button is not currently styled in such a way as to allow 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.
Agreed, we shouldn't apply it to slotted content. But that clear button is rendered internally, IMO we should treat it like the number buttons which you already handle:
border-start-start-radius: var(--calcite-input-corner-radius);
border-end-start-radius: var(--calcite-input-corner-radius);
It's only an issue when the close button is adjacent to the edge, you're already handling it in these cases, I think it just needs a conditional for the above state:


macandcheese
left a 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.
Looking really good! Two main things:
- Handle the
clearablecase when its the last rendered element. - I think there are some extra border colors being set on focus / invalid.
I don't mind the invalid styling around the suffix / prefix, but the focus color around number spinners shouldn't be applied I don't think.
|
@macandcheese Thanks for the catch! I did find one error but I also updated the storybook story to remove empty "prefix-text" and "suffix-text" which were causing some of the unexpected layout bugs you saw. Latest screenshots
|
macandcheese
left a 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.
🏅























Related Issue: #7180
Summary
Adds the following component tokens to the calcite-input component styles