Skip to content

Commit 5ad7fd1

Browse files
manucorporatadamdbradley
authored andcommitted
perf(rendering): add css containment
1 parent 624cb35 commit 5ad7fd1

File tree

15 files changed

+69
-16
lines changed

15 files changed

+69
-16
lines changed

src/components/action-sheet/test/basic/main.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@
1010
<ion-content padding>
1111

1212
<button ion-button block class="e2eOpenActionSheet" (click)="presentActionSheet1()">Present Action Sheet 1</button>
13-
<button ion-button block (click)="presentActionSheet2()">
14-
Present Action Sheet 2
15-
<span style="font-size:0.5em; text-transform: none"> (enableBackdropDismiss: false)</span>
16-
</button>
13+
<button ion-button block (click)="presentActionSheet2()">Present Action Sheet 2</button>
1714
<button ion-button block (click)="presentActionSheet3()">Present Action Sheet 3</button>
1815

1916
<pre>

src/components/alert/alert.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ ion-alert {
2222

2323
align-items: center;
2424
justify-content: center;
25+
26+
contain: strict;
2527
}
2628

2729
ion-alert.alert-top {
@@ -44,6 +46,8 @@ ion-alert input {
4446
max-height: $alert-max-height;
4547

4648
opacity: 0;
49+
50+
contain: content;
4751
}
4852

4953
.alert-title {

src/components/app/app.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,14 @@ ion-tab.show-tab {
9292
transform: translateY(0);
9393
}
9494

95+
ion-app,
96+
ion-nav,
97+
ion-tab,
98+
.app-root,
99+
.ion-page {
100+
contain: strict;
101+
}
102+
95103

96104
// Page Container Structure
97105
// --------------------------------------------------

src/components/button/button.md.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ $button-md-round-border-radius: $button-round-border-radius !def
166166
// --------------------------------------------------
167167

168168
.button-md {
169+
overflow: hidden;
170+
169171
margin: $button-md-margin;
170172
padding: $button-md-padding;
171173

src/components/button/button.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ $button-round-border-radius: 64px !default;
1616
position: relative;
1717
z-index: 0;
1818
display: inline-block;
19-
overflow: hidden;
2019

2120
text-align: center;
2221
text-overflow: ellipsis;
@@ -31,6 +30,8 @@ $button-round-border-radius: 64px !default;
3130

3231
font-kerning: none;
3332
user-select: none;
33+
34+
contain: content;
3435
}
3536

3637
.button-inner {
@@ -68,6 +69,8 @@ button[disabled],
6869
clear: both;
6970

7071
width: 100%;
72+
73+
contain: strict;
7174
}
7275

7376
.button-block::after {
@@ -82,6 +85,8 @@ button[disabled],
8285
display: block;
8386

8487
width: 100%;
88+
89+
contain: strict;
8590
}
8691

8792
// Full Outline Button

src/components/content/content.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ ion-content {
1111

1212
width: 100%;
1313
height: 100%;
14+
15+
contain: layout size style;
1416
}
1517

1618
.ion-page > ion-content {
@@ -38,6 +40,8 @@ a {
3840
overflow-y: scroll;
3941
-webkit-overflow-scrolling: touch;
4042
will-change: scroll-position;
43+
44+
contain: size style layout;
4145
}
4246

4347
ion-content.js-scroll > .scroll-content {

src/components/fab/fab.scss

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ $fab-list-button-background-color: #f4f4f4 !default;
4444
font-kerning: none;
4545
user-select: none;
4646

47-
ion-icon {
48-
flex: 1;
47+
contain: strict;
48+
}
4949

50-
font-size: 2.4rem;
51-
}
50+
.fab ion-icon {
51+
flex: 1;
52+
53+
font-size: 2.4rem;
5254
}
5355

5456
// FAB mini
@@ -61,10 +63,10 @@ $fab-list-button-background-color: #f4f4f4 !default;
6163
height: $fab-mini-size;
6264

6365
line-height: $fab-mini-size;
66+
}
6467

65-
.fab-close-icon {
66-
line-height: $fab-mini-size;
67-
}
68+
.fab[mini] .fab-close-icon {
69+
line-height: $fab-mini-size;
6870
}
6971

7072

src/components/item/item.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
// ion-item
1515
// [ion-item]
1616

17+
.item {
18+
contain: content;
19+
}
1720

1821
.item-block {
1922
display: flex;

src/components/loading/loading.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ ion-loading {
1515

1616
align-items: center;
1717
justify-content: center;
18+
19+
contain: strict;
1820
}
1921

2022
.loading-wrapper {

src/components/menu/menu.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ ion-menu {
1515
left: 0;
1616

1717
display: none;
18+
19+
contain: strict;
1820
}
1921

2022
ion-menu.show-menu {
@@ -32,8 +34,11 @@ ion-menu.show-menu {
3234
display: block;
3335

3436
width: $menu-width;
37+
height: 100%;
3538

3639
transform: translate3d(-9999px, 0, 0);
40+
41+
contain: strict;
3742
}
3843

3944
.menu-inner > ion-header,

0 commit comments

Comments
 (0)