Skip to content

Commit da63050

Browse files
authored
Fix layout shift when elastic-nav is loading (#1532)
* Fix layout shift when elastic-nav is loading * Remove unnecessary height css attribute
1 parent 2037f09 commit da63050

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/Elastic.Documentation.Site/Assets/styles.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,11 @@
177177
}
178178
}
179179

180-
#elastic-nav {
180+
#elastic-nav-wrapper {
181181
min-height: var(--offset-top);
182+
}
182183

184+
#elastic-nav {
183185
@media screen and (min-width: 1200px) {
184186
.oldNav {
185187
& > div {

src/Elastic.Documentation.Site/Layout/_Header.cshtml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
@inherits RazorSlice<Elastic.Documentation.Site.GlobalLayoutViewModel>
22
@if (Model.Features.PrimaryNavEnabled)
33
{
4-
<div id="elastic-nav" hx-disable="true"></div>
5-
<script src="https://www.elastic.co/elastic-nav.js" async></script>
4+
<div id="elastic-nav-wrapper">
5+
<div id="elastic-nav" hx-disable="true"></div>
6+
<script src="https://www.elastic.co/elastic-nav.js"></script>
7+
</div>
68
@await RenderPartialAsync(_SecondaryNav.Create(Model))
79
}
810
else

0 commit comments

Comments
 (0)