feat: add side toc support and update toc style

This commit is contained in:
st1020 2025-10-02 20:07:02 +08:00
parent 9d208b7bd1
commit b7a197c648
10 changed files with 291 additions and 241 deletions

View file

@ -1,4 +1,4 @@
@import "tailwindcss";
@import "tailwindcss" source("../templates");
@plugin "@tailwindcss/typography";
@custom-variant dark (&:where(.dark, .dark *));

View file

@ -1,4 +1,4 @@
/*! tailwindcss v4.1.11 | MIT License | https://tailwindcss.com */
/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */
@layer properties;
@layer theme, base, components, utilities;
@layer theme {
@ -26,6 +26,7 @@
--text-3xl--line-height: calc(2.25 / 1.875);
--text-9xl: 8rem;
--text-9xl--line-height: 1;
--font-weight-normal: 400;
--font-weight-medium: 500;
--font-weight-semibold: 600;
--font-weight-bold: 700;
@ -169,6 +170,9 @@
::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {
padding-block: 0;
}
::-webkit-calendar-picker-indicator {
line-height: 1;
}
:-moz-ui-invalid {
box-shadow: none;
}
@ -183,9 +187,6 @@
}
}
@layer utilities {
.visible {
visibility: visible;
}
.absolute {
position: absolute;
}
@ -195,6 +196,9 @@
.relative {
position: relative;
}
.sticky {
position: sticky;
}
.inset-0 {
inset: calc(var(--spacing) * 0);
}
@ -213,6 +217,15 @@
.z-50 {
z-index: 50;
}
.order-1 {
order: 1;
}
.order-2 {
order: 2;
}
.order-3 {
order: 3;
}
.mx-1 {
margin-inline: calc(var(--spacing) * 1);
}
@ -325,7 +338,7 @@
}
:where(hr):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
border-color: var(--tw-prose-hr);
border-top-width: 1;
border-top-width: 1px;
margin-top: 3em;
margin-bottom: 3em;
}
@ -410,7 +423,7 @@
font-weight: 500;
font-family: inherit;
color: var(--tw-prose-kbd);
box-shadow: 0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%), 0 3px 0 rgb(var(--tw-prose-kbd-shadows) / 10%);
box-shadow: 0 0 0 1px var(--tw-prose-kbd-shadows), 0 3px 0 var(--tw-prose-kbd-shadows);
font-size: 0.875em;
border-radius: 0.3125rem;
padding-top: 0.1875em;
@ -546,7 +559,7 @@
--tw-prose-quote-borders: oklch(92.8% 0.006 264.531);
--tw-prose-captions: oklch(55.1% 0.027 264.364);
--tw-prose-kbd: oklch(21% 0.034 264.665);
--tw-prose-kbd-shadows: NaN NaN NaN;
--tw-prose-kbd-shadows: color-mix(in oklab, oklch(21% 0.034 264.665) 10%, transparent);
--tw-prose-code: oklch(21% 0.034 264.665);
--tw-prose-pre-code: oklch(92.8% 0.006 264.531);
--tw-prose-pre-bg: oklch(27.8% 0.033 256.848);
@ -564,7 +577,7 @@
--tw-prose-invert-quote-borders: oklch(37.3% 0.034 259.733);
--tw-prose-invert-captions: oklch(70.7% 0.022 261.325);
--tw-prose-invert-kbd: #fff;
--tw-prose-invert-kbd-shadows: 255 255 255;
--tw-prose-invert-kbd-shadows: rgb(255 255 255 / 10%);
--tw-prose-invert-code: #fff;
--tw-prose-invert-pre-code: oklch(87.2% 0.01 258.338);
--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);
@ -667,6 +680,9 @@
.mt-16 {
margin-top: calc(var(--spacing) * 16);
}
.mt-48 {
margin-top: calc(var(--spacing) * 48);
}
.mr-1\.5 {
margin-right: calc(var(--spacing) * 1.5);
}
@ -697,6 +713,9 @@
.ml-1\.5 {
margin-left: calc(var(--spacing) * 1.5);
}
.ml-2 {
margin-left: calc(var(--spacing) * 2);
}
.ml-4 {
margin-left: calc(var(--spacing) * 4);
}
@ -712,6 +731,9 @@
.grid {
display: grid;
}
.hidden {
display: none;
}
.inline {
display: inline;
}
@ -733,6 +755,12 @@
.h-full {
height: 100%;
}
.h-min {
height: min-content;
}
.max-h-lvh {
max-height: 100lvh;
}
.min-h-\[3\.5rem\] {
min-height: 3.5rem;
}
@ -751,6 +779,9 @@
.w-16 {
width: calc(var(--spacing) * 16);
}
.w-\[calc\(\(100\%-var\(--container-3xl\)\)\/2\)\] {
width: calc((100% - var(--container-3xl)) / 2);
}
.w-full {
width: 100%;
}
@ -772,9 +803,6 @@
.basis-full {
flex-basis: 100%;
}
.transform {
transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);
}
.cursor-pointer {
cursor: pointer;
}
@ -829,6 +857,9 @@
text-overflow: ellipsis;
white-space: nowrap;
}
.overflow-y-auto {
overflow-y: auto;
}
.rounded-full {
border-radius: calc(infinity * 1px);
}
@ -987,6 +1018,9 @@
.py-4 {
padding-block: calc(var(--spacing) * 4);
}
.pt-18 {
padding-top: calc(var(--spacing) * 18);
}
.pt-24 {
padding-top: calc(var(--spacing) * 24);
}
@ -1005,6 +1039,9 @@
.pb-2\.5 {
padding-bottom: calc(var(--spacing) * 2.5);
}
.pb-4 {
padding-bottom: calc(var(--spacing) * 4);
}
.pb-16 {
padding-bottom: calc(var(--spacing) * 16);
}
@ -1145,7 +1182,7 @@
--tw-prose-quote-borders: oklch(92.2% 0 0);
--tw-prose-captions: oklch(55.6% 0 0);
--tw-prose-kbd: oklch(20.5% 0 0);
--tw-prose-kbd-shadows: NaN NaN NaN;
--tw-prose-kbd-shadows: color-mix(in oklab, oklch(20.5% 0 0) 10%, transparent);
--tw-prose-code: oklch(20.5% 0 0);
--tw-prose-pre-code: oklch(92.2% 0 0);
--tw-prose-pre-bg: oklch(26.9% 0 0);
@ -1163,7 +1200,7 @@
--tw-prose-invert-quote-borders: oklch(37.1% 0 0);
--tw-prose-invert-captions: oklch(70.8% 0 0);
--tw-prose-invert-kbd: #fff;
--tw-prose-invert-kbd-shadows: 255 255 255;
--tw-prose-invert-kbd-shadows: rgb(255 255 255 / 10%);
--tw-prose-invert-code: #fff;
--tw-prose-invert-pre-code: oklch(87% 0 0);
--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);
@ -1196,13 +1233,6 @@
}
}
}
.hover\:underline {
&:hover {
@media (hover: hover) {
text-decoration-line: underline;
}
}
}
.active\:scale-95 {
&:active {
--tw-scale-x: 95%;
@ -1231,6 +1261,11 @@
margin-left: calc(var(--spacing) * 6);
}
}
.lg\:block {
@media (width >= 64rem) {
display: block;
}
}
.lg\:flex {
@media (width >= 64rem) {
display: flex;
@ -1356,6 +1391,42 @@
--tw-prose-td-borders: var(--tw-prose-invert-td-borders);
}
}
.prose-a\:block {
& :is(:where(a):not(:where([class~="not-prose"],[class~="not-prose"] *))) {
display: block;
}
}
.prose-a\:truncate {
& :is(:where(a):not(:where([class~="not-prose"],[class~="not-prose"] *))) {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.prose-a\:font-normal {
& :is(:where(a):not(:where([class~="not-prose"],[class~="not-prose"] *))) {
--tw-font-weight: var(--font-weight-normal);
font-weight: var(--font-weight-normal);
}
}
.prose-a\:secondary-link {
& :is(:where(a):not(:where([class~="not-prose"],[class~="not-prose"] *))) {
color: var(--tw-prose-body);
text-decoration-line: none;
&:hover {
@media (hover: hover) {
color: var(--color-black);
}
}
&:where(.dark, .dark *) {
&:hover {
@media (hover: hover) {
color: var(--color-white);
}
}
}
}
}
.prose-pre\:rounded-lg {
& :is(:where(pre):not(:where([class~="not-prose"],[class~="not-prose"] *))) {
border-radius: var(--radius-lg);
@ -1518,26 +1589,6 @@ article {
display: flex;
}
}
@property --tw-rotate-x {
syntax: "*";
inherits: false;
}
@property --tw-rotate-y {
syntax: "*";
inherits: false;
}
@property --tw-rotate-z {
syntax: "*";
inherits: false;
}
@property --tw-skew-x {
syntax: "*";
inherits: false;
}
@property --tw-skew-y {
syntax: "*";
inherits: false;
}
@property --tw-space-x-reverse {
syntax: "*";
inherits: false;
@ -1761,11 +1812,6 @@ article {
@layer properties {
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
*, ::before, ::after, ::backdrop {
--tw-rotate-x: initial;
--tw-rotate-y: initial;
--tw-rotate-z: initial;
--tw-skew-x: initial;
--tw-skew-y: initial;
--tw-space-x-reverse: 0;
--tw-border-style: solid;
--tw-backdrop-blur: initial;