fix(callouts): match callout DOM to Obsidian

This commit is contained in:
saberzero1 2025-08-25 14:05:07 +02:00
parent 0a57d032a7
commit 4ff08de9ec
No known key found for this signature in database
2 changed files with 17 additions and 18 deletions

View File

@ -488,16 +488,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>>
{ {
data: { hProperties: { className: ["callout-content"] }, hName: "div" }, data: { hProperties: { className: ["callout-content"] }, hName: "div" },
type: "blockquote", type: "blockquote",
children: [ children: [...calloutContent],
{
data: {
hProperties: { className: ["callout-content-inner"] },
hName: "div",
},
type: "blockquote",
children: [...calloutContent],
},
],
}, },
] ]
} }

View File

@ -12,13 +12,10 @@
& > .callout-content { & > .callout-content {
display: grid; display: grid;
transition: grid-template-rows 0.3s ease; transition: grid-template-rows 0.3s ease;
overflow: hidden;
& > .callout-content-inner { & > :first-child {
overflow: hidden; margin-top: 0;
& > :first-child {
margin-top: 0;
}
} }
} }
@ -121,8 +118,19 @@
--callout-icon: var(--callout-icon-quote); --callout-icon: var(--callout-icon-quote);
} }
&.is-collapsed > .callout-title > .fold-callout-icon { &.is-collapsed {
transform: rotateZ(-90deg); & > .callout-title > .fold-callout-icon {
transform: rotateZ(-90deg);
}
.callout-content > :first-child {
transition:
height 0.1s cubic-bezier(0.02, 0.01, 0.47, 1),
margin 0.1s cubic-bezier(0.02, 0.01, 0.47, 1);
overflow-y: clip;
height: 0;
margin-top: -1rem;
}
} }
} }