fix(toc): dynamic height on ScrollArea

This commit is contained in:
jason 2024-10-02 01:04:06 -07:00
parent befd21edb9
commit 818c23fc75
3 changed files with 4 additions and 4 deletions

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{ {
"name": "astro-erudite", "name": "astro-erudite",
"version": "1.1.4", "version": "1.1.5",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "astro-erudite", "name": "astro-erudite",
"version": "1.1.4", "version": "1.1.5",
"dependencies": { "dependencies": {
"@astrojs/check": "^0.7.0", "@astrojs/check": "^0.7.0",
"@astrojs/markdown-remark": "^5.2.0", "@astrojs/markdown-remark": "^5.2.0",

View file

@ -1,7 +1,7 @@
{ {
"name": "astro-erudite", "name": "astro-erudite",
"type": "module", "type": "module",
"version": "1.1.4", "version": "1.1.5",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "astro dev", "dev": "astro dev",

View file

@ -47,7 +47,7 @@ function buildToc(headings: Heading[]): Heading[] {
class="size-5 transition-transform group-open:rotate-180" class="size-5 transition-transform group-open:rotate-180"
/> />
</summary> </summary>
<ScrollArea client:load className="h-64" type="always"> <ScrollArea client:load className="flex max-h-64 flex-col overflow-y-auto" type="always">
<nav> <nav>
<ul class="pt-3"> <ul class="pt-3">
{toc.map((heading) => <TableOfContentsHeading heading={heading} />)} {toc.map((heading) => <TableOfContentsHeading heading={heading} />)}