Skip to content

Commit 6d6135f

Browse files
committed
fix: migrate the disabled attribute mod * 2
1 parent e2c4b74 commit 6d6135f

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/stories/Tasty.docs.mdx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,16 @@ styles: {
697697
},
698698
}
699699

700+
// ✅ Use simplified mods for built-in states (disabled, checked, selected)
701+
styles: {
702+
color: {
703+
'': '#dark',
704+
disabled: '#gray', // Preferred over '[disabled]'
705+
checked: '#blue', // Preferred over '[checked]'
706+
selected: '#purple', // Preferred over '[selected]'
707+
},
708+
}
709+
700710
// ✅ Use styleProps for component APIs
701711
const Container = tasty({
702712
styles: { display: 'flex' },
@@ -740,13 +750,6 @@ styles: {
740750
// ❌ Don't change styles prop at runtime (performance)
741751
const [dynamicStyles, setDynamicStyles] = useState({});
742752
<Component styles={dynamicStyles} /> // Use style prop for dynamic values
743-
744-
// ❌ Don't use simplified keys for other built-in states that require attributes
745-
styles: {
746-
color: {
747-
checked: '#blue', // Use '[checked]' instead
748-
},
749-
}
750753
```
751754

752755
#### Tasty vs Native CSS Properties

0 commit comments

Comments
 (0)