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(popover): add component tokens #10253

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

Conversation

Elijbet
Copy link
Contributor

@Elijbet Elijbet commented Sep 9, 2024

Related Issue: #7180

Summary

Add popover component tokens.

--calcite-popover-background-color: Specifies the background color of the component.
--calcite-popover-border-color: Specifies the border color of the component.
--calcite-popover-corner-radius: Specifies the corner radius of the component.
--calcite-popover-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 Sep 9, 2024
@alisonailea
Copy link
Contributor

This is looking good Eliza! Thanks!

Probably outside this PR but @macandcheese @SkyeSeitz @ashetland @jcfranco per the discussion on accordion-item header, I'm wondering if there is a larger ui pattern we should be setting here allowing component container header backgrounds to be styled separately from the body?

@Elijbet Elijbet marked this pull request as ready for review September 10, 2024 00:28
@Elijbet Elijbet added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Sep 10, 2024
@jcfranco
Copy link
Member

Probably outside this PR but @macandcheese @SkyeSeitz @ashetland @jcfranco per the discussion on #10181, I'm wondering if there is a larger ui pattern we should be setting here allowing component container header backgrounds to be styled separately from the body?

Outside the scope, but I agree it might be helpful to explore this pattern. I'll defer to the rest of the group on this.

@macandcheese
Copy link
Contributor

macandcheese commented Sep 10, 2024

Probably outside this PR but @macandcheese @SkyeSeitz @ashetland @jcfranco per the discussion on #10181, I'm wondering if there is a larger ui pattern we should be setting here allowing component container header backgrounds to be styled separately from the body?

Outside the scope, but I agree it might be helpful to explore this pattern. I'll defer to the rest of the group on this.

Agreed - many components will require multiple regions of styling - Panel (and consuming components like DIalog) has "content", "header", "footer", "content-top/bottom", etc. that may all be styled separately depending on needs. Same for Block, Accordion, etc.

Copy link
Member

@jcfranco jcfranco left a comment

Choose a reason for hiding this comment

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

Looking great, @Elijbet! Just a few more tweaks and this should be good to merge.

Copy link
Member

@jcfranco jcfranco left a comment

Choose a reason for hiding this comment

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

🚀

* @prop --calcite-popover-background-color: Specifies the background color of the component.
* @prop --calcite-popover-border-color: Specifies the border color of the component.
* @prop --calcite-popover-corner-radius: Specifies the corner radius of the component.
* @prop --calcite-popover-text-color: Specifies the text color of the component.
* @prop --calcite-popover-z-index: Sets the z-index value for the component.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

I might expect a --calcite-popover-shadow css property here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't see any shadow related styling on the component. Can you expand on that?

Copy link
Contributor

Choose a reason for hiding this comment

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

It's coming from floating ui - but I don't think a user would need to know that, so maybe a pattern q of how to set that up. As a user I'd want to just set it at the component level like the other adjustments to border color, corner radius, etc.

Copy link
Contributor

@alisonailea alisonailea Sep 13, 2024

Choose a reason for hiding this comment

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

let's leave the floating-ui tokens separately.

@Elijbet Elijbet 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 Sep 18, 2024
Copy link
Member

@jcfranco jcfranco left a comment

Choose a reason for hiding this comment

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

This is really close, @Elijbet! One more round and it should be good to land.

packages/calcite-components/src/custom-theme/handle.ts Outdated Show resolved Hide resolved
packages/calcite-components/src/custom-theme/handle.ts Outdated Show resolved Hide resolved
packages/calcite-components/src/custom-theme/popover.ts Outdated Show resolved Hide resolved
* @prop --calcite-popover-background-color: Specifies the background color of the component.
* @prop --calcite-popover-border-color: Specifies the border color of the component.
* @prop --calcite-popover-corner-radius: Specifies the corner radius of the component.
* @prop --calcite-popover-text-color: Specifies the text color of the component.
* @prop --calcite-popover-z-index: Sets the z-index value for the component.
Copy link
Member

Choose a reason for hiding this comment

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

Sidebar: can we deprecate component-specific z-indices? We should be using the semantic z-indices instead to adjust different layers. cc @alisonailea @driskull @macandcheese

border-end-end-radius: none;
border-start-end-radius: var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round));
border-end-end-radius: var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round));
--calcite-internal-action-corner-radius-start-end: var(
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be setting the public action CSS props?

--calcite-action-corner-radius-end-end,
var(
--calcite-action-corner-radius,
var(--calcite-internal-action-corner-radius-end-end, var(--calcite-corner-radius))
Copy link
Member

Choose a reason for hiding this comment

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

Should the internal CSS prop be defined in this file?

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.

5 participants