1
0
Fork 0
freesewing/markdown/dev/howtos/design/sprinkle-snippets/en.md
nikhil 0becd057b2 fix: Broken/misleading links to designs' source code
Some of these links were actually broken, since they expect to find designs under the `packages/` directory in the current `develop` branch. Other links were technically okay, since they link to old commits, but updating those links may still help to reduce confusion.

Also fix a reference to `packages/unice` in a `netlify.toml` file. (Untested, but I don't think this is an actual Netlify configuration.)
2022-08-21 12:31:23 -04: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
- [designs/jaeger/src/front.js](https://github.com/freesewing/freesewing/blob/3ca5d0edfe54c7ac20aaf3af2f3544aee72f9b99/designs/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/api/macros/sprinkle) for details on how
to use this macro
</Tip>