Skip to content

Commit

Permalink
create and assign z-index variables, update stylelinting to check for…
Browse files Browse the repository at this point in the history
… z-index vars (#2225)
  • Loading branch information
brianfleming authored and caiosba committed Dec 8, 2024
1 parent 9443817 commit fd72162
Show file tree
Hide file tree
Showing 19 changed files with 56 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .stylelintrc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
}
],
"scale-unlimited/declaration-strict-value": [
["/color/", "fill", "stroke", "font-size", "border-radius"],
["/color/", "fill", "stroke", "font-size", "border-radius", "z-index"],
{
"ignoreValues": ["transparent", "inherit", "currentColor", "currentcolor", "none", "underline", "medium", "unset"]
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/article/ArticleForm.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
display: block;
margin: 80px 0 0;
position: relative;
z-index: 11;
z-index: var(--z-index-2);
}

&::after {
Expand All @@ -36,7 +36,7 @@
right: 0;
text-align: center;
top: 0;
z-index: 10;
z-index: var(--z-index-1);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/components/cds/alerts-and-prompts/Alert.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,5 @@
margin-top: 0;
position: fixed;
width: 100%;
z-index: 1000;
z-index: var(--z-index-max);
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
position: absolute;
right: 0;
top: -.1em;
z-index: 0;
z-index: var(--z-index-0);
}
}

.media-chip-icon {
z-index: 1;
z-index: var(--z-index-1);

svg {
color: var(--color-gray-15);
Expand All @@ -38,5 +38,5 @@
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
z-index: 1;
z-index: var(--z-index-1);
}
4 changes: 2 additions & 2 deletions src/app/components/cds/slideout/Slideout.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
text-transform: none;
top: 0;
width: 40vw;
z-index: 4;
z-index: var(--z-index-9);

textarea {
font-weight: normal;
Expand All @@ -19,7 +19,7 @@
flex-direction: column;
height: 100%;
position: relative;
z-index: 5;
z-index: var(--z-index-10);
}

.slideoutTitle {
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/dashboard/Dashboard.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
th,
td {
&.stickyTableCell {
z-index: 3;
z-index: var(--z-index-3);
}

:global(.MuiTableSortLabel-root) {
Expand All @@ -159,7 +159,7 @@
th,
td {
&.stickyTableCell {
z-index: 2;
z-index: var(--z-index-2);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/components/drawer/Drawer.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
height: 100vh;
transition: width 225ms cubic-bezier(0, 0, .2, 1) 0ms;
width: var(--drawerWidth);
z-index: 4;
z-index: var(--z-index-4);

:global(.MuiDrawer-paperAnchorLeft) {
background-color: var(--color-beige-93);
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/drawer/DrawerRail.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
padding: 15px 0;
text-align: center;
width: var(--drawerRailWidth);
z-index: 2;
z-index: var(--z-index-2);

.drawerRailTop,
.drawerRailMiddle,
Expand Down
6 changes: 3 additions & 3 deletions src/app/components/drawer/Projects/Projects.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
display: block;
left: 6px;
right: 20px;
z-index: 1;
z-index: var(--z-index-1);
}

&::after {
Expand All @@ -222,7 +222,7 @@
position: absolute;
right: 0;
top: 0;
z-index: 2;
z-index: var(--z-index-2);
}

&::after {
Expand All @@ -233,7 +233,7 @@
height: 2px;
margin-top: auto;
position: relative;
z-index: 2;
z-index: var(--z-index-2);
}
}
}
29 changes: 16 additions & 13 deletions src/app/components/layout/AspectRatio.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
position: absolute;
top: 0;
width: 100%;
z-index: 10;
z-index: var(--z-index-6);
}
}

Expand All @@ -36,6 +36,20 @@
position: relative;
}

.aspectRatio,
.aspectRatioSkipped {
.buttonsContainer {
display: flex;
flex-direction: column;
gap: 8px;
padding: 8px 8px 0 0;
position: absolute;
right: 0;
top: 0;
z-index: var(--z-index-7);
}
}

.sensitiveScreen {
align-items: center;
background-color: transparent;
Expand All @@ -53,7 +67,7 @@
right: 0;
top: 0;
width: 100%;
z-index: 100;
z-index: var(--z-index-8);

p {
margin-bottom: 0;
Expand All @@ -76,14 +90,3 @@
}
}
}

.buttonsContainer {
display: flex;
flex-direction: column;
gap: 8px;
padding: 8px 8px 0 0;
position: absolute;
right: 0;
top: 0;
z-index: 1002;
}
2 changes: 1 addition & 1 deletion src/app/components/layout/MultiSelector.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
max-height: 320px;
position: absolute;
right: 0;
z-index: 1;
z-index: var(--z-index-1);
}

.multiselector-scroller {
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/media/MediaCardLarge.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
right: 0;
top: 0;
width: 100%;
z-index: 1;
z-index: var(--z-index-1);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
position: absolute;
right: 0;
top: 0;
z-index: 2;
z-index: var(--z-index-2);
}
}
}
Expand Down Expand Up @@ -156,6 +156,7 @@
.content-screen {
align-items: center;
background-color: var(--color-gray-15);
border: solid 2px;
color: var(--color-white-100);
display: flex;
flex-direction: column;
Expand All @@ -166,7 +167,7 @@
text-align: center;
top: 0;
width: 500px;
z-index: 100;
z-index: var(--z-index-10);
}

.content-screen-icon {
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/search/SearchResults.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
background-color: var(--color-white-100);
left: 0;
position: sticky;
z-index: 3;
z-index: var(--z-index-3);
}
}
}
Expand All @@ -238,7 +238,7 @@
box-shadow: inset 3px 0 0 0 var(--color-gray-75);
left: 0;
position: sticky;
z-index: 1;
z-index: var(--z-index-1);
}

&.search-results-read {
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/search/search.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
position: absolute;
right: 8px;
top: 8px;
z-index: 1;
z-index: var(--z-index-1);
}

.filters-wrapper {
Expand Down
2 changes: 1 addition & 1 deletion src/app/styles/css/inputs.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
margin: 0 0 16px;
position: sticky;
top: -16px;
z-index: 2;
z-index: var(--z-index-2);
}

.form-inner-wrapper {
Expand Down
2 changes: 1 addition & 1 deletion src/app/styles/css/mixins/mixins.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
content: '';
display: block;
top: 0;
z-index: 3;
z-index: var(--z-index-3);
}

&::before {
Expand Down
13 changes: 13 additions & 0 deletions src/app/styles/css/mixins/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,17 @@
--dropShadowMedium: 0 1px 6px 0 rgba(0 0 0 / .15);
--dropShadowWindow: 14px 28px 56px 0 rgba(0 0 0 / .25);
--dropShadowTab: 0 -2px 16px 0 rgba(0 0 0 / .15);

--z-index-max: 1000; /* Nothing will ever be higher, for example tooltips and toasts */
--z-index-10: 10; /* Highest main UI elements, such as slideouts */
--z-index-9: 9; /* Highest main UI elements, such as slideouts */
--z-index-8: 8;
--z-index-7: 7;
--z-index-6: 6;
--z-index-5: 5;
--z-index-4: 4;
--z-index-3: 3;
--z-index-2: 2;
--z-index-1: 1;
--z-index-0: 0;
}
2 changes: 1 addition & 1 deletion src/app/styles/css/tooltip.css
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
}
.rc-tooltip {
position: absolute;
z-index: 1070;
z-index: var(--z-index-max);
display: block;
visibility: visible;
line-height: 1.5;
Expand Down

0 comments on commit fd72162

Please sign in to comment.