Skip to content

Commit 4a5e8a8

Browse files
committed
Fix layout shift
The `main` element is, weirdly enough, not part of the `docRoot` element at first load. So I'm just specifically targeting the docRoot width under these conditions.
1 parent cff2fb9 commit 4a5e8a8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docusaurus/src/scss/_base.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ main {
2424
}
2525
}
2626

27+
[class*="docRoot"]:not(:has(main)) {
28+
width: 0;
29+
}
30+
2731
/**
2832
* Experimental: Different identity based on URL
2933
*/
@@ -59,8 +63,13 @@ main {
5963
padding-right: 32px !important;
6064
}
6165
}
66+
67+
[class*="docRoot"]:not(:has(main)) {
68+
width: 300px;
69+
}
6270
}
6371

72+
6473
/** Dark mode */
6574
@include dark {
6675
.container img[width="16"] {

0 commit comments

Comments
 (0)