Flex Cards
:::flex
Hello world!
::br
Hello moon!
:::
http://localhost:3000
Hello world!
Hello moon!
Verschachtelt​
::::flex
Nesting Level 1
::br
Content with a flex
:::flex
Boo!
::br
Yaa!
:::
::::
http://localhost:3000
Nesting Level 1
Content with a flex
Boo!
Yaa!
Cards​
Dasselbe mit den Docusaurus-Cards und dem Stichwort cards
::::cards
Nesting Level 1
::br
Content with a cards section
:::cards
::br{.alert .alert--danger}
Boo!
::br{.alert .alert--primary}
Yaa!
:::
::::
http://localhost:3000
Nesting Level 1
Content with a cards section
Boo!
Yaa!
Mit Bildern​
:::cards{flexBasis=200px maxWidth=300px}

Hello world!
::br

Hello Holidays!
:::
http://localhost:3000
Hello world!
Hello Holidays!
Installation​
Code
src/plugins/remark-flex-cards
src/css/custom.scss
div.flex {
display: flex;
flex-wrap: wrap;
gap: 0.4em;
margin-bottom: 1em;
> div.item {
flex-grow: 1;
flex-shrink: 1;
flex-basis: 10px;
&.noFlex {
flex-grow: unset;
flex-shrink: unset;
flex-basis: unset;
}
&.empty {
opacity: 0;
}
.card__image {
:first-child {
margin: 0;
margin-left: auto;
margin-right: auto;
}
figure {
margin: 0;
line-height: 0;
flex-grow: 1;
> * {
line-height: normal;
}
figcaption {
margin: 0.4em 1em;
}
}
&.code__card {
padding: 0;
}
}
}
&[style*='justify-content: space-around'],
&[style*='justify-content: space-between'],
&[style*='justify-content: center'],
&[style*='justify-content: flex-end'],
&[style*='justify-content: end'],
&[style*='justify-content: space-evenly'] {
> div.item {
flex-grow: 0;
}
}
}
docusaurus.config.ts
import flexCardsPlugin from './src/plugins/remark-flex-cards/plugin';
const BEFORE_DEFAULT_REMARK_PLUGINS = [
/* ... */
flexCardsPlugin
];