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

fix(panel): progressive enhancement to target calcite-actions in header #11495

Open
wants to merge 15 commits into
base: dev
Choose a base branch
from

Conversation

alisonailea
Copy link
Contributor

@alisonailea alisonailea commented Feb 7, 2025

Related Issue: #11491 #8675 #7180

Summary

Allow calcite-actions to be styled specific to the panel-header.
include ::slotted(calcite-action) in selectors and set proper variable fallbacks
Correctly pass corner-radius through the component

@github-actions github-actions bot added the bug Bug reports for broken functionality. Issues should include a reproduction of the bug. label Feb 7, 2025
@alisonailea alisonailea added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Feb 7, 2025
@macandcheese
Copy link
Contributor

macandcheese commented Feb 7, 2025

My 2c - supporting css parts has been discussed and we decided not to pursue for the near-term. It's a significant shift in customization story.

The css token approach seems more on-story here - I do think it could perhaps be simplified to just target the internally rendered Actions and Action Menu - keeping your new props here and making the user story this:

  .my-great-panel {
    --calcite-panel-header-action-background-color: blue;
    --calcite-panel-header-action-background-color-hover: blue;
    --calcite-panel-header-action-background-color-press: blue;
     etc...
  }

  .my-great-panel calcite-action[slot="header-actions-end"] {
    --calcite-action-background-color: blue;
    --calcite-action-background-color-hover: blue;
    --calcite-action-background-color-press: blue;
    etc... 
  }

This way, a user would just need to style Actions slotted in header-actions-end - internally rendered Action and internally rendered Action Menu for the header-menu-actions slot are handled through the new Panel props you added here, and users wouldn't need to reset any Actions slotted elsewhere in the Panel.

Example : https://github.com/Esri/calcite-design-system/blob/macandcheese/wip-panel-tokens-idea/packages/calcite-components/src/components/panel/panel.scss - this would mean we could remove the "pass through docs" for Action props on Panel to reduce confusion.

@driskull
Copy link
Member

I agree with @macandcheese here.

@alisonailea alisonailea marked this pull request as ready for review February 10, 2025 18:26
@jcfranco
Copy link
Member

@alisonailea Can you fix the typo in the title and update the description with details of the final approach? Thanks!

@alisonailea alisonailea changed the title fix(panel): provide progressive enhancement to target caclite-actions in header fix(panel): progressive enhancement to target calcite-actions in header Feb 10, 2025
@@ -181,6 +167,27 @@
}
}

.header {
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 we can be more specific here, just assigning these to the internally-rendered Actions (

)

If so, we can update the css prop descriptions to specifically state the elements affected (like you have for the "part example").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug reports for broken functionality. Issues should include a reproduction of the bug. 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.

4 participants