Skip to content

Commit a740060

Browse files
committed
update docs
1 parent 925f90d commit a740060

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

doc-site/docs/getting-started.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const myLibraryConfig: Library.Config<IMyLibrary> = {
6161
body: {
6262
type: DesignToken.Type.Typography
6363
value: {
64-
fontFamily: (tokens) => tokens.typography.fonts.base, // Alias
64+
fontFamily: Library.derive((tokens) => tokens.typography.fonts.base), // Alias
6565
fontSize: "14px",
6666
fontWeight: 400;
6767
letterSpacing: "0px";
@@ -90,12 +90,12 @@ const config: Library.Config<Colors> = {
9090
},
9191
alias: {
9292
type: DesignToken.Type.Color,
93-
value: (tokens) => tokens.static, // alias to the 'static' token
93+
value: Library.derive((tokens) => tokens.static), // alias to the 'static' token
9494
},
9595
derived: {
9696
type: DesignToken.Type.Color,
9797
// Operate on the value of the 'alias' token
98-
value: (tokens) => darken(tokens.alias.value, 0.3),
98+
value: Library.derive((tokens) => darken(tokens.alias.value, 0.3)),
9999
},
100100
};
101101
```
@@ -149,7 +149,10 @@ Change notifications are batched and subscribers get notified each microtask. It
149149
```ts
150150
const library = Library.create({
151151
a: { type: DesignToken.Type.Color, value: "#000000" },
152-
b: { type: DesignToken.Type.Color, value: (tokens) => tokens.a },
152+
b: {
153+
type: DesignToken.Type.Color,
154+
value: Library.derive((tokens) => tokens.a),
155+
},
153156
});
154157

155158
library.subscribe({

0 commit comments

Comments
 (0)