Skip to content

Commit f2fe946

Browse files
author
Alexis Córdova
authored
styling-hooks(popovers): Add z-index styling hook for Popovers (#4594)
1 parent f5ce9ee commit f2fe946

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

ui/components/popovers/RELEASENOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
- Added light and dark Brand variants, including new selectors `.slds-popover_brand, .slds-popover_brand-dark, .slds-popover_brand-top, .slds-popover_brand-left, .slds-popover_brand-bottom, .slds-popover_brand-right`
3232
- Added new Prompt branded variants
33+
- Enabled styling hooks for popovers. See popovers' styling hooks overview table for a full listing of the currently available hooks.
3334

3435
## 2.13.1
3536

ui/components/popovers/docs.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import * as FeatureExamples from './feature/example';
1313
import * as PreviewPanelExamples from './panels/example';
1414
import * as PromptExamples from './prompt/example';
1515
import { getDisplayElementById } from '../../shared/helpers';
16+
import StylingHooksTable from '../../../shared/components/StylingHooksTable';
1617

1718
<div className="doc lead">
1819
A popover is a non-modal dialog. The component should be paired with a
@@ -333,3 +334,13 @@ Panel Popovers can be shown on mouse hover but for keyboard or screen reader use
333334
<CodeView demoStyles="height: 250px;">
334335
{getDisplayElementById(PromptExamples.examples, 'brand-without-footer')}
335336
</CodeView>
337+
338+
## Styling Hooks Overview
339+
340+
<Blockquote header="A Note About z-index">
341+
<p>By default, Popovers use the <code>$z-index-dialog</code> (<a href="/design-tokens/#category-z-index">value of 6000</a>) token. This allows the Popover to appear above the element that triggered it, and in the vast majority of cases should work well out of the box. However, depending on where the Popover code lives when it's triggered, layout issues could arise.</p>
342+
343+
<p>For this particular use case, the <code>--slds-c-popover-zindex</code> <a href="/platforms/lightning/styling-hooks/">Styling Hook</a> allows developers to change the z-index value. <strong>Please note</strong>: when this value is changed, the responsibility is on the developer to maintain the CSS stacking order.</p>
344+
</Blockquote>
345+
346+
<StylingHooksTable name="popovers" type="component" />

ui/dependencies/_popover.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
border-radius: $border-radius-medium;
4242
width: $size-medium;
4343
min-height: ($nubbin-size-default * 2);
44-
z-index: $z-index-dialog;
44+
z-index: var(--slds-c-popover-position-zindex, $z-index-dialog);
4545
background-color: $color;
4646
display: inline-block;
4747

0 commit comments

Comments
 (0)