You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+41-7Lines changed: 41 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,9 +18,24 @@ Provides a way to styling components in React Native with better experience and
18
18
-[x] Support to define theme tokens.
19
19
-[ ] Styles based on conditions.
20
20
21
-
### Example of usage
21
+
### Create your config file
22
+
To configure `Jacaranda`, create a `jacaranda.config.ts` file (`.js` works too) to define your reusable design tokens and import the `createTokens` function.
23
+
```tsx
24
+
// jacaranda.config.ts
25
+
import { createTokens } from'jacaranda';
26
+
```
27
+
28
+
This function receives an object with the design tokens and returns a `styles` object that you can use to style your components.
29
+
-`colors`: Define your colors.
30
+
-`fontSize`: Define your font sizes.
31
+
-`spacing`: Define your spacing.
32
+
-`fonts`: Define your fonts.
33
+
-`lineHeight`: Define your line heights.
22
34
23
-
```tsx jacaranda.ts
35
+
And returns a `styles` function that you can use to style your components.
After the tokens are defined, you can use the design tokens in your components. You'll be importing the `styles` function from the `jacaranda.config.ts` file.
0 commit comments