diff --git a/site/src/components/Demo.tsx b/site/src/components/Demo.tsx index e5a6a679..6805bbb6 100644 --- a/site/src/components/Demo.tsx +++ b/site/src/components/Demo.tsx @@ -157,7 +157,12 @@ const Demo = React.forwardRef(function Demo( )} - {code && {code}} + {code && ( + // Pad the right side of the first line to make room for tabs: + + {code} + + )} ) }) diff --git a/site/src/components/code.module.css b/site/src/components/code.module.css index f1ce0902..2c86d191 100644 --- a/site/src/components/code.module.css +++ b/site/src/components/code.module.css @@ -2,15 +2,18 @@ /* Make sure there's space to scroll around it: */ max-height: clamp(5rem, 100vh - var(--fluid), 40rem); overflow-x: auto; - white-space: normal; tab-size: 2; - @apply dark:border-faint ~fluid-[13rem]/[15rem] rounded-lg !bg-zinc-950 !p-5 !text-sm [scrollbar-color:theme(colors.white/.3)_transparent] [scrollbar-width:thin] dark:border dark:!bg-zinc-900 dark:[scrollbar-color:theme(colors.white/.1)_transparent]; + @apply dark:border-faint ~fluid-[13rem]/[15rem] rounded-lg !bg-zinc-950 !px-0 !py-5 !text-sm [scrollbar-color:theme(colors.white/.3)_transparent] [scrollbar-width:thin] dark:border dark:!bg-zinc-900 dark:[scrollbar-color:theme(colors.white/.1)_transparent]; +} + +.code :global(code) { + display: grid; + min-width: 100%; } .code :global(.line) { - display: block; - white-space: pre; + @apply inline-block px-5; } .code :global(.line:empty):before {