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 #8642

Merged

Conversation

Elijbet
Copy link
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
@Elijbet Elijbet changed the base branch from main to epic/7180-component-tokens January 25, 2024 19:54
Copy link
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
* @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
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.

* @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.
*/

:host {
--calcite-floating-ui-z-index: var(--calcite-popover-z-index, theme("zIndex.popover"));
Copy link
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
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
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));

@Elijbet Elijbet merged commit 21a2afe into epic/7180-component-tokens Feb 16, 2024
4 checks passed
@Elijbet Elijbet deleted the elijbet/7180-add-component-tokens-for-popover branch February 16, 2024 00:33
@driskull
Copy link
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
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
Member

driskull commented Feb 16, 2024

What about border width?

 @apply border
    border-solid;

or height?

 @apply h-full;

@driskull
Copy link
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