1
0
Fork 0
freesewing/markdown/dev/howtos/design/sprinkle-snippets/en.md
Joost De Cock b34a2ee2ed feat: Flat import of markdown repo
This is a flat (without history) import of (some of) the content
from our markdown module.

We've imported this without history because the repo contains our
blog posts and showcases posts content prior to porting them to strapi.

Since this contains many images, it would balloon the size of this repo
to import the full history.

Instead, please refer to the history of the (archived) markdown repo
at: https://github.com/freesewing/markdown
2021-08-25 16:09:31 +02:00

46 lines
997 B
Markdown

---
title: Add several of the same snippets with the sprinkle macro
for: developers
about: Adding multiple snippets doesn't need to be a chore with this handy macro
---
<Note>
##### See this example in our source code
- [packages/jaeger/src/front.js](https://github.com/freesewing/freesewing/blob/8474477911daed3c383700ab29c9565883f16d66/packages/jaeger/src/front.js#L381)
</Note>
Adding multiple snippets at the same time results in a lot of repetitive code.
Better to use the `sprinkle` macro instead:
```js
macro('sprinkle', {
snippet: 'notch',
on: [
'neck',
'shoulder',
'armholePitch',
'chestPocketBottomLeft',
'chestPocketBottomRight',
'lapelBreakPoint',
'notchMax',
'notch',
'innerPocketLeft',
'innerPocketRight',
'frontPocketTopLeft',
'frontPocketBottomLeft',
'armholeHollow',
'waist'
]
})
```
<Tip>
Refer to [the sprinkle macro documentation](/reference/macros/sprinkle/) for details on how
to use this macro
</Tip>