Skip to content

Commit 4923aff

Browse files
authored
fix(callouts)!: match callout DOM to Obsidian (#2104)
* fix(callouts): match callout DOM to Obsidian * use new transition curve for all callout transitions * chore!: bump version to 4.5.2
1 parent 4c78d29 commit 4923aff

File tree

4 files changed

+21
-22
lines changed

4 files changed

+21
-22
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@jackyzha0/quartz",
33
"description": "🌱 publish your digital garden and notes as a website",
44
"private": true,
5-
"version": "4.5.1",
5+
"version": "4.5.2",
66
"type": "module",
77
"author": "jackyzha0 <[email protected]>",
88
"license": "MIT",

quartz/plugins/transformers/ofm.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -488,16 +488,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>>
488488
{
489489
data: { hProperties: { className: ["callout-content"] }, hName: "div" },
490490
type: "blockquote",
491-
children: [
492-
{
493-
data: {
494-
hProperties: { className: ["callout-content-inner"] },
495-
hName: "div",
496-
},
497-
type: "blockquote",
498-
children: [...calloutContent],
499-
},
500-
],
491+
children: [...calloutContent],
501492
},
502493
]
503494
}

quartz/styles/callouts.scss

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,11 @@
1111

1212
& > .callout-content {
1313
display: grid;
14-
transition: grid-template-rows 0.3s ease;
14+
transition: grid-template-rows 0.1s cubic-bezier(0.02, 0.01, 0.47, 1);
15+
overflow: hidden;
1516

16-
& > .callout-content-inner {
17-
overflow: hidden;
18-
19-
& > :first-child {
20-
margin-top: 0;
21-
}
17+
& > :first-child {
18+
margin-top: 0;
2219
}
2320
}
2421

@@ -121,8 +118,19 @@
121118
--callout-icon: var(--callout-icon-quote);
122119
}
123120

124-
&.is-collapsed > .callout-title > .fold-callout-icon {
125-
transform: rotateZ(-90deg);
121+
&.is-collapsed {
122+
& > .callout-title > .fold-callout-icon {
123+
transform: rotateZ(-90deg);
124+
}
125+
126+
.callout-content > :first-child {
127+
transition:
128+
height 0.1s cubic-bezier(0.02, 0.01, 0.47, 1),
129+
margin 0.1s cubic-bezier(0.02, 0.01, 0.47, 1);
130+
overflow-y: clip;
131+
height: 0;
132+
margin-top: -1rem;
133+
}
126134
}
127135
}
128136

0 commit comments

Comments
 (0)