@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.
Files changed (2) hide show
  1. package/README.md +38 -18
  2. 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
- // components/DynamicButton.jsx
86
- import { useChainStyles } from '@melcanz85/chaincss';
86
+ import { useChainStyles, $ } from '@melcanz85/chaincss/react';
87
+ import { useState } from 'react';
87
88
 
88
- function DynamicButton({ variant = 'primary', children }) {
89
- const styles = useChainStyles({
90
- button: () => $()
91
- .backgroundColor(variant === 'primary' ? '#667eea' : '#48bb78')
92
- .color('white')
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
- .borderRadius('4px')
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
- .transform('translateY(-2px)')
97
- .boxShadow('0 4px 6px rgba(0,0,0,0.1)')
112
+ .backgroundColor('#cbd5e0')
98
113
  .block()
99
- });
100
-
101
- return <button className={styles.button}>{children}</button>;
102
- }
103
- // Styles injected at runtime
104
- // Automatic cleanup on unmount
105
- // Fully dynamic based on props
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
- See ChainCSS in action! Visit our interactive demo site - [https://melcanz08.github.io/chaincss_react_website/]](https://melcanz08.github.io/chaincss_react_website/)
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@melcanz85/chaincss",
3
- "version": "1.10.0",
3
+ "version": "1.10.1",
4
4
  "description": "A simple package transpiler for js to css",
5
5
  "exports": {
6
6
  ".": {