Skip to content

Commit 9f410e1

Browse files
authored
Add the animation post load instead of before to reduce flash (#116)
When the sidebar was animating on the initial load, it would flash animate. This way the animation is applied after the first render.
1 parent c591091 commit 9f410e1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

theme/book.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,9 @@ function playground_text(playground, hidden = true) {
462462
}
463463
});
464464

465+
// Don't animate until we have loaded so we don't get flash
466+
document.getElementById("body-container").style.transition = "all 300ms";
467+
465468
sidebarResizeHandle.addEventListener("mousedown", initResize, false);
466469

467470
function initResize(e) {

theme/css/chrome.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ a > .hljs {
8282
will want to reposition the viewport in a weird way.
8383
*/
8484
overflow-x: clip;
85-
transition: 200ms;
8685
}
8786

8887
/* Menu Bar */

0 commit comments

Comments
 (0)