Skip to content

feat(popover): add component tokens#8642

Merged
Elijbet merged 16 commits intoepic/7180-component-tokensfrom
elijbet/7180-add-component-tokens-for-popover
Feb 16, 2024
Merged

feat(popover): add component tokens#8642
Elijbet merged 16 commits intoepic/7180-component-tokensfrom
elijbet/7180-add-component-tokens-for-popover

Conversation

@Elijbet
Copy link
Copy Markdown
Contributor

@Elijbet Elijbet commented Jan 25, 2024

Related Issue: #7180

Summary

Adds the following component tokens:

--calcite-popover-background-color
--calcite-popover-border-color
--calcite-popover-corner-radius
--calcite-popover-font-size
--calcite-popover-text-color
--calcite-popover-z-index

@Elijbet Elijbet requested a review from a team as a code owner January 25, 2024 04:53
@github-actions github-actions Bot added the enhancement Issues tied to a new feature or request. label Jan 25, 2024
Comment thread packages/calcite-components/src/components/popover/popover.scss Outdated
Comment thread packages/calcite-components/src/components/popover/popover.scss Outdated
Comment thread packages/calcite-components/src/components/popover/popover.scss
@Elijbet Elijbet changed the base branch from main to epic/7180-component-tokens January 25, 2024 19:54
Comment thread packages/calcite-components/src/components/popover/popover.scss Outdated
Comment thread packages/calcite-components/src/components/popover/popover.scss Outdated
Comment thread packages/calcite-components/src/components/popover/popover.scss Outdated
Comment thread packages/calcite-components/src/components/popover/popover.scss Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 6, 2024

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 Feb 6, 2024
Comment thread packages/calcite-components/src/components/popover/popover.scss Outdated
Comment thread packages/calcite-components/src/components/popover/popover.scss Outdated
Comment thread packages/calcite-components/src/components/popover/popover.scss Outdated
Comment thread packages/calcite-components/src/components/popover/popover.scss Outdated
* @prop --calcite-popover-border-color: The border color of the component.
* @prop --calcite-popover-corner-radius: The start end border radius of the component.
* @prop --calcite-popover-text-color: The text color of the component.
* @prop --calcite-popover-z-index: Sets the z-index value for the component.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

My mistake here. We're keeping z-index an -internal- variable for now.

*/

:host {
--calcite-floating-ui-z-index: var(--calcite-popover-z-index, theme("zIndex.popover"));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Related to above. This can be replaced with the following,

--calcite-floating-ui-z-index: var(--calcite-z-index-popup);

Copy link
Copy Markdown
Contributor

@alisonailea alisonailea left a comment

Choose a reason for hiding this comment

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

One small thing for non-breaking changes on the z-index. Looks good 🎉


:host {
--calcite-floating-ui-z-index: var(--calcite-popover-z-index, theme("zIndex.popover"));
--calcite-floating-ui-z-index: var(--calcite-z-index-popup);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

for non-breaking changes I just realized this should be

--calcite-floating-ui-z-index: var(--calcite-popover-z-index, var(--calcite-z-index-popup));

Comment thread packages/calcite-components/src/components/popover/popover.scss Outdated
@Elijbet Elijbet merged commit 21a2afe into epic/7180-component-tokens Feb 16, 2024
@Elijbet Elijbet deleted the elijbet/7180-add-component-tokens-for-popover branch February 16, 2024 00:33
@driskull
Copy link
Copy Markdown
Member

@Elijbet @alisonailea shouldn't these be converted to tokens?

:host([scale="s"]) {
  .heading {
    @apply text-n1-wrap
    px-3
    py-2;
  }
}

:host([scale="m"]) {
  .heading {
    @apply text-0-wrap
    px-4
    py-3;
  }
}

:host([scale="l"]) {
  .heading {
    @apply text-1-wrap
    px-5
    py-4;
  }
}

@alisonailea
Copy link
Copy Markdown
Contributor

@Elijbet @alisonailea shouldn't these be converted to tokens?

No. We don't want to expose font size and padding as component tokens in most cases at the moment.

@driskull
Copy link
Copy Markdown
Member

driskull commented Feb 16, 2024

What about border width?

 @apply border
    border-solid;

or height?

 @apply h-full;

@driskull
Copy link
Copy Markdown
Member

Should we add a story for testing this? I notice the popover tail isn't being themed properly.

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. Stale Issues or pull requests that have not had recent activity.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants