From cdc65a3636c8c4f83378ece8d0b644a8cff7a479 Mon Sep 17 00:00:00 2001 From: sendevia Date: Tue, 23 Sep 2025 12:27:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../theme/styles/_components/table.scss | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 .vitepress/theme/styles/_components/table.scss diff --git a/.vitepress/theme/styles/_components/table.scss b/.vitepress/theme/styles/_components/table.scss new file mode 100644 index 0000000..40287be --- /dev/null +++ b/.vitepress/theme/styles/_components/table.scss @@ -0,0 +1,96 @@ +@use "../mixin"; + +table { + display: inline-block; + + max-width: max-content; + width: 100%; + + border-collapse: collapse; + border-radius: var(--md-sys-shape-corner-extra-large); + + box-shadow: 0 0 0 1px var(--md-sys-color-outline); + overflow: auto; + + a { + text-decoration: none; + } + + caption { + @include mixin.typescale-style("title-medium", $font-weight: 700); + + padding: 16px 0px; + + text-transform: uppercase; + + background-color: var(--md-sys-color-surface-variant); + + transition: background-color var(--md-sys-motion-duration-extra-long1) var(--md-sys-motion-easing-standard); + } + + thead { + @include mixin.typescale-style("body-large", $font-weight: 700); + + white-space: nowrap; + + tr { + th { + min-width: 10ch; + + padding: 16px 24px; + + text-transform: capitalize; + + border: 1px solid var(--md-sys-color-outline); + border-top: none; + + background-color: var(--md-sys-color-surface-variant); + + transition: background-color var(--md-sys-motion-duration-extra-long1) var(--md-sys-motion-easing-standard); + + &:first-child { + border-left: none; + } + + &:last-child { + border-right: none; + } + } + } + } + + tbody { + @include mixin.typescale-style("body-large"); + + img { + max-width: 375px; + } + + tr { + vertical-align: top; + + td { + padding: 16px 24px; + + min-width: 120px; + + vertical-align: inherit; + + border: 1px solid var(--md-sys-color-outline); + border-bottom: none; + + code { + white-space: nowrap; + } + + &:first-child { + border-left: none; + } + + &:last-child { + border-right: none; + } + } + } + } +}