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(sbb-sticky-bar): allow configuration of z-index #2566

Merged
merged 5 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
9 changes: 5 additions & 4 deletions src/components/container/sticky-bar/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ Optionally the user can set the `color` property on the `sbb-sticky-bar` in orde

## CSS Properties

| Name | Default | Description |
| -------------------------------------------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--sbb-sticky-bar-padding-block` | `var(--sbb-spacing-responsive-xs)` | Block padding of the sticky bar. |
| `--sbb-sticky-bar-bottom-overlapping-height` | `0px` | Define an additional area where the sticky bar overlaps the following content on the bottom. This area becomes visible when the sticky bar transitions from sticky to the normal document flow. |
| Name | Default | Description |
| -------------------------------------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--sbb-sticky-bar-padding-block` | `var(--sbb-spacing-responsive-xs)` | Block padding of the sticky bar. |
| `--sbb-sticky-bar-bottom-overlapping-height` | `0px` | Define an additional area where the sticky bar overlaps the following content on the bottom. This area becomes visible when the sticky bar transitions from sticky to the normal document flow. |
| `--sbb-sticky-bar-z-index` | `var(--sbb-overlay-default-z-index)` | To specify a custom stack order, the `z-index` can be overridden by defining this CSS variable. The default `z-index` of the component is set to `var(--sbb-overlay-default-z-index)` with a value of `1000`. |

## Slots

Expand Down
1 change: 1 addition & 0 deletions src/components/container/sticky-bar/sticky-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ $intersector-overlapping: 1px;
position: sticky;
inset-block-end: 0;
display: block;
z-index: var(--sbb-sticky-bar-z-index, var(--sbb-overlay-default-z-index));
jeripeierSBB marked this conversation as resolved.
Show resolved Hide resolved

&::after,
&::before {
Expand Down
3 changes: 3 additions & 0 deletions src/components/container/sticky-bar/sticky-bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import style from './sticky-bar.scss?lit&inline';
* @cssprop [--sbb-sticky-bar-bottom-overlapping-height=0px] - Define an additional area where
* the sticky bar overlaps the following content on the bottom.
* This area becomes visible when the sticky bar transitions from sticky to the normal document flow.
* @cssprop [--sbb-sticky-bar-z-index=var(--sbb-overlay-default-z-index)] - To specify a custom stack order,
* the `z-index` can be overridden by defining this CSS variable. The default `z-index` of the
* component is set to `var(--sbb-overlay-default-z-index)` with a value of `1000`.
jeripeierSBB marked this conversation as resolved.
Show resolved Hide resolved
*/
@customElement('sbb-sticky-bar')
@hostAttributes({
Expand Down
Loading