ssr-emotion-react 1.0.0-beta.5 β 1.0.0
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 +10 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,10 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
A natural and powerful Zero-Runtime CSS-in-JS solution et ses React π
|
|
4
4
|
|
|
5
|
-
## LIVE DEMO with Astro
|
|
6
|
-
|
|
7
|
-
ζΊεδΈ...
|
|
8
|
-
|
|
9
5
|
## Installation
|
|
10
6
|
|
|
11
7
|
### π Astro
|
|
@@ -285,8 +281,15 @@ const sx = (props, ...styles) => {
|
|
|
285
281
|
|
|
286
282
|
export default sx;
|
|
287
283
|
|
|
284
|
+
// Factory for component-scoped sx functions
|
|
285
|
+
sx._factory = (genCSS) => {
|
|
286
|
+
const f = (props, ...styles) => sx(props, ...styles, genCSS);
|
|
287
|
+
f.css = (...styles) => f({}, ...styles); // Styles-only function when you don't need props
|
|
288
|
+
return f;
|
|
289
|
+
}
|
|
290
|
+
|
|
288
291
|
// My button style
|
|
289
|
-
sx.button =
|
|
292
|
+
sx.button = sx._factory(props => {
|
|
290
293
|
const style = {
|
|
291
294
|
// default is text button
|
|
292
295
|
padding: '8px 16px',
|
|
@@ -327,9 +330,10 @@ import sx from './the-sx-prop'
|
|
|
327
330
|
export default props => {
|
|
328
331
|
return (<>
|
|
329
332
|
<button {...sx.button({}, {margin: '1rem'})}>Buuton1</button>
|
|
333
|
+
<button {...sx.button.css({margin: '1rem'})}>Buuton1</button>
|
|
330
334
|
<button {...sx.button({$elevated: true}, {margin: '1rem'})}>Button2</button>
|
|
331
335
|
<div {...sx.button({$elevated: true}, {margin: '1rem'})}>Button3</div>
|
|
332
|
-
<button disabled {...sx.button({
|
|
336
|
+
<button disabled {...sx.button.css({margin: '1rem'})}>Button4</button>
|
|
333
337
|
<button {...sx.button({disabled: true}, {margin: '1rem'})}>Button5</button>
|
|
334
338
|
</>);
|
|
335
339
|
}
|