Skip to content

Commit 52053e5

Browse files
committed
fix: added z-index to mode help tooltip and z-index system
1 parent 5b00492 commit 52053e5

File tree

18 files changed

+130
-24
lines changed

18 files changed

+130
-24
lines changed

README-ru.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,32 @@ configure({
8484

8585
Обязательно сделайте вызов `configure()` из [UIKit](https://github.com/gravity-ui/uikit?tab=readme-ov-file#i18n) и других UI-библиотек.
8686

87+
### Система z-index
88+
89+
В этом проекте используется система z-index для управления слоями элементов. Ниже приведены определенные уровни и их значения:
90+
91+
| level | z-index value |
92+
|---------------------|---------------|
93+
| background | -1 |
94+
| default | 0 |
95+
| forefront | 1 |
96+
| img-settings-button | 2 |
97+
| table-view-button | 100 |
98+
| table-cell-button | 110 |
99+
| sticky-toolbar | 2000 |
100+
| tooltip | 2100 |
101+
102+
### Использование
103+
104+
Для применения z-index в компонентах используйте миксин z-index, передавая соответствующий ключ в качестве аргумента:
105+
106+
```scss
107+
@use 'styles/mixins.scss';
108+
109+
.tooltip {
110+
@include mixins.z-index('tooltip');
111+
}
112+
```
87113

88114
### Участие в разработке
89115

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,33 @@ configure({
8383

8484
Don't forget to call `configure()` from [UIKit](https://github.com/gravity-ui/uikit?tab=readme-ov-file#i18n) and other UI libraries.
8585

86+
### Z-index levels
87+
88+
This project uses a z-index map to control the layers of elements. Defined levels:
89+
90+
| level | z-index value |
91+
|---------------------|---------------|
92+
| background | -1 |
93+
| default | 0 |
94+
| forefront | 1 |
95+
| img-settings-button | 2 |
96+
| table-view-button | 100 |
97+
| table-cell-button | 110 |
98+
| sticky-toolbar | 2000 |
99+
| tooltip | 2100 |
100+
101+
### Usage
102+
103+
To apply z-index to components, use the z-index mixin, passing the key as an argument:
104+
105+
```scss
106+
@use 'styles/mixins.scss';
107+
108+
.tooltip {
109+
@include mixins.z-index('tooltip');
110+
}
111+
```
112+
86113
### Contributing
87114

88115
- [Contributor Guidelines](https://preview.gravity-ui.com/md-editor/?path=/docs/docs-contributing--docs)

src/bundle/settings/index.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@use '../../styles/mixins.scss';
12
@import '~@gravity-ui/uikit/styles/mixins';
23

34
.g-md-editor-settings {
@@ -13,7 +14,7 @@
1314
}
1415

1516
&__separator {
16-
z-index: 0;
17+
@include mixins.z-index('default');
1718

1819
margin: 6px 4px;
1920

@@ -28,6 +29,10 @@
2829
float: right;
2930
}
3031

32+
&__tooltip {
33+
@include mixins.z-index('tooltip');
34+
}
35+
3136
&__separator {
3237
border-bottom: 1px solid var(--g-color-line-generic);
3338
}

src/bundle/settings/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ const SettingsContent: React.FC<SettingsContentProps> = function SettingsContent
158158
<MarkdownHints />
159159
</div>
160160
}
161+
tooltipClassName={bContent('tooltip')}
161162
placement={mdHelpPlacement}
162163
className={bContent('mode-help')}
163164
/>

src/bundle/sticky/sticky.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@use '../../styles/zindex' as zIndexVars;
1+
@use '../../styles/mixins.scss';
22

33
$block: 'g-md-editor-sticky';
44

@@ -13,7 +13,7 @@ $block: 'g-md-editor-sticky';
1313
}
1414

1515
&_sticky-active:not(.#{$block}_clear) {
16-
z-index: zIndexVars.$sticky-toolbar;
16+
@include mixins.z-index('sticky-toolbar');
1717

1818
padding: var(--g-md-toolbar-sticky-padding);
1919

src/extensions/additional/FoldingHeading/plugins/folding.scss

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
@use 'node_modules/@gravity-ui/uikit/styles/mixins.scss' as uikit;
2+
@use '../../../../styles/mixins.scss';
3+
24

35
.pm-h-folding-hidden {
46
display: none;
@@ -12,8 +14,9 @@
1214
position: relative;
1315

1416
&::before {
17+
@include mixins.z-index('forefront');
18+
1519
position: absolute;
16-
z-index: 1;
1720
bottom: -4px;
1821
left: 0;
1922

@@ -30,8 +33,9 @@
3033
}
3134

3235
&::after {
36+
@include mixins.z-index('forefront');
37+
3338
position: absolute;
34-
z-index: 1;
3539
bottom: -8px;
3640
left: 16px;
3741

@@ -47,8 +51,9 @@
4751

4852
.pm-h-folding-label {
4953
&::after {
54+
@include mixins.z-index('forefront');
55+
5056
position: absolute;
51-
z-index: 1;
5257
right: 2px;
5358
bottom: -6px;
5459

src/extensions/additional/Math/view-and-edit.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use '../../../styles/mixins.scss';
2+
13
.math-block {
24
font-family: var(--g-font-family-monospace);
35

@@ -45,8 +47,9 @@
4547
}
4648

4749
&::before {
50+
@include mixins.z-index('background');
51+
4852
position: absolute;
49-
z-index: -1;
5053
inset: -2px;
5154

5255
content: '';

src/extensions/additional/Mermaid/MermaidNodeView/Mermaid.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use '../../../../styles/mixins.scss';
2+
13
.g-md-Mermaid {
24
display: flex;
35
justify-content: space-between;
@@ -32,7 +34,7 @@
3234
}
3335

3436
&__EditorPopover {
35-
z-index: 1;
37+
@include mixins.z-index('forefront');
3638

3739
float: right;
3840
}

src/extensions/additional/YfmHtmlBlock/YfmHtmlBlockNodeView/YfmHtmlBlock.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use '../../../../styles/mixins.scss';
2+
13
.g-md-yfm-html-block {
24
position: relative;
35

@@ -65,7 +67,7 @@
6567
}
6668

6769
&__editor-popover {
68-
z-index: 1;
70+
@include mixins.z-index('forefront');
6971

7072
float: right;
7173
}

src/extensions/behavior/Cursor/gapcursor.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use '../../../styles//mixins.scss';
2+
13
.Prosemirror-hide-cursor {
24
caret-color: transparent;
35
}
@@ -27,8 +29,9 @@
2729
}
2830

2931
&::before {
32+
@include mixins.z-index('forefront');
33+
3034
position: relative;
31-
z-index: 1;
3235

3336
display: inline-block;
3437

0 commit comments

Comments
 (0)