Skip to content

Commit afc1b04

Browse files
committed
Remove z-index()
1 parent 8055c9a commit afc1b04

File tree

28 files changed

+127
-196
lines changed

28 files changed

+127
-196
lines changed

src/components/Backdrop/Backdrop.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ $entry-iterations: 1;
44

55
.Backdrop {
66
position: fixed;
7-
z-index: var(--p-backdrop);
7+
z-index: var(--p-z-backdrop);
88
top: 0;
99
right: 0;
1010
bottom: 0;
@@ -21,7 +21,7 @@ $entry-iterations: 1;
2121
}
2222

2323
.belowNavigation {
24-
z-index: var(--p-nav-backdrop);
24+
z-index: var(--p-z-nav-backdrop);
2525
}
2626

2727
@keyframes fade-in {

src/components/Button/Button.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $partial-button-filled-pressed-box-shadow: inset 0 0 0 0 transparent,
2121
}
2222

2323
&.connectedDisclosure {
24-
z-index: var(--p-segment);
24+
z-index: var(--pc-segment);
2525
border-top-right-radius: 0;
2626
border-bottom-right-radius: 0;
2727

src/components/ColorPicker/ColorPicker.scss

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ $picker-size: rem(160px);
44
$dragger-size: rem(18px);
55
$inner-shadow: inset 0 0 2px 0 rgba(0, 0, 0, 0.5);
66

7-
$stacking-order: (
8-
color: 10,
9-
adjustments: 20,
10-
dragger: 30,
11-
);
12-
137
@mixin checkers {
148
background: repeating-conic-gradient(
159
var(--p-surface) 0% 25%,
@@ -19,6 +13,9 @@ $stacking-order: (
1913
}
2014

2115
.ColorPicker {
16+
--pc-color: 10;
17+
--pc-adjustments: 20;
18+
--pc-dragger: 30;
2219
user-select: none;
2320
display: flex;
2421
}
@@ -55,7 +52,7 @@ $stacking-order: (
5552
&::before {
5653
content: '';
5754
position: absolute;
58-
z-index: z-index(adjustments, $stacking-order);
55+
z-index: var(--pc-adjustments);
5956
top: 0;
6057
left: 0;
6158
display: block;
@@ -76,7 +73,7 @@ $stacking-order: (
7673

7774
.Dragger {
7875
position: relative;
79-
z-index: z-index(dragger, $stacking-order);
76+
z-index: var(--pc-dragger);
8077
bottom: 0.5 * $dragger-size;
8178
transform: none;
8279
height: $dragger-size;
@@ -124,7 +121,7 @@ $huepicker-bottom-padding-start: $picker-size - $dragger-size;
124121

125122
.ColorLayer {
126123
position: absolute;
127-
z-index: z-index(color, $stacking-order);
124+
z-index: var(--pc-color);
128125
top: 0;
129126
left: 0;
130127
height: 100%;
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
@import '../../styles/common';
22

3-
$stacking-order: (
4-
item: 10,
5-
primary: 20,
6-
focused: 30,
7-
);
8-
93
.Connected {
4+
--pc-item: 10;
5+
--pc-primary: 20;
6+
--pc-focused: 30;
107
position: relative;
118
display: flex;
129
}
1310

1411
.Item {
1512
position: relative;
16-
z-index: z-index(item, $stacking-order);
13+
z-index: var(--pc-item);
1714
flex: 0 0 auto;
1815

1916
&:not(:first-child) {
@@ -26,12 +23,12 @@ $stacking-order: (
2623
// TextField.scss has a dependency due to this override.
2724
// stylelint-disable declaration-no-important
2825
.Item-primary {
29-
z-index: z-index(primary, $stacking-order);
26+
z-index: var(--pc-primary);
3027
flex: 1 1 auto;
3128
}
3229

3330
// stylelint-enable declaration-no-important
3431

3532
.Item-focused {
36-
z-index: z-index(focused, $stacking-order);
33+
z-index: var(--pc-focused);
3734
}

src/components/CustomProperties/tests/CustomProperties.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const mockTokens: Tokens = {
4141
legacyTokens: {},
4242
spacing: {},
4343
typography: {},
44+
zIndex: {},
4445
};
4546

4647
const expectedCustomProperties =

src/components/DropZone/DropZone.scss

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ $dropzone-min-height-large: rem(100px);
66
$dropzone-min-height-medium: rem(100px);
77
$dropzone-min-height-small: rem(50px);
88

9-
$dropzone-stacking-order: (
10-
outline: 29,
11-
overlay: 30,
12-
);
13-
149
@mixin reset-after {
1510
top: 0;
1611
left: 0;
@@ -28,6 +23,8 @@ $dropzone-stacking-order: (
2823
}
2924

3025
.DropZone {
26+
--pc-outline: 29;
27+
--pc-overlay: 30;
3128
position: relative;
3229
display: flex;
3330
justify-content: center;
@@ -37,7 +34,7 @@ $dropzone-stacking-order: (
3734
&::after {
3835
content: '';
3936
position: absolute;
40-
z-index: z-index(outline, $dropzone-stacking-order);
37+
z-index: var(--pc-outline);
4138
top: 0;
4239
right: 0;
4340
bottom: 0;
@@ -131,7 +128,7 @@ $dropzone-stacking-order: (
131128
.Overlay {
132129
@include set-border-radius;
133130
position: absolute;
134-
z-index: z-index(overlay, $dropzone-stacking-order);
131+
z-index: var(--pc-overlay);
135132
top: 0;
136133
right: 0;
137134
bottom: 0;

src/components/Filters/Filters.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ $list-filters-footer-height: rem(70px);
199199

200200
.Backdrop {
201201
position: fixed;
202-
z-index: var(--p-backdrop);
202+
z-index: var(--p-z-backdrop);
203203
top: 0;
204204
right: 0;
205205
bottom: 0;

src/components/Filters/components/ConnectedFilterControl/ConnectedFilterControl.scss

Lines changed: 20 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,31 @@
11
@import '../../../../styles/common';
22

3-
// stylelint-disable selector-max-class
4-
// stylelint-disable selector-max-combinators
5-
// stylelint-disable selector-max-specificity
6-
// stylelint-disable selector-max-compound-selectors
7-
// stylelint-disable selector-max-type
8-
// 🐦🐀
9-
$stacking-order: (
10-
item: 10,
11-
focused: 20,
12-
);
3+
.ConnectedFilterControl {
4+
--pc-item: 10;
5+
--pc-focused: 20;
6+
display: flex;
7+
flex-grow: 1;
8+
9+
.CenterContainer {
10+
flex: 1 1 auto;
11+
min-width: rem(100px);
12+
}
13+
14+
&.right {
15+
.CenterContainer * {
16+
border-top-right-radius: var(--p-border-radius-base);
17+
border-bottom-right-radius: var(--p-border-radius-base);
18+
}
19+
}
20+
}
1321

1422
.Item {
1523
position: relative;
16-
z-index: z-index(item, $stacking-order);
24+
z-index: var(--pc-item);
1725
}
1826

1927
.Item-focused {
20-
z-index: z-index(focused, $stacking-order);
28+
z-index: var(--pc-focused);
2129
}
2230

2331
.ProxyButtonContainer {
@@ -35,23 +43,6 @@ $stacking-order: (
3543
}
3644
}
3745

38-
.ConnectedFilterControl {
39-
display: flex;
40-
flex-grow: 1;
41-
42-
.CenterContainer {
43-
flex: 1 1 auto;
44-
min-width: rem(100px);
45-
}
46-
47-
&.right {
48-
.CenterContainer * {
49-
border-top-right-radius: var(--p-border-radius-base);
50-
border-bottom-right-radius: var(--p-border-radius-base);
51-
}
52-
}
53-
}
54-
5546
.CenterContainer + .RightContainer,
5647
.CenterContainer + .MoreFiltersButtonContainer {
5748
margin-left: var(--p-space-2);
@@ -110,8 +101,3 @@ $stacking-order: (
110101
.AuxiliaryContainer {
111102
flex-grow: 0;
112103
}
113-
// stylelint-enable selector-max-specificity
114-
// stylelint-enable selector-max-combinators
115-
// stylelint-enable selector-max-class
116-
// stylelint-enable selector-max-type
117-
// stylelint-enable selector-max-compound-selectors

src/components/Frame/Frame.scss

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ $skip-vertical-offset: rem(10px);
2222
.Navigation {
2323
@include hidden-when-printing;
2424
position: fixed;
25-
z-index: var(--p-nav);
25+
z-index: var(--p-z-nav);
2626
top: 0;
2727
left: 0;
2828
display: none;
@@ -121,7 +121,7 @@ $skip-vertical-offset: rem(10px);
121121
.TopBar {
122122
@include hidden-when-printing;
123123
position: fixed;
124-
z-index: var(--p-top-bar);
124+
z-index: var(--p-z-top-bar);
125125
top: 0;
126126
left: 0;
127127
width: 100%;
@@ -135,7 +135,7 @@ $skip-vertical-offset: rem(10px);
135135

136136
.ContextualSaveBar {
137137
position: fixed;
138-
z-index: var(--p-context-bar);
138+
z-index: var(--p-z-context-bar);
139139
top: 0;
140140
left: 0;
141141
width: 100%;
@@ -184,7 +184,7 @@ $skip-vertical-offset: rem(10px);
184184

185185
.GlobalRibbonContainer {
186186
position: fixed;
187-
z-index: var(--p-global-ribbon);
187+
z-index: var(--p-z-global-ribbon);
188188
bottom: 0;
189189
width: 100%;
190190

@@ -206,7 +206,7 @@ $skip-vertical-offset: rem(10px);
206206
.LoadingBar {
207207
@include hidden-when-printing;
208208
position: fixed;
209-
z-index: var(--p-small-screen-loading-bar, $fixed-element-stacking-order);
209+
z-index: var(--p-z-small-screen-loading-bar);
210210
top: 0;
211211
right: 0;
212212
left: 0;
@@ -217,14 +217,14 @@ $skip-vertical-offset: rem(10px);
217217
}
218218

219219
.hasTopBar & {
220-
z-index: var(--p-small-screen-loading-bar);
220+
z-index: var(--p-z-small-screen-loading-bar);
221221
}
222222
}
223223
}
224224

225225
.Skip {
226226
position: fixed;
227-
z-index: var(--p-skip-to-content);
227+
z-index: var(--p-z-skip-to-content);
228228
top: $skip-vertical-offset;
229229
left: calc(var(--p-space-2) + var(--p-frame-offset));
230230
opacity: 0;

src/components/Frame/components/ToastManager/ToastManager.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
.ToastManager {
1212
position: fixed;
13-
z-index: z-index(toast, $fixed-element-stacking-order);
13+
z-index: var(--z-toast);
1414
right: 0;
1515
left: 0;
1616
text-align: center;

0 commit comments

Comments
 (0)