Skip to content

Commit 0be385f

Browse files
committed
chore: improved documentation
1 parent 03259f3 commit 0be385f

File tree

1 file changed

+41
-5
lines changed

1 file changed

+41
-5
lines changed

README.md

+41-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## Jacaranda
22

3+
> ⚠️ **BETA SOFTWARE**: This library is in active development and not yet recommended for production use. APIs may change without notice. Feel free to try it out and provide feedback!
4+
35
Provides a way to styling components in React Native with better experience and composability. The key feature is the ability to create multi-variants styles with a type-safe definition inspired by [Stitches](https://stitches.dev/docs/variants) and [CVA](https://cva.style/docs/getting-started/variants) (for React apps).
46

57
#### Currently properties:
@@ -13,15 +15,49 @@ Provides a way to styling components in React Native with better experience and
1315

1416
- [x] Variants definition.
1517
- [x] Default variants.
18+
- [x] Support to define theme tokens.
1619
- [ ] Styles based on conditions.
17-
- [ ] Support to define theme tokens.
1820

1921
### Example of usage
2022

23+
```tsx jacaranda.ts
24+
import { createTokens } from 'jacaranda';
25+
26+
export const { styles } = createTokens({
27+
colors: {
28+
primary50: '#ecfeff',
29+
primary100: '#cffafe',
30+
primary200: '#a5f3fc',
31+
primary300: '#67e8f9',
32+
primary400: '#22d3ee',
33+
primary500: '#06b6d4',
34+
primary600: '#0e93d1',
35+
primary700: '#1570ad',
36+
// Secondary
37+
secondary50: '#ecfdf5',
38+
secondary100: '#d9f9eb',
39+
secondary200: '#bbfde8',
40+
secondary300: '#86f9d9',
41+
secondary400: '#0d9488',
42+
secondary500: '#027a7b',
43+
secondary600: '#016464',
44+
secondary700: '#014747',
45+
},
46+
fontSize: {
47+
xs: 4,
48+
sm: 8,
49+
md: 16,
50+
lg: 24,
51+
xl: 32,
52+
xxl: 40,
53+
},
54+
})
55+
```
56+
2157
```tsx
22-
import { styles } from 'jacaranda';
58+
import { styles } from './jacaranda';
2359

24-
// With React Native screens
60+
// Button primitive
2561
export const Button = () => {
2662
return (
2763
<TouchableOpacity style={buttonStyles()}>
@@ -37,10 +73,10 @@ const buttonStyles = styles({
3773
variants: {
3874
intent: {
3975
primary: {
40-
backgroundColor: '#32275F',
76+
backgroundColor: '$colors.primary50',
4177
},
4278
secondary: {
43-
backgroundColor: '#D9D9D9',
79+
backgroundColor: '$colors.secondary50',
4480
},
4581
},
4682
size: {

0 commit comments

Comments
 (0)