Skip to content
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

Merged
merged 22 commits into from
Jan 8, 2025

Conversation

anveshmekala
Copy link
Contributor

@anveshmekala anveshmekala commented Oct 30, 2024

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 when active.
--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.

@github-actions github-actions bot added the enhancement Issues tied to a new feature or request. label Oct 30, 2024
Copy link
Contributor

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.

@github-actions github-actions bot added the Stale Issues or pull requests that have not had recent activity. label Nov 15, 2024
@anveshmekala anveshmekala removed the Stale Issues or pull requests that have not had recent activity. label Nov 15, 2024
Copy link
Contributor

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.

@github-actions github-actions bot added the Stale Issues or pull requests that have not had recent activity. label Nov 23, 2024
@anveshmekala anveshmekala removed the Stale Issues or pull requests that have not had recent activity. label Dec 26, 2024
@anveshmekala anveshmekala changed the title feat(menu-item): add component tokens feat(menu, menu-item): add component tokens Dec 30, 2024

&:hover,
&:focus {
background-color: var(--calcite-menu-background-color-hover, var(--calcite-color-foreground-2));
Copy link
Contributor

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

Copy link
Contributor Author

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));
Copy link
Contributor

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

Copy link
Contributor Author

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.

@SkyeSeitz , @macandcheese

Copy link
Contributor

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));
Copy link
Contributor

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));
Copy link
Contributor

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

@anveshmekala anveshmekala changed the title feat(menu, menu-item): add component tokens feat(menu-item): add component tokens Jan 3, 2025
@anveshmekala anveshmekala marked this pull request as ready for review January 3, 2025 19:36
@anveshmekala anveshmekala added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Jan 3, 2025
@anveshmekala anveshmekala added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Jan 3, 2025
@anveshmekala anveshmekala added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Jan 8, 2025
@anveshmekala anveshmekala added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Jan 8, 2025
@anveshmekala anveshmekala added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Jan 8, 2025
@anveshmekala anveshmekala merged commit 9dc1262 into dev Jan 8, 2025
14 checks passed
@anveshmekala anveshmekala deleted the anveshmekala/7180-menu-item-add-tokens branch January 8, 2025 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues tied to a new feature or request. pr ready for visual snapshots Adding this label will run visual snapshot testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants