Skip to content

Commit

Permalink
💬 Add style for pull-quotes (#328)
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 authored Mar 13, 2024
1 parent 7cad84b commit 5dea885
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .changeset/odd-cycles-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'myst-to-react': minor
'@myst-theme/styles': minor
---

Add support for pull-quotes, fix figure classes
6 changes: 5 additions & 1 deletion packages/myst-to-react/src/basic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,14 @@ const BASIC_RENDERERS: BasicNodeRenderers = {
);
},
container({ node }) {
const figureName = `fig-${node.kind}`;
return (
<figure
id={node.html_id || node.identifier || node.key}
className={classNames({ subcontainer: node.subcontainer }, node.class)}
className={classNames(
{ [figureName]: !!node.kind, subcontainer: node.subcontainer },
node.class,
)}
>
<MyST ast={node.children} />
</figure>
Expand Down
9 changes: 6 additions & 3 deletions styles/figures.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
figure.quote figcaption {
figure.fig-quote figcaption {
text-align: right;
}
figure.quote figcaption > p:before {
figure.fig-quote figcaption > p:before {
content: '—';
padding-right: 0.5em;
}
figure.code > div {
figure.fig-quote.pull-quote > blockquote {
font-size: 1.4rem;
}
figure.fig-code > div {
margin: 0;
}
figure.subcontainer {
Expand Down

0 comments on commit 5dea885

Please sign in to comment.