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
Merged
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 34 additions & 21 deletions packages/calcite-components/src/components/popover/popover.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
/**
* CSS Custom Properties
*
* These properties can be overridden using the component's tag as selector.
*
* @prop --calcite-popover-z-index: Sets the z-index value for the component.
*/
Elijbet marked this conversation as resolved.
Show resolved Hide resolved
* CSS Custom Properties
*
* These properties can be overridden using the component's tag as selector.
*
* @prop --calcite-popover-background-color: Specifies the background color of the component.
* @prop --calcite-popover-border-color: The border color of the component.
* @prop --calcite-popover-corner-radius: The start end border radius of the component.
Elijbet marked this conversation as resolved.
Show resolved Hide resolved
* @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.

*/

: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);

--calcite-popover-background-color: var(--calcite-color-foreground-1);
--calcite-popover-border-color: var(--calcite-color-border-3);
--calcite-popover-text-color: var(--calcite-color-text-1);
--calcite-popover-corner-radius: var(--calcite-border-radius-round);
}

@include floatingUIHost();
Expand Down Expand Up @@ -46,47 +54,52 @@
}

.calcite-floating-ui-anim {
@apply bg-foreground-1
border-color-3
rounded
border
@apply border
border-solid;

background-color: var(--calcite-popover-background-color);
border-color: var(--calcite-popover-border-color);
border-radius: var(--calcite-popover-corner-radius);
}

.arrow::before {
outline: 1px solid var(--calcite-color-border-3);
outline: 1px solid var(--calcite-popover-border-color);
}

.header {
@apply border-b-color-3
flex
@apply flex
flex-auto
items-stretch
justify-start
border-0
border-b
border-solid;

border-block-end-color: var(--calcite-popover-border-color);
}

.heading {
@apply text-color-1
word-break
@apply word-break
m-0
block
flex-auto
self-center
whitespace-normal
font-medium;

color: var(--calcite-popover-text-color);
}

.container {
@apply text-color-1
relative
@apply relative
flex
h-full
flex-row
flex-nowrap
rounded;
flex-nowrap;

color: var(--calcite-popover-text-color);
border-radius: var(--calcite-popover-corner-radius);

&.has-header {
@apply flex-col;
}
Expand All @@ -105,8 +118,8 @@
.close-button-container {
@apply flex overflow-hidden;
flex: 0 0 auto;
border-start-end-radius: theme("borderRadius.DEFAULT");
border-end-end-radius: theme("borderRadius.DEFAULT");
border-start-end-radius: var(--calcite-popover-corner-radius);
border-end-end-radius: var(--calcite-popover-corner-radius);
}

::slotted(calcite-panel),
Expand Down
Loading