Skip to content

Commit

Permalink
Use less.js pageLoadFinished event for bodyWrapperMarginTop
Browse files Browse the repository at this point in the history
  • Loading branch information
atas committed Oct 12, 2023
1 parent a0eaeeb commit 5d1b5e1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions assets/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,13 @@ window.addEventListener('DOMContentLoaded', function() {
});
});
});

// When less.js finishes loading, call setBodyWrapperMarginTop() to get a correct margin.
// In production this has no effect as less.js is only used in development.
if (typeof less !== 'undefined' && less.pageLoadFinished) {
less.pageLoadFinished.then(
function() {
setBodyWrapperMarginTop();
}
);
}

0 comments on commit 5d1b5e1

Please sign in to comment.