From 879961b00497277624ad3dc2c6809d612397583d Mon Sep 17 00:00:00 2001 From: Suzu <47468734+Suzu-Gears@users.noreply.github.com> Date: Fri, 28 Jul 2023 02:16:49 +0900 Subject: [PATCH] Add Codeblock horizontal scroll --- src/components/notion-blocks/Code.astro | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/components/notion-blocks/Code.astro b/src/components/notion-blocks/Code.astro index 437af37c5..31ec3cd45 100644 --- a/src/components/notion-blocks/Code.astro +++ b/src/components/notion-blocks/Code.astro @@ -78,6 +78,7 @@ const grammer = .code { display: block; width: 100%; + margin-bottom: 0.6rem; } .code > div { background: rgb(247, 246, 243); @@ -103,7 +104,19 @@ const grammer = padding: 0.8rem 2rem 2rem; font-size: 0.9rem; line-height: 1.2rem; - white-space: pre-wrap; + white-space: pre; + width: 100px; + min-width: 100%; + overflow-x: auto; + &::-webkit-scrollbar { + height: 10px; + } + &::-webkit-scrollbar-thumb { + background: rgb(211, 209, 203); + } + &::-webkit-scrollbar-track { + background: rgb(237, 236, 233); + } } .code pre.mermaid { padding: 2rem;