-
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
feat(menu-item): add component tokens #10654
Conversation
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. |
|
||
&:hover, | ||
&:focus { | ||
background-color: var(--calcite-menu-background-color-hover, var(--calcite-color-foreground-2)); |
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.
because these are on :host they should not have a state. Remove -hover
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 catch, i had state tokens earlier assuming menu-item
& action
can have two different background colors.
&:hover { | ||
@apply text-color-2 border-b-color-2; | ||
border-block-end-color: var(--calcite-menu-item-accent-color-hover, var(--calcite-color-border-2)); |
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.
same here. Remove the state from all tokens on :host
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.
Q: Do we need to add a borderBlockEndColor when hovered ? Currently, navigation components do not add any border when hovered.
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 that makes sense, I think calcite-menu-item:hover { --calcite-menu-item-accent-color: red }
could be a way to set that if desired for some reason, though correct the pattern doesn't currently have that, so we don't need a standalone state token.
&:active { | ||
@apply bg-foreground-3 text-color-1; | ||
background-color: var(--calcite-menu-background-color-press, var(--calcite-color-foreground-3)); |
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.
and here. Remove the state from all tokens on :host
:host { | ||
@apply flex; | ||
} | ||
|
||
ul { | ||
@apply inline-flex items-center h-full m-0 p-0; | ||
background-color: var(--calcite-menu-background-color, var(--calcite-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.
I don't think this token is necessary here. The background color is covered by the menu item
Related Issue: #7180
Summary
Add the following component-scoped CSS Variables to calcite-menu-item:
--calcite-menu-item-accent-color
: Specifies the border color of the component whenactive
.--calcite-menu-item-accent-color-hover
: Specifies the border color of the component when hovered.--calcite-menu-background-color
: Specifies the background color of the component.--calcite-menu-item-sub-menu-border-color
: Specifies the border color of sub-menu.--calcite-menu-item-sub-menu-corner-radius
: Specifies the border radius of sub-menu.--calcite-menu-text-color
: Specifies the text color of the component.