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(panel): control panel header action tokens #11300

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

alisonailea
Copy link
Contributor

@alisonailea alisonailea commented Jan 14, 2025

Summary

Per discussion on Teams. Allows the action menu in panel header shadowDom to be controlled separately from other tokens without a reset per customer request.

Adds Tokens

--calcite-panel-header-action-menu-items-space: Specifies the space between actions in the header's action menu.
--calcite-panel-header-action-background-color-hover: Specifies the background color of the component's calcite-action items in the panel header when hovered.
--calcite-panel-header-action-background-color-press: Specifies the background color of the component's calcite-action items in the panel header when pressed.
--calcite-panel-header-action-background-color: Specifies the background color of the component's calcite-action items in the panel header.
--calcite-panel-header-action-corner-radius: Specifies the corner radius of the component's calcite-action items in the panel header.
--calcite-panel-header-action-indicator-color: Specifies the color of the component's calcite-action items' indicator in the panel header.
--calcite-panel-header-action-text-color-press: Specifies the text color of the component's calcite-action items in the panel header when pressed.
--calcite-panel-header-action-text-color: Specifies the text color of the component's calcite-action items in the panel header.

@alisonailea alisonailea added the design-tokens Issues requiring design tokens. label Jan 14, 2025
@alisonailea alisonailea self-assigned this Jan 14, 2025
@github-actions github-actions bot added the enhancement Issues tied to a new feature or request. label Jan 14, 2025
@alisonailea
Copy link
Contributor Author

The alternative is for the user to reset actions in the CSS cascade

calcite-panel {
  --calcite-panel-header-background-color: #004874;
  --calcite-panel-heading-text-color: #fff;
  --calcite-action-background-color: #004874;
  --calcite-action-background-color-hover: #023452;
  --calcite-action-background-color-pressed: #023452;
  --calcite-action-text-color: #fff;
  --calcite-action-text-color-hover: #fff;
  --calcite-action-text-color-pressed: #fff;

  .panel-body {
    --calcite-action-background-color: initial;
    --calcite-action-background-color-hover: initial;
    --calcite-action-background-color-pressed: initial;
    --calcite-action-text-color: intial;
    --calcite-action-text-color-hover: initial;
    --calcite-action-text-color-pressed: initial;
  }
}

@@ -26,6 +26,15 @@
* @prop --calcite-panel-content-space: [Deprecated] Use `--calcite-panel-space` instead. Specifies the padding of the component's content.
* @prop --calcite-panel-footer-padding: [Deprecated] Use `--calcite-panel-footer-space` instead. Specifies the padding of the component's footer.
* @prop --calcite-panel-header-border-block-end: [Deprecated] Use `--calcite-panel-border-color` instead. Specifies the component header's block end border.

* @prop --calcite-panel-header-action-menu-items-space: Specifies the space between actions in the header's action menu.
* @prop --calcite-panel-header-action-background-color-hover: Specifies the background color of the component's `calcite-action` items in the panel header when hovered.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a double space here inbetween items in. Applies to multiple lines here.

@@ -147,6 +156,26 @@
margin-inline-end: auto;
justify-content: center;

.header-actions {
--calcite-action-menu-items-space: var(--calcite-panel-header-action-menu-items-space, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the 0 is needed here as its the default in the action-menu.scss. right?

My concern is that the 0 within the action-menu should be the source of truth. If action-menu changes to something other than 0 then how would we know to update this as well?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applies to other fallback defaults below.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is a public prop on Action Menu - I'm not sure the history there (or if needed on that component), but I don't know if this needs to be added here - I think just the color ones are good for this.

Copy link
Contributor

@macandcheese macandcheese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple q about potentially unneeded pass-through-props, but the color ones look good to me.

* @prop --calcite-panel-header-action-background-color-hover: Specifies the background color of the component's `calcite-action` items in the panel header when hovered.
* @prop --calcite-panel-header-action-background-color-press: Specifies the background color of the component's `calcite-action` items in the panel header when pressed.
* @prop --calcite-panel-header-action-background-color: Specifies the background color of the component's `calcite-action` items in the panel header.
* @prop --calcite-panel-header-action-corner-radius: Specifies the corner radius of the component's `calcite-action` items in the panel header.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one might not be needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design-tokens Issues requiring design tokens. enhancement Issues tied to a new feature or request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants