From b13bcc473705fb9e5f1f2e0d89883a0f0c00efbb Mon Sep 17 00:00:00 2001 From: sumy Date: Sun, 3 Mar 2024 19:24:16 +0800 Subject: [PATCH] fix: make outline have a well width (#693) --- .changeset/shy-eagles-laugh.md | 5 +++++ .../src/layout/DocLayout/index.module.scss | 17 ++++++----------- .../src/layout/DocLayout/index.tsx | 2 +- packages/theme-default/src/styles/vars.css | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) create mode 100644 .changeset/shy-eagles-laugh.md diff --git a/.changeset/shy-eagles-laugh.md b/.changeset/shy-eagles-laugh.md new file mode 100644 index 000000000..c3c3f8184 --- /dev/null +++ b/.changeset/shy-eagles-laugh.md @@ -0,0 +1,5 @@ +--- +"@rspress/theme-default": patch +--- + +fix(theme-default): make outline have a well width again diff --git a/packages/theme-default/src/layout/DocLayout/index.module.scss b/packages/theme-default/src/layout/DocLayout/index.module.scss index 39c323c17..ca81e707c 100644 --- a/packages/theme-default/src/layout/DocLayout/index.module.scss +++ b/packages/theme-default/src/layout/DocLayout/index.module.scss @@ -106,7 +106,9 @@ :global(.rspress-doc-footer) { padding: 0 48px; box-sizing: border-box; - width: 100%; + width: calc(100vw - var(--rp-sidebar-width) - var(--rp-aside-width)); + max-width: calc(960px + 48px * 2); + margin: auto; } } } @@ -120,17 +122,10 @@ .content { :global(.rspress-doc), :global(.rspress-doc-footer) { - box-sizing: content-box; + box-sizing: border-box; width: calc(100vw - var(--rp-sidebar-width) - var(--rp-aside-width)); - padding: 0 - max( - 48px, - calc( - (100vw - var(--rp-sidebar-width) - var(--rp-aside-width) - 960px) / - 2 - ) - ); - max-width: 960px; + padding: 0 48px; + max-width: calc(960px + 48px * 2); margin: auto; } } diff --git a/packages/theme-default/src/layout/DocLayout/index.tsx b/packages/theme-default/src/layout/DocLayout/index.tsx index b74752e5d..fd2a853b0 100644 --- a/packages/theme-default/src/layout/DocLayout/index.tsx +++ b/packages/theme-default/src/layout/DocLayout/index.tsx @@ -74,7 +74,7 @@ export function DocLayout(props: DocLayoutProps) {
-
+
{isOverviewPage ? ( ) : ( diff --git a/packages/theme-default/src/styles/vars.css b/packages/theme-default/src/styles/vars.css index 3526137c5..5f953c5d2 100644 --- a/packages/theme-default/src/styles/vars.css +++ b/packages/theme-default/src/styles/vars.css @@ -4,7 +4,7 @@ :root { --rp-nav-height: 72px; --rp-sidebar-width: 320px; - --rp-aside-width: 368px; + --rp-aside-width: 268px; } :root {