Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
31 changes: 31 additions & 0 deletions packages/ui/src/tooltip/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,37 @@ export const WithCustomZIndex: StoryObj< typeof Tooltip.Root > = {
},
};

/**
* The `--wp-ui-tooltip-background-color` and `--wp-ui-tooltip-color` CSS
* variables control the tooltip popup's surface and text colors. Override them
* either globally on `:root` or `body`, or per instance by passing a
* `Tooltip.Portal` with a `style` or `className` to `Tooltip.Popup`'s `portal`
* prop. The variables cascade from the portal wrapper to the popup rendered
* inside it.
*/
export const WithCustomColors: StoryObj< typeof Tooltip.Root > = {
name: 'With Custom Colors',
args: {
children: (
<>
<Tooltip.Trigger aria-label="Save">💾</Tooltip.Trigger>
<Tooltip.Popup
portal={
<Tooltip.Portal
style={ {
'--wp-ui-tooltip-background-color': '#fff',
'--wp-ui-tooltip-color': '#1e1e1e',
} }
/>
}
>
Save
</Tooltip.Popup>
</>
),
},
};

/**
* Use `Tooltip.Provider` to control the delay before tooltips appear.
* This is useful when you have multiple tooltips and want them to share
Expand Down
10 changes: 8 additions & 2 deletions packages/ui/src/tooltip/style.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,21 @@
}

.popup {
background-color: var(--wpds-color-background-surface-neutral-strong);
background-color: var(

Check failure on line 10 in packages/ui/src/tooltip/style.module.css

View workflow job for this annotation

GitHub Actions / All (Node.js 24 on Linux)

Unexpected whitespace after "("

Check failure on line 10 in packages/ui/src/tooltip/style.module.css

View workflow job for this annotation

GitHub Actions / All (Node.js 24 on Linux)

Expected newline after ":" with a multi-line declaration
--wp-ui-tooltip-background-color,

Check failure on line 11 in packages/ui/src/tooltip/style.module.css

View workflow job for this annotation

GitHub Actions / All (Node.js 24 on Linux)

Expected single space after ","
var(--wpds-color-background-surface-neutral-strong)
);

Check failure on line 13 in packages/ui/src/tooltip/style.module.css

View workflow job for this annotation

GitHub Actions / All (Node.js 24 on Linux)

Unexpected whitespace before ")"
padding:
var(--wpds-dimension-padding-xs)
var(--wpds-dimension-padding-sm);
border-radius: var(--wpds-border-radius-md);
font-family: var(--wpds-typography-font-family-body);
font-size: var(--wpds-typography-font-size-sm);
line-height: 1.4; /* TODO: use DS token for line height */
color: var(--wpds-color-foreground-content-neutral);
color: var(

Check failure on line 21 in packages/ui/src/tooltip/style.module.css

View workflow job for this annotation

GitHub Actions / All (Node.js 24 on Linux)

Unexpected whitespace after "("

Check failure on line 21 in packages/ui/src/tooltip/style.module.css

View workflow job for this annotation

GitHub Actions / All (Node.js 24 on Linux)

Expected newline after ":" with a multi-line declaration
--wp-ui-tooltip-color,

Check failure on line 22 in packages/ui/src/tooltip/style.module.css

View workflow job for this annotation

GitHub Actions / All (Node.js 24 on Linux)

Expected single space after ","
var(--wpds-color-foreground-content-neutral)
);

Check failure on line 24 in packages/ui/src/tooltip/style.module.css

View workflow job for this annotation

GitHub Actions / All (Node.js 24 on Linux)

Unexpected whitespace before ")"
box-shadow: var(--wpds-elevation-sm);

/*
Expand Down
Loading