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

Menu items/components do not get custom colors when slotted inside Navigation #8018

Closed
2 of 5 tasks
Tracked by #7180
tyanthony opened this issue Oct 16, 2023 · 3 comments
Closed
2 of 5 tasks
Tracked by #7180
Labels
0 - new New issues that need assignment. ArcGIS Mission Issues logged by ArcGIS Mission team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. calcite-components Issues specific to the @esri/calcite-components package. design-tokens Issues requiring design tokens. estimate - 2 Small fix or update, may require updates to tests. has workaround Issues have a workaround available in the meantime. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive
Milestone

Comments

@tyanthony
Copy link

Check existing issues

Actual Behavior

When using the Navigation component with a slotted Menu/Menut Items component and setting a custom background color using the variable, the background color does not get applied to the Menu items.

Expected Behavior

  • custom background colors should be applied to all elements in the Navigation component

Reproduction Sample

https://codepen.io/tyleranthony/pen/mdaZJqJ?editors=100

Reproduction Steps

  1. Implement a Navigation component with a Menu (and Menu Item) component slotted into the Navigation
  2. Set the --calcite-navigation-background to a different color
  3. Notice the Menu (items) do not change color (there is also no documented way to change the background color of Menus)

Reproduction Version

1.9.2

Relevant Info

No response

Regression?

No response

Priority impact

p4 - not time sensitive

Impact

No response

Calcite package

  • @esri/calcite-components
  • @esri/calcite-components-react
  • @esri/calcite-design-tokens
  • @esri/eslint-plugin-calcite-components

Esri team

ArcGIS Mission

@tyanthony tyanthony added 0 - new New issues that need assignment. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. needs triage Planning workflow - pending design/dev review. labels Oct 16, 2023
@github-actions github-actions bot added impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive ArcGIS Mission Issues logged by ArcGIS Mission team members. calcite-components Issues specific to the @esri/calcite-components package. labels Oct 16, 2023
@macandcheese macandcheese added the design-tokens Issues requiring design tokens. label Oct 16, 2023
@macandcheese
Copy link
Contributor

Yeah, we need to leverage the new design tokens to solve some inheritance issues / allow more aspects of the component to be overridden.

Once that happens, Menu will offer more customization, or you could set the token overrides up in a way that allows it to inherit from a parent.

Currently it can be themed at the Menu level with the global css properties (https://codepen.io/mac_and_cheese/pen/dywBYOX?editors=100), but once we implement the tokens it should be better documented and easier to implement.

@geospatialem geospatialem added blocked This issue is blocked by another issue. has workaround Issues have a workaround available in the meantime. labels Nov 27, 2023
@geospatialem
Copy link
Member

Will revisit after the efforts of #7180, where design tokens should encompass the above in a more readily available manner.

@geospatialem geospatialem added this to the Stalled milestone Nov 27, 2023
@geospatialem geospatialem removed the needs triage Planning workflow - pending design/dev review. label Nov 27, 2023
@geospatialem geospatialem added estimate - 2 Small fix or update, may require updates to tests. and removed blocked This issue is blocked by another issue. labels Jan 14, 2025
@geospatialem
Copy link
Member

@tyanthony Calcite does not plan on a full implementation of the above, as the menu component can reside as a standalone outside of navigation. Instead, to achieve the above, component tokens via CSS variables will allow for the customization.

For instance:

calcite-navigation {
  --calcite-navigation-background-color: PapayaWhip;
}
calcite-menu {
  --calcite-menu-background-color: var(--calcite-navigation-background-color);
}

Here's a Codepen from 3.0.0-next.96 showcasing the above. Closing the above ☝ as it is achievable using component tokens / CSS variables for the navigation and menu components.

@geospatialem geospatialem closed this as not planned Won't fix, can't repro, duplicate, stale Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - new New issues that need assignment. ArcGIS Mission Issues logged by ArcGIS Mission team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. calcite-components Issues specific to the @esri/calcite-components package. design-tokens Issues requiring design tokens. estimate - 2 Small fix or update, may require updates to tests. has workaround Issues have a workaround available in the meantime. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive
Projects
None yet
Development

No branches or pull requests

3 participants