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
The object and array syntax is cleaner than string interpolation for conditional classes. Name your variables to match the CSS class names for the cleanest syntax:
25
+
Use arrays with an object at the end for modifiers:
32
26
33
27
```jsx
34
-
functionCard({ highlighted, compact }) {
28
+
functionCard({ variant, highlighted, compact }) {
35
29
return (
36
-
// Object shorthand - cleanest when variable names match class names
-**Flexible** — add as many variants or modifiers as needed
126
+
-**Maintainable** — easy to see what classes are applied
127
+
128
+
**Tip:** Name your variables to match class names for clean shorthand: use `{ active }` instead of `{ active: isActive }`. This makes the code self-documenting.
0 commit comments