+
= (props) => {
id="wrapper"
data-theme={isDarkMode ? 'dark' : 'light'}
key={key}
- style={{ height: '100vh', overflow: 'hidden' }}
>
{isPublicSiteOpen && (
= (props) => {
isDarkMode={isDarkMode}
/>
)}
+
}
className={getClassName()}
- style={{
- height: !docContent
- ? MAIN_HEIGHT_WITHOUT_DOC_CONTENT
- : 'calc(100vh - 60px)',
- overflow: 'auto',
- }}
+ ref={ref as React.RefObject}
+ style={
+ !isPublicSiteOpen
+ ? { height: '100lvh' }
+ : { height: 'calc(100lvh - 65px)' }
+ }
>
- {isPlayGround ? renderPlayGround() : renderDocTemplate()}
+ {isPlayGround ? (
+
+ {renderPlayGround()}
+
+ ) : (
+ renderDocTemplate()
+ )}
>
diff --git a/src/components/Docmap/index.scss b/src/components/Docmap/index.scss
index a9bf5bf11..18282a2d4 100644
--- a/src/components/Docmap/index.scss
+++ b/src/components/Docmap/index.scss
@@ -1,13 +1,9 @@
@import '../../assets/styles/variables.scss';
.docmapLinks {
- width: 16%;
- padding: 10px $padding-md 80px $padding-md;
- position: fixed;
- right: 0;
+ width: -webkit-fill-available;
font-size: 14px;
- height: 100vh;
- overflow-y: auto;
+ height: 100lvh;
.tocTitle {
margin: 0;
diff --git a/src/components/Docmap/index.tsx b/src/components/Docmap/index.tsx
index 0a4150dde..44325f3da 100644
--- a/src/components/Docmap/index.tsx
+++ b/src/components/Docmap/index.tsx
@@ -18,15 +18,18 @@ const Docmap = (props: {
const tocEl = doc.querySelector('#toc');
if (tocEl) {
const { hash } = props.location;
+ setToc(tocEl.innerHTML);
if (hash) {
const ele = document.querySelector(hash);
if (ele) {
- document.documentElement.scrollTop =
- (ele as HTMLElement).offsetTop -
- INTRO_WRAPPER_MARGIN_TOP;
+ ele.scrollIntoView({
+ block: 'start',
+ });
+
+ // Apply offset to keep header visible
+ window.scrollBy(0, -55);
}
}
- setToc(tocEl.innerHTML);
} else {
setToc('');
}
@@ -50,7 +53,10 @@ const Docmap = (props: {
toc !== '' && (
{t('RIGHT_NAV_SIDERBAR_TITLE')}
-
+
)
);
diff --git a/src/components/Document/index.scss b/src/components/Document/index.scss
index 7adb26298..957f0871e 100644
--- a/src/components/Document/index.scss
+++ b/src/components/Document/index.scss
@@ -4,7 +4,7 @@
@import '../../assets/styles/grid.scss';
.documentWrapper {
- width: calc(100% - #{$docmap-width-desktop});
+ width: calc(100%);
color: var(--primary-color);
.documentView {
@@ -24,16 +24,6 @@
visibility: hidden;
}
- /* Optional: apply scroll-margin to headings */
- h1[id],
- h2[id],
- h3[id],
- h4[id],
- h5[id],
- h6[id] {
- scroll-margin-top: 70px;
- }
-
.scroll-container {
scroll-behavior: smooth;
scroll-padding-top: 65px;
@@ -330,7 +320,7 @@ pre {
@media screen and (min-width: $tablet-resolution-min) and (max-width: $tablet-resolution-max) {
.documentWrapper {
- width: calc(100% - #{$docmap-width-tablet});
+ width: -webkit-fill-available;
}
}
diff --git a/src/components/Header/index.scss b/src/components/Header/index.scss
index 85ad2f782..f0bc8632e 100644
--- a/src/components/Header/index.scss
+++ b/src/components/Header/index.scss
@@ -2,9 +2,11 @@
header {
background: var(--header-color);
- position: fixed;
+ position: absolute;
+ top: 0;
+ left: 0;
width: 100%;
- height: 65px;
+ height: $header-height;
border-bottom: var(--header-border-color);
z-index: $header-zIndex;
diff --git a/src/components/LeftSidebar/NavContent.tsx b/src/components/LeftSidebar/NavContent.tsx
index 52ce03f79..7629d9022 100644
--- a/src/components/LeftSidebar/NavContent.tsx
+++ b/src/components/LeftSidebar/NavContent.tsx
@@ -19,7 +19,8 @@ const NavContent = (props: {
return (