Skip to content

Commit

Permalink
chore: fix ref docs mistakes, add DTCG option (#1122)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorenbroekema authored Mar 14, 2024
1 parent aa49a5f commit 7d0423d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/using_reference_utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ const sd = new StyleDictionary({
});
resolveReferences(sd.tokens.border.value, sd.tokens); // "solid 2px #000"
resolveReferences('solid {spacing.2} {colors.black}', sd.tokens); // alternative way, yet identical to line above -> "solid 2px #000"
resolveReferences('solid {spacing.2} {colors.black}', sd.tokens, { usesDtcg: true }); // Assumes DTCG spec format, with $ prefix ($value, $type)
```

> You can pass a third `options` argument where you can pass some configuration options for how references are resolved
Expand Down Expand Up @@ -132,8 +133,9 @@ const sd = new StyleDictionary({
},
});

getReferences(sd, sd.tokens.border.value);
getReferences(sd, 'solid {spacing.2} {colors.black}'); // alternative way, yet identical to line above
getReferences(sd.tokens.border.value, sd.tokens);
getReferences('solid {spacing.2} {colors.black}', sd.tokens); // alternative way, yet identical to line above
getReferences('solid {spacing.2} {colors.black}', sd.tokens, { usesDtcg: true }); // Assumes DTCG spec format, with $ prefix ($value, $type)
/**
* [
* { value: '2px', type: 'dimension' },
Expand Down

0 comments on commit 7d0423d

Please sign in to comment.