Skip to content

Commit bf44f31

Browse files
committed
Create a z-index scale for the project and use it
This fixes the CmkCode copy button tooltip not shown on the "Test agent connection" slideout modal. Change-Id: I3c31c756299589a453c2c66b0d2228a15f869ebc
1 parent 8885376 commit bf44f31

5 files changed

Lines changed: 14 additions & 5 deletions

File tree

packages/cmk-frontend-vue/src/assets/variables.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@
5050
/* Dimensions */
5151
--form-field-height: 21px;
5252

53+
/* Z indexes */
54+
--z-index-base: 0;
55+
--z-index-modal: 1000;
56+
--z-index-dropdown: 2000;
57+
--z-index-popup: 3000;
58+
--z-index-tooltip: 4000;
59+
5360
/* Icons that are only defined for facelift, so without dark variant */
5461
--icon-checkmark: url('~cmk-frontend/themes/facelift/images/icon_checkmark.svg');
5562
--icon-checkmark-bare: url('~cmk-frontend/themes/facelift/images/icon_checkmark_bare.svg');

packages/cmk-frontend-vue/src/components/CmkCode.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ const toggleExpansion = () => {
172172
173173
.fade_overlay {
174174
position: absolute;
175-
z-index: 1;
175+
z-index: var(--z-index-base);
176176
bottom: var(--scroll-bar-thickness);
177177
left: 0;
178178
right: 0;
@@ -185,7 +185,7 @@ const toggleExpansion = () => {
185185
position: absolute;
186186
left: 50%;
187187
transform: translateX(-50%);
188-
z-index: 2;
188+
z-index: var(--z-index-base) + 1;
189189
}
190190
191191
&:not(.expanded) .toggle_button_container {
@@ -246,6 +246,8 @@ const toggleExpansion = () => {
246246
background-color: var(--code-background-color);
247247
color: var(--font-color);
248248
white-space: nowrap;
249+
position: relative;
250+
z-index: var(--z-index-tooltip);
249251
250252
&.error {
251253
background-color: var(--error-msg-bg-color);

packages/cmk-frontend-vue/src/components/CmkSlideIn.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ watch(
5353
display: flex;
5454
flex-direction: column;
5555
position: fixed;
56-
z-index: 10;
56+
z-index: var(--z-index-modal);
5757
top: 0;
5858
right: 0;
5959
bottom: 0;

packages/cmk-frontend-vue/src/components/CmkSuggestions.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ defineExpose({
280280
<style scoped>
281281
.cmk-suggestions {
282282
position: absolute;
283-
z-index: 1;
283+
z-index: var(--z-index-dropdown);
284284
color: var(--font-color);
285285
background-color: var(--default-form-element-bg-color);
286286
border: 1px solid var(--ux-theme-6);

packages/cmk-frontend-vue/src/components/HelpText.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ body.inline_help_as_text .help-text__icon {
9999
}
100100
101101
.help-text__popup {
102-
z-index: 1000;
102+
z-index: var(--z-index-tooltip);
103103
}
104104
105105
.help-text__content {

0 commit comments

Comments
 (0)