Skip to content

Commit

Permalink
[PLAY-1602] Lightbox kit - Nitro Bug (#4178)
Browse files Browse the repository at this point in the history
**What does this PR do?** 

- Fix Daily Attendance History Lightbox image's missing close "x" button
when viewed on Safari mobile because the Nitro nav bar overlaps
visually.
- Bump z-index values for Lightbox.
- In Nitro: remove the wrapping div with a z-index which [changes the
stacking context](https://www.joshwcomeau.com/css/stacking-contexts/)

**Screenshots:** Screenshots to visualize your addition/change
<img width="428" alt="Screenshot 2025-01-28 at 8 02 02 AM"
src="https://github.com/user-attachments/assets/6cee8fe0-0c74-426f-8bb0-1257c1d8afb8"
/>

**How to test?** Steps to confirm the desired behavior:
1. Test /kits/lightbox/react
2. Ninja test Nitro lightboxes.

#### Checklist:
- [x] **LABELS** Add a label: `enhancement`, `bug`, `improvement`, `new
kit`, `deprecated`, or `breaking`. See [Changelog &
Labels](https://github.com/powerhome/playbook/wiki/Changelog-&-Labels)
for details.
- [x] **DEPLOY** I have added the `milano` label to show I'm ready for a
review.
  • Loading branch information
kangaree authored Feb 6, 2025
1 parent 6b87b15 commit aa25caa
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions playbook/app/pb_kits/playbook/pb_lightbox/lightbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@import "../tokens/screen_sizes";

$slides-margin: $space-md;
$lightbox-z-index-floor: $z_10 !default;

.carousel {

Expand All @@ -13,7 +14,7 @@ $slides-margin: $space-md;
top: 0;
left: 0;
right: 0;
z-index: 9999999;
z-index: $lightbox-z-index-floor + 99;
align-items: center;
transition: all .5s;

Expand Down Expand Up @@ -55,15 +56,15 @@ $slides-margin: $space-md;
justify-content: space-between;
flex-direction: column;
background-color: black;
z-index: 1;
z-index: $lightbox-z-index-floor + 1;
overflow: hidden;
}

.Slides {
display: flex;
height: calc(100% - 120px);
width: 100%;
z-index: 1;
z-index: $lightbox-z-index-floor + 1;

[class^="react-transform-wrapper"] {
flex-shrink: 0;
Expand All @@ -87,7 +88,7 @@ $slides-margin: $space-md;
.carousel-arrow-left {
display: block;
position: absolute;
z-index: 4;
z-index: $lightbox-z-index-floor + 4;
top: 50%;
@media only screen and (max-width: $screen-xs-max) {
display: none;
Expand All @@ -97,7 +98,7 @@ $slides-margin: $space-md;
.carousel-arrow-right {
display: block;
position: absolute;
z-index: 4;
z-index: $lightbox-z-index-floor + 4;
top: 50%;
right: 0;
@media only screen and (max-width: $screen-xs-max) {
Expand Down Expand Up @@ -140,7 +141,7 @@ $slides-margin: $space-md;
width: 100vw;
padding: 3px;
overflow: scroll;
z-index: 20;
z-index: $lightbox-z-index-floor + 20;
&.centered {
justify-content: center;
}
Expand Down

0 comments on commit aa25caa

Please sign in to comment.