
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.)
1.4 KiB
1.4 KiB
title | for | about |
---|---|---|
Add instructions to your design | developers | While documentation is good, sometimes you want to add some instructions to your design itself |
See this example in our source code
Adding instructions to your pattern is just a matter of adding text. The tricky part is to make sure your text can be translated.
Below is a rather involved example from Aaron:
points.bindingAnchor = new Point(points.armhole.x / 4, points.armhole.y)
.attr('data-text', 'cutTwoStripsToFinishTheArmholes')
.attr('data-text', ':\n')
.attr('data-text', `2x: ${units(sa * 6 || 60)} x ${units(armholeLength * 0.95 + 2 * sa)}`)
.attr('data-text', '\n \n')
.attr('data-text', 'cutOneStripToFinishTheNeckOpening')
.attr('data-text', ':\n')
.attr('data-text', 'width')
.attr('data-text', ':')
.attr(
'data-text',
`${units((sa || 10) * 6)} x ${units(neckOpeningLength * 2 * 0.95 + 2 * sa)}`
)
If you want to add text along a path, you can do that too:
paths.breakLine.attr('data-text', 'breakLine').attr('data-text-class', 'center')
paths.flb.attr('data-text', 'facingLiningBoundary')
Refer to the sprinkle macro documentation for details on how to use this macro