diff --git a/src/app/[...slug]/layout.tsx b/src/app/[...slug]/layout.tsx index b0b0b7d1..d3622fc7 100644 --- a/src/app/[...slug]/layout.tsx +++ b/src/app/[...slug]/layout.tsx @@ -108,19 +108,13 @@ export default async function Layout({ params, children }: Props) {
- - {previousPage.title} - + {previousPage.title}
)} @@ -129,19 +123,13 @@ export default async function Layout({ params, children }: Props) {
- - {nextPage.title} - + {nextPage.title}
)} diff --git a/src/app/[...slug]/page.tsx b/src/app/[...slug]/page.tsx index 4b70ff5d..2b9500e4 100644 --- a/src/app/[...slug]/page.tsx +++ b/src/app/[...slug]/page.tsx @@ -41,8 +41,8 @@ export default async function Page({ params }: Props) { return ( <>
-
-

{doc?.title}

+
+

{doc?.title}

{!!doc?.description?.length && (

{doc.description} diff --git a/src/app/globals.css b/src/app/globals.css index 487dd481..19898df4 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -13,26 +13,10 @@ body { font-optical-sizing: auto; } -pre, -code, -code span { - font-family: 'Inconsolata', monospace !important; -} - -/* Inline code */ -:not(pre) > code { - @apply bg-surface-container-high rounded-md px-1.5 py-0.5; -} - /* Start purging... */ @tailwind components; /* Stop purging. */ -/* Write your own custom component styles here */ -.btn-blue { - @apply bg-primary-container rounded px-4 py-2 font-bold; -} - /* Start purging... */ @tailwind utilities; /* Stop purging. */ @@ -50,127 +34,7 @@ code span { } .content-container :target { - /* 's h-16 + more spacing */ - scroll-margin-top: theme('spacing.20'); -} - -.content-container ul > li { - @apply my-2; -} - -.content-container ul > li:before { - content: '—'; - @apply mr-3 inline-block; -} - -.content-container :is(pre, code) { - @apply text-sm; -} - -.content-container pre { - @apply mb-8 overflow-hidden overflow-x-auto rounded p-4; -} - -main a { - @apply text-primary; -} - -.content-container .heading { - @apply block font-bold text-on-surface no-underline hover:underline; -} - -blockquote p { - @apply text-on-surface-variant/50; -} - -details { - @apply ml-4; -} - -summary { - @apply -ml-4 mb-2 cursor-pointer select-none; -} - -table { - @apply bg-surface-container-low; -} - -th { - @apply px-6 py-3 text-left text-xs font-medium uppercase tracking-wide; -} - -thead { - /* @apply bg-gray-50 dark:bg-gray-800; */ - @apply text-on-surface-variant/50; -} - -tbody tr:nth-child(even) { - /* @apply bg-white dark:bg-gray-900; */ - @apply bg-surface; -} - -tbody tr:nth-child(odd) { - /* @apply bg-gray-50 dark:bg-gray-800; */ -} - -td { - @apply px-6 py-4 text-sm; -} - -td:first-child { - @apply font-medium; -} - -ul.grid-list > li:before { - display: none; -} - -/* #intro-demos { - display: flex; - flex-flow: row nowrap; - justify-content: space-around; - align-items: center; - margin: 2em auto; - max-width: 900px; -} -#intro-demos .demo-cell { - padding-right: 10px; -} - -#intro-demos .demo-cell img.laptop { - max-width: 410px; -} - -#intro-demos .demo-cell img { - width: 100%; - margin-right: 10px; -} - -#intro-demos .demo-cell img.tablet { - max-width: 280px; -} - -#intro-demos .demo-cell img.phone { - max-width: 90px; -} - -.demo-grid { - grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); -} - -.demo-grid > div:last-of-type:nth-child(odd) { - grid-column: 1 / -1; -} */ - -.search-item.focus-visible li > div { - /* @apply bg-gray-800 text-gray-200; */ -} - -.hint p { - /* @apply dark:text-gray-500; */ -} -.hint p.mb-4:last-of-type { - margin-bottom: 0; + scroll-margin-top: theme('spacing.20'); /* 's h-16 + more spacing */ } /** @@ -182,23 +46,13 @@ ul.grid-list > li:before { code[class*='language-'], pre[class*='language-'] { background: none; - /* color: #e4f0fb; - text-shadow: 0 1px rgba(0, 0, 0, 0.3); */ - /* font-family: Menlo, Monaco, 'Courier New', monospace; */ text-align: left; white-space: pre; word-spacing: normal; word-break: normal; word-wrap: normal; line-height: 1.5; - - -moz-tab-size: 4; - -o-tab-size: 4; tab-size: 4; - - -webkit-hyphens: none; - -moz-hyphens: none; - -ms-hyphens: none; hyphens: none; } @@ -215,10 +69,7 @@ pre[class*='language-'] { --literal: #fffac2; --falsy: #f087bd; - @apply p-6; - @apply my-5; - @apply overflow-auto; - @apply rounded-lg; + @apply my-5 overflow-auto rounded-lg p-6 font-mono text-sm; } :not(pre) > code[class*='language-'], diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 68a53fed..005d3239 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,5 +1,5 @@ import type { Metadata } from 'next' -import { Inter } from 'next/font/google' +import { Inter, Inconsolata } from 'next/font/google' import './globals.css' import { svg } from '@/utils/icon' import resolveMdxUrl from '@/utils/resolveMdxUrl' @@ -7,6 +7,7 @@ import { ThemeProvider } from 'next-themes' import cn from '@/lib/cn' const inter = Inter({ subsets: ['latin'] }) +const inconsolata = Inconsolata({ subsets: ['latin'] }) const NEXT_PUBLIC_URL = process.env.NEXT_PUBLIC_URL const NEXT_PUBLIC_LIBNAME = process.env.NEXT_PUBLIC_LIBNAME diff --git a/src/components/Codesandbox.tsx b/src/components/Codesandbox.tsx index 2b13305a..39280774 100644 --- a/src/components/Codesandbox.tsx +++ b/src/components/Codesandbox.tsx @@ -57,22 +57,8 @@ export default function Codesandbox({ {!hideTitle && ( <> -

- {title} -
-

- {description} -

+
{title}
+

{description}

{tags.map((tag, i) => ( {tag} diff --git a/src/components/Search/SearchItem.tsx b/src/components/Search/SearchItem.tsx index 2961e655..5f9d8390 100644 --- a/src/components/Search/SearchItem.tsx +++ b/src/components/Search/SearchItem.tsx @@ -40,10 +40,7 @@ function SearchItem({ search, result }: SearchItemProps) { // eslint-disable-next-line @next/next/no-img-element {result.title} ) : ( - + )}
diff --git a/src/components/Search/SearchModal.tsx b/src/components/Search/SearchModal.tsx index 86b44d09..af18884d 100644 --- a/src/components/Search/SearchModal.tsx +++ b/src/components/Search/SearchModal.tsx @@ -18,10 +18,7 @@ function SearchModal({ search, results, onClose, onChange }: SearchModelProps) {
- +
Press diff --git a/src/components/Toc.tsx b/src/components/Toc.tsx index fc59af1c..0148115c 100644 --- a/src/components/Toc.tsx +++ b/src/components/Toc.tsx @@ -31,12 +31,7 @@ function Toc({ toc }: ToCProps) { return (
-