Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasrice committed Sep 4, 2024
1 parent 925f90d commit a740060
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions doc-site/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const myLibraryConfig: Library.Config<IMyLibrary> = {
body: {
type: DesignToken.Type.Typography
value: {
fontFamily: (tokens) => tokens.typography.fonts.base, // Alias
fontFamily: Library.derive((tokens) => tokens.typography.fonts.base), // Alias
fontSize: "14px",
fontWeight: 400;
letterSpacing: "0px";
Expand Down Expand Up @@ -90,12 +90,12 @@ const config: Library.Config<Colors> = {
},
alias: {
type: DesignToken.Type.Color,
value: (tokens) => tokens.static, // alias to the 'static' token
value: Library.derive((tokens) => tokens.static), // alias to the 'static' token
},
derived: {
type: DesignToken.Type.Color,
// Operate on the value of the 'alias' token
value: (tokens) => darken(tokens.alias.value, 0.3),
value: Library.derive((tokens) => darken(tokens.alias.value, 0.3)),
},
};
```
Expand Down Expand Up @@ -149,7 +149,10 @@ Change notifications are batched and subscribers get notified each microtask. It
```ts
const library = Library.create({
a: { type: DesignToken.Type.Color, value: "#000000" },
b: { type: DesignToken.Type.Color, value: (tokens) => tokens.a },
b: {
type: DesignToken.Type.Color,
value: Library.derive((tokens) => tokens.a),
},
});

library.subscribe({
Expand Down

0 comments on commit a740060

Please sign in to comment.