Skip to content

Commit

Permalink
CSS: Set contain on kint dumps to help client side performance
Browse files Browse the repository at this point in the history
The contain and content-visibility properties are very new and
can actually break rendering entirely in different circumstances
for different browsers.

For now we'll stick to good old display:none and just hope contain
implementations get good enough to give us some perf down the line.
  • Loading branch information
jnvsor committed Dec 30, 2024
1 parent 9d3a86b commit 39da434
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 5 deletions.
Binary file modified build/kint.phar
Binary file not shown.
2 changes: 1 addition & 1 deletion resources/compiled/aante-dark.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/compiled/aante-light.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/compiled/original.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/compiled/solarized-dark.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/compiled/solarized.css

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions resources/sass/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
white-space: nowrap;
background: var(--backdrop-color);
direction: ltr;
contain: content;

&.kint-folder {
position: fixed;
Expand Down Expand Up @@ -152,10 +153,12 @@
dt.kint-parent + dd {
display: none;
border-left: 1px dashed var(--border-color);
contain: strict;
}

dt.kint-parent.kint-show + dd {
display: block;
contain: content;
}

// Other styles
Expand Down Expand Up @@ -370,9 +373,11 @@

&.kint-tab-contents > li {
display: none;
contain: strict;

&.kint-show {
display: block;
contain: content;
}
}
}
Expand Down

0 comments on commit 39da434

Please sign in to comment.