Skip to content

Commit 95192d2

Browse files
authored
Merge pull request #238 from atom-ide-community/css-containment
2 parents b250011 + 3ced63d commit 95192d2

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

static/core-ui/text-editor.less

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
@import "ui-variables";
22
@import "octicon-utf-codes";
33
@import "octicon-mixins";
4+
@import "utils.less";
45

56
:root {
67
// Fixes specs
78
--editor-font-family: Menlo, Consolas, 'DejaVu Sans Mono', monospace;
89
}
910

10-
@contain_all: layout size paint style;
11-
@contain_but_size: layout paint style;
12-
@contain_but_layout: size paint style;
13-
@contain_but_paint: layout size style;
14-
1511
atom-text-editor {
1612
contain: @contain_but_size;
1713
display: flex;
@@ -40,7 +36,7 @@ atom-text-editor {
4036

4137
.gutter:hover {
4238
.line-number.foldable .icon-right {
43-
contain: paint style;
39+
contain: @contain_but_layout_size;
4440
visibility: visible;
4541

4642
&:hover {
@@ -51,7 +47,7 @@ atom-text-editor {
5147

5248
.gutter, .gutter:hover {
5349
.line-number.folded .icon-right {
54-
contain: paint style;
50+
contain: @contain_but_layout_size;
5551
.octicon(chevron-right, 0.8em);
5652

5753
visibility: visible;
@@ -77,7 +73,7 @@ atom-text-editor {
7773
position: relative;
7874

7975
.icon-right {
80-
contain: paint style;
76+
contain: @contain_but_layout_size;
8177
.octicon(chevron-down, 0.8em);
8278
display: inline-block;
8379
visibility: hidden;
@@ -136,7 +132,7 @@ atom-text-editor {
136132
}
137133

138134
.indent-guide {
139-
contain: paint style;
135+
contain: @contain_but_layout_size;
140136
display: inline-block;
141137
box-shadow: inset 1px 0;
142138
}

static/core-ui/utils.less

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
// CSS containment variables.
3+
// The words after `but` explicitly show the excluded/incompatible values.
4+
@contain_all: layout size paint style;
5+
@contain_but_layout: size paint style;
6+
@contain_but_size: layout paint style;
7+
@contain_but_paint: layout size style;
8+
@contain_but_layout_size: paint style;
9+
@contain_but_layout_paint: size style;
10+
@containt_but_size_paint: layout style;

static/core-ui/workspace-view.less

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
@import "ui-variables";
2+
@import "utils";
23

34
atom-workspace {
5+
contain: @contain_all;
46
display: flex;
57
flex-direction: column;
68
height: 100%;
@@ -11,17 +13,20 @@ atom-workspace {
1113
font-family: @font-family;
1214

1315
atom-workspace-axis {
16+
contain: @contain_but_layout_paint;
1417
position: relative;
1518
}
1619

1720
atom-workspace-axis.horizontal {
21+
contain: @contain_but_layout_paint;
1822
display: flex;
1923
flex: 1;
2024
min-width: 0;
2125
min-height: 0;
2226
}
2327

2428
atom-workspace-axis.vertical {
29+
contain: @contain_but_layout_paint;
2530
display: flex;
2631
flex: 1;
2732
flex-direction: column;

0 commit comments

Comments
 (0)