diff --git a/docs/.vitepress/composables/outline.ts b/docs/.vitepress/composables/outline.ts index 0ebb5c844..43fedd3ba 100644 --- a/docs/.vitepress/composables/outline.ts +++ b/docs/.vitepress/composables/outline.ts @@ -55,7 +55,6 @@ export function resolveTitle(theme: DefaultTheme.Config) { export function getHeaders(range: DefaultTheme.Config['outline']) { const headers = [ - // @ts-expect-error copied script ...document.querySelectorAll('article :where(h1,h2,h3,h4,h5,h6)'), ] .filter(el => el.id && el.hasChildNodes()) @@ -74,7 +73,6 @@ export function getHeaders(range: DefaultTheme.Config['outline']) { function serializeHeader(h: Element): string { let ret = '' - // @ts-expect-error copied script for (const node of h.childNodes) { if (node.nodeType === 1) { if ( @@ -204,6 +202,7 @@ export function useActiveAnchor( } activeLink = link } + activateLink(activeLink) } diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts index 01c1b6ed1..c640a9386 100644 --- a/docs/.vitepress/theme/index.ts +++ b/docs/.vitepress/theme/index.ts @@ -16,11 +16,11 @@ import './theme-media.css' import './theme-kbd.css' import './theme-animations.css' import './custom-nixie.css' -import '@fontsource-variable/quicksand' -import '@fontsource-variable/dm-sans' -import '@fontsource/dm-mono' -import '@fontsource/dm-serif-display' -import '@fontsource-variable/comfortaa' +import '@fontsource-variable/quicksand/index.css' +import '@fontsource-variable/dm-sans/index.css' +import '@fontsource/dm-mono/index.css' +import '@fontsource/dm-serif-display/index.css' +import '@fontsource-variable/comfortaa/index.css' export default { Layout, diff --git a/docs/.vitepress/theme/theme-details-animated-with-input.css b/docs/.vitepress/theme/theme-details-animated-with-input.css new file mode 100644 index 000000000..8f2933495 --- /dev/null +++ b/docs/.vitepress/theme/theme-details-animated-with-input.css @@ -0,0 +1,74 @@ +/* + * This requires + * + * + *
+ * + * + * + * Content + *
+ */ + +/* The key is to start
element in the "open" state... + ...and animate its max-height value by checking a checkbox. */ +details { + transition: max-height 150ms ease-in-out; + + max-height: 2rem; /* Set a max-height value just enough to show the summary content */ + overflow-y: hidden; /* Hide the rest of the content */ + overflow-x: auto; +} + +summary { + display: block; /* This hides the summary's ::marker pseudo-element */ +} + +input { + display: none; /* Hide the checkbox element */ +} + +/*