diff --git a/.changeset/docs-markdown-tables.md b/.changeset/docs-markdown-tables.md new file mode 100644 index 000000000..b071001e3 --- /dev/null +++ b/.changeset/docs-markdown-tables.md @@ -0,0 +1,5 @@ +--- +"@tabler/docs": patch +--- + +Updated markdown tables in the docs with a bordered, scrollable `.docs-table` box and a tighter header row. diff --git a/.changeset/pre-font-size.md b/.changeset/pre-font-size.md new file mode 100644 index 000000000..887f94bd0 --- /dev/null +++ b/.changeset/pre-font-size.md @@ -0,0 +1,5 @@ +--- +"@tabler/core": patch +--- + +Updated `pre` font size to 13px with a new `$pre-font-size` variable, and `$markdown-pre-font-size` for `.markdown`. diff --git a/core/scss/_variables.scss b/core/scss/_variables.scss index 4ed90a11b..40168dd00 100644 --- a/core/scss/_variables.scss +++ b/core/scss/_variables.scss @@ -778,6 +778,7 @@ $code-color: light-dark(var(--gray-600), var(--gray-400)) !default; $code-bg: light-dark(var(--gray-100), var(--gray-900)) !default; $code-font-size: $font-size-reative-sm !default; +$pre-font-size: 0.92857143em !default; $pre-padding: 1rem !default; $pre-bg: var(--bg-surface-dark) !default; $pre-color: var(--light) !default; @@ -2241,6 +2242,7 @@ $markdown-blockquote-margin-y: 1.5rem !default; $markdown-blockquote-padding-y: 0.5rem !default; $markdown-blockquote-padding-x: 1.5rem !default; $markdown-pre-max-height: 20rem !default; +$markdown-pre-font-size: 0.8125em !default; // Calendar $calendar-padding-y: 0.5rem !default; diff --git a/core/scss/ui/_markdown.scss b/core/scss/ui/_markdown.scss index 2d8779b65..f1eff867b 100644 --- a/core/scss/ui/_markdown.scss +++ b/core/scss/ui/_markdown.scss @@ -72,5 +72,6 @@ Prose (formerly markdown) pre { max-height: var(--markdown-pre-max-height); + font-size: $markdown-pre-font-size; } } diff --git a/core/scss/ui/_type.scss b/core/scss/ui/_type.scss index 4a13dc90a..85fa801f7 100644 --- a/core/scss/ui/_type.scss +++ b/core/scss/ui/_type.scss @@ -129,6 +129,7 @@ dl { pre { --scrollbar-color: #{$pre-color}; padding: $pre-padding; + font-size: $pre-font-size; line-height: $line-height-base; color: $pre-color; background: $pre-bg; diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index 095b79f09..5e92ac37d 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -4,6 +4,7 @@ import vercel from '@astrojs/vercel' import mdx from '@astrojs/mdx' import { satteri } from '@astrojs/markdown-satteri' import { unwrapJsxParagraphs } from './lib/satteri-unwrap-jsx-paragraphs.mjs' +import { wrapTables } from './lib/satteri-wrap-tables.mjs' import { fileURLToPath } from 'node:url' import { copyAssets } from '../.build/copy-assets' import { redirects } from './lib/redirects.ts' @@ -111,7 +112,11 @@ export default defineConfig({ ], markdown: { // No typographic quote rewriting. - processor: satteri({ features: { smartPunctuation: false }, mdastPlugins: [unwrapJsxParagraphs] }), + processor: satteri({ + features: { smartPunctuation: false }, + mdastPlugins: [unwrapJsxParagraphs], + hastPlugins: [wrapTables], + }), shikiConfig: { theme: 'github-dark', }, diff --git a/docs/lib/satteri-wrap-tables.mjs b/docs/lib/satteri-wrap-tables.mjs new file mode 100644 index 000000000..db562bd1f --- /dev/null +++ b/docs/lib/satteri-wrap-tables.mjs @@ -0,0 +1,23 @@ +// A markdown table is only as wide as the prose column, so an options table +// with four columns either squeezes its description or, on a phone, pushes the +// whole page sideways. Every docs system (Starlight, VitePress, GitHub) puts +// the table in a scrolling box instead; this does the same with a wrapper +// element, which keeps the `