@plumeria/core 0.9.6 → 0.9.7
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 +19 -17
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# @plumeria/core
|
|
2
2
|
|
|
3
|
-
**Zero-runtime CSS in JS
|
|
4
|
-
Compile at build-time. No runtime overhead.
|
|
3
|
+
**Zero-runtime CSS in JS library in TypeScript.**
|
|
5
4
|
|
|
6
5
|
## Installation
|
|
7
6
|
|
|
@@ -55,7 +54,8 @@ Also, any properties that are not wrapped will conform to that className.
|
|
|
55
54
|
```ts
|
|
56
55
|
const styles = css.create({
|
|
57
56
|
box: {
|
|
58
|
-
|
|
57
|
+
// 900px
|
|
58
|
+
[css.media.maxWidth(900)]: {
|
|
59
59
|
width: '100%',
|
|
60
60
|
color: 'rgb(60,60,60)',
|
|
61
61
|
},
|
|
@@ -89,12 +89,6 @@ css.global({
|
|
|
89
89
|
h1: {
|
|
90
90
|
fontSize: 32,
|
|
91
91
|
},
|
|
92
|
-
h2: {
|
|
93
|
-
fontSize: 24,
|
|
94
|
-
},
|
|
95
|
-
h3: {
|
|
96
|
-
fontSize: 16,
|
|
97
|
-
},
|
|
98
92
|
});
|
|
99
93
|
```
|
|
100
94
|
|
|
@@ -131,7 +125,7 @@ const tokens = css.defineVars({
|
|
|
131
125
|
sm: 360,
|
|
132
126
|
md: 480,
|
|
133
127
|
lg: 600,
|
|
134
|
-
xl:
|
|
128
|
+
xl: 720,
|
|
135
129
|
});
|
|
136
130
|
```
|
|
137
131
|
|
|
@@ -160,11 +154,17 @@ const themes = css.defineTheme({
|
|
|
160
154
|
Mixes #000 or #FFF into the color.
|
|
161
155
|
The first argument takes the color and the second argument takes the same value as opacity (string % or number).
|
|
162
156
|
|
|
157
|
+
You can also retrieve the complement of the color property from an color object.
|
|
158
|
+
|
|
163
159
|
```ts
|
|
164
160
|
color: css.color.darken('skyblue', 0.12),
|
|
165
161
|
color: css.color.lighten('navy', 0.6),
|
|
162
|
+
|
|
166
163
|
color: css.color.skyblue,
|
|
167
|
-
color: css.color.
|
|
164
|
+
color: css.color.aqua,
|
|
165
|
+
// ...many more colors
|
|
166
|
+
color: css.color.*...,
|
|
167
|
+
|
|
168
168
|
```
|
|
169
169
|
|
|
170
170
|
### cx
|
|
@@ -172,8 +172,10 @@ color: css.color.navy,
|
|
|
172
172
|
Merges strings such as class names and pseudo.
|
|
173
173
|
|
|
174
174
|
```tsx
|
|
175
|
-
|
|
176
|
-
cx(
|
|
175
|
+
// ":hover::after"
|
|
176
|
+
cx(css.pseudo.hover, css.pseudo.after);
|
|
177
|
+
// "text_hash box_hash"
|
|
178
|
+
cx(styles.text, styles, box);
|
|
177
179
|
```
|
|
178
180
|
|
|
179
181
|
## ESLint
|
|
@@ -182,10 +184,10 @@ cx(styles.text, styles, box); // "text_hash box_hash"
|
|
|
182
184
|
|
|
183
185
|
### Rules: recommended
|
|
184
186
|
|
|
185
|
-
\-
|
|
186
|
-
\-
|
|
187
|
-
\-
|
|
188
|
-
\-
|
|
187
|
+
\- no-inner-call:(error)
|
|
188
|
+
\- no-unused-keys:(warn)
|
|
189
|
+
\- sort-properties:(warn)
|
|
190
|
+
\- validate-values:(warn)
|
|
189
191
|
|
|
190
192
|
It is recommended to use it in conjunction with TypeScript completion, which is one of the big advantages of using plumeria.
|
|
191
193
|
|