@melcanz85/chaincss 1.10.0 → 1.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -18
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -54,6 +54,7 @@ ChainCSS is a revolutionary CSS-in-JS solution that gives you **two powerful mod
|
|
|
54
54
|
**in your main.jcss**
|
|
55
55
|
|
|
56
56
|
```javascript
|
|
57
|
+
// src/main.jcss
|
|
57
58
|
<@
|
|
58
59
|
const button = get('./button.jcss');
|
|
59
60
|
|
|
@@ -82,27 +83,44 @@ OR with vanilla nodejs project
|
|
|
82
83
|
**Perfect for:** Dynamic styles that respond to props, state, or themes.
|
|
83
84
|
|
|
84
85
|
```jsx
|
|
85
|
-
|
|
86
|
-
import {
|
|
86
|
+
import { useChainStyles, $ } from '@melcanz85/chaincss/react';
|
|
87
|
+
import { useState } from 'react';
|
|
87
88
|
|
|
88
|
-
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
const SectionDemo = () => {
|
|
90
|
+
const [variant, setVariant] = useState('primary');
|
|
91
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
92
|
+
|
|
93
|
+
// Runtime styles that change based on state/props!
|
|
94
|
+
const styles = useChainStyles(() => ({
|
|
95
|
+
buttonGroup: $()
|
|
96
|
+
.display('flex')
|
|
97
|
+
.gap('1rem')
|
|
98
|
+
.justifyContent('center')
|
|
99
|
+
.marginTop('2rem')
|
|
100
|
+
.flexWrap('wrap')
|
|
101
|
+
.block(),
|
|
102
|
+
|
|
103
|
+
variantButton: $()
|
|
93
104
|
.padding('0.5rem 1rem')
|
|
94
|
-
.
|
|
105
|
+
.backgroundColor('#e2e8f0')
|
|
106
|
+
.border('none')
|
|
107
|
+
.borderRadius('0.375rem')
|
|
108
|
+
.cursor('pointer')
|
|
109
|
+
.fontWeight('500')
|
|
110
|
+
.transition('all 0.2s')
|
|
95
111
|
.hover()
|
|
96
|
-
.
|
|
97
|
-
.boxShadow('0 4px 6px rgba(0,0,0,0.1)')
|
|
112
|
+
.backgroundColor('#cbd5e0')
|
|
98
113
|
.block()
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
114
|
+
}),[variant]
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
return (
|
|
118
|
+
<section>
|
|
119
|
+
</section>
|
|
120
|
+
);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export default SectionDemo;
|
|
106
124
|
|
|
107
125
|
|
|
108
126
|
```
|
|
@@ -295,7 +313,9 @@ compile({ hello });" > chaincss/main.jcss
|
|
|
295
313
|
}
|
|
296
314
|
```
|
|
297
315
|
|
|
298
|
-
|
|
316
|
+
|
|
317
|
+
See ChainCSS in action! Visit our interactive demo site - [https://melcanz08.github.io/chaincss_react_website/](https://melcanz08.github.io/chaincss_react_website/)
|
|
318
|
+
|
|
299
319
|
|
|
300
320
|
## Performance Comparison
|
|
301
321
|
|