From 92ca78709227c6117797c52eada7d471bb4ba96a Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Tue, 4 Jul 2023 18:26:11 -0700 Subject: [PATCH] fix default callout state --- .gitignore | 1 + quartz/components/scripts/callout.inline.ts | 4 ++-- quartz/styles/base.scss | 5 ----- quartz/styles/callouts.scss | 7 ++++--- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index b39ea57a0..41e5a332e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .DS_Store +.gitignore node_modules public .quartz-cache diff --git a/quartz/components/scripts/callout.inline.ts b/quartz/components/scripts/callout.inline.ts index 081a5a2f5..c13571abe 100644 --- a/quartz/components/scripts/callout.inline.ts +++ b/quartz/components/scripts/callout.inline.ts @@ -1,7 +1,7 @@ function toggleCallout(this: HTMLElement) { const outerBlock = this.parentElement! - this.classList.toggle(`is-collapsed`) - const collapsed = this.classList.contains(`is-collapsed`) + outerBlock.classList.toggle(`is-collapsed`) + const collapsed = outerBlock.classList.contains(`is-collapsed`) const height = collapsed ? this.scrollHeight : outerBlock.scrollHeight outerBlock.style.maxHeight = height + `px` } diff --git a/quartz/styles/base.scss b/quartz/styles/base.scss index d0faa7fae..94c85c732 100644 --- a/quartz/styles/base.scss +++ b/quartz/styles/base.scss @@ -71,11 +71,6 @@ a { font-size: 2rem; } - // darkmode diagrams - & svg { - stroke: var(--dark); - } - & ul:has(input[type='checkbox']) { list-style-type: none; padding-left: 0; diff --git a/quartz/styles/callouts.scss b/quartz/styles/callouts.scss index d33d78b84..46dffdec4 100644 --- a/quartz/styles/callouts.scss +++ b/quartz/styles/callouts.scss @@ -70,6 +70,10 @@ --color: var(--secondary); --border: var(--lightgray); } + + &.is-collapsed > .callout-title > .fold { + transform: rotateZ(-90deg) + } } @@ -87,9 +91,6 @@ cursor: pointer; } - &.is-collapsed .fold { - transform: rotateZ(-90deg) - } } .callout-icon {