postcss-enumerates-in-line 0.1.1 → 0.3.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.img/default_color.png +0 -0
- package/README.md +385 -12
- package/README_EN.md +385 -11
- package/_color.scss +138 -0
- package/index.mjs +196 -34
- package/package.json +1 -1
- package/test/gulp/src/css/app.scss +10 -22
- package/test/postcss/src/css/app.scss +10 -22
package/README_EN.md
CHANGED
|
@@ -5,9 +5,24 @@
|
|
|
5
5
|
|[<img width="24" height="24" align="left" src="README.img/1f1ef-1f1f5.png" alt="🇯🇵"> 日本語](README.md)|[<img width="24" height="24" align="left" src="README.img/1f1fa-1f1f8.png" alt="🇺🇸"> English](README_EN.md)|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
## Revision: in v0.0
|
|
8
|
+
## Revision: in v0.3.0
|
|
9
|
+
|
|
10
|
+
- Added conditional CSS property names about below.
|
|
11
|
+
+ `hover!`
|
|
12
|
+
+ `dark!`
|
|
13
|
+
+ `mq(<mediaQueries>)!`
|
|
14
|
+
+ `data(<customDataElements>)`
|
|
15
|
+
+ `aria(<ariaAttributes>)`
|
|
16
|
+
- Changed default colors to [Flexoki].
|
|
17
|
+
- Appended `_color.scss` file into this package.
|
|
18
|
+
- Updated files as development samples, `test/gulp/` and `test/postcss/`.
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## Maybe add functions
|
|
22
|
+
|
|
23
|
+
- Be able to define user generated shorthands.
|
|
24
|
+
- Refine `[[...]]` syntax, and add to use `color-alpha[[...]]` syntax which is enable to add alpha channel to default colors (using in CSS property value).
|
|
9
25
|
|
|
10
|
-
- Change connection a package loading from inner file-path to [npmjs.com](https://www.npmjs.com/).
|
|
11
26
|
|
|
12
27
|
---
|
|
13
28
|
|
|
@@ -38,11 +53,22 @@ Specific speaking, it takes the syntax like above -- language in [SCSS].
|
|
|
38
53
|
> You would separate CSS styles by `:` character so, property name appears in before and property value appears in after against `:`.
|
|
39
54
|
> Whitespace characters (like a ` `) treat as separator of CSS styles. If you want to write whitespaces at property values, then may replace these by `^` character.
|
|
40
55
|
>
|
|
41
|
-
> There are syntax descriptions after indexes.
|
|
42
56
|
|
|
43
|
-
There are no imprements about state transition like a hover, media queries, dark mode, etc.; because I am wishing only to aim for enumerating CSS styles
|
|
57
|
+
~~There are no imprements about state transition like a hover, media queries, dark mode, etc.; because I am wishing only to aim for enumerating CSS styles.~~
|
|
58
|
+
|
|
59
|
+
~~> What do I want to say; this plugin do not have any `hover:`, `md:`, and `dark:` etc. at [Tailwind CSS].~~
|
|
44
60
|
|
|
45
|
-
|
|
61
|
+
☑️In version 0.3.0 and upper.
|
|
62
|
+
|
|
63
|
+
And also if you prepend below syntaxes into CSS property, would be available about conditional CSS properties.
|
|
64
|
+
|
|
65
|
+
- `hover!`: :hover
|
|
66
|
+
- `dark!`: :root.dark
|
|
67
|
+
- `mq(<mediaQueries>)!`: @media screen and <mediaQueries>
|
|
68
|
+
- `data(<customDataElements>)!`: [data-<customDataElement>]
|
|
69
|
+
- `aria(<ariaAttributes>)!`: [aria-<ariaAttributes>]
|
|
70
|
+
|
|
71
|
+
> There are syntax descriptions after indexes.
|
|
46
72
|
|
|
47
73
|
I think primary usage is [gulp] and [gulp-postcss]. However it also works on JS-API of the PostCSS.
|
|
48
74
|
|
|
@@ -51,6 +77,7 @@ I think primary usage is [gulp] and [gulp-postcss]. However it also works on JS-
|
|
|
51
77
|
[SCSS]: https://sass-lang.com/
|
|
52
78
|
[gulp]: https://gulpjs.com/
|
|
53
79
|
[gulp-postcss]: https://github.com/postcss/gulp-postcss
|
|
80
|
+
[Flexoki]: https://stephango.com/flexoki
|
|
54
81
|
|
|
55
82
|
<div class="x--hr"></div>
|
|
56
83
|
|
|
@@ -58,14 +85,22 @@ I think primary usage is [gulp] and [gulp-postcss]. However it also works on JS-
|
|
|
58
85
|
## Indexes
|
|
59
86
|
|
|
60
87
|
- [PostCSS Enumerates in Line](#postcss-enumerates-in-line)
|
|
61
|
-
- [Revision: in v0.0
|
|
88
|
+
- [Revision: in v0.3.0](#revision-in-v030)
|
|
89
|
+
- [Maybe add functions](#maybe-add-functions)
|
|
62
90
|
- [Indexes](#indexes)
|
|
63
91
|
- [Method of writing in CSS files.](#method-of-writing-in-css-files)
|
|
92
|
+
- [Conditional CSS property](#conditional-css-property)
|
|
93
|
+
- [Dark mode](#dark-mode)
|
|
94
|
+
- [Mouse over state](#mouse-over-state)
|
|
95
|
+
- [Media Queries](#media-queries)
|
|
96
|
+
- [Custom data attribute](#custom-data-attribute)
|
|
97
|
+
- [ARIA attributes](#aria-attributes)
|
|
64
98
|
- [Special characters](#special-characters)
|
|
65
99
|
- [COLON Character](#colon-character)
|
|
66
100
|
- [EXCLAMATION character](#exclamation-character)
|
|
67
101
|
- [CIRCUMFLEX character](#circumflex-character)
|
|
68
102
|
- [double SQUARE BRACKET character](#double-square-bracket-character)
|
|
103
|
+
- [Default colors](#default-colors)
|
|
69
104
|
- [Shorthands of property names](#shorthands-of-property-names)
|
|
70
105
|
- [How to use this plugin](#how-to-use-this-plugin)
|
|
71
106
|
- [How to use with gulp](#how-to-use-with-gulp)
|
|
@@ -98,7 +133,7 @@ html {
|
|
|
98
133
|
@enums background-color:#000 color:#fff;
|
|
99
134
|
|
|
100
135
|
h1 {
|
|
101
|
-
@enums font-size:100
|
|
136
|
+
@enums font-size:100% hover!color:red;
|
|
102
137
|
}
|
|
103
138
|
}
|
|
104
139
|
```
|
|
@@ -114,6 +149,303 @@ There are simplification at CSS style declarating too. That made by combination
|
|
|
114
149
|
You will be able to operate designation freely like a "`border:1px^#888^solid`", because property values can have arbitary value.
|
|
115
150
|
|
|
116
151
|
|
|
152
|
+
### Conditional CSS property
|
|
153
|
+
|
|
154
|
+
```scss
|
|
155
|
+
h1 {
|
|
156
|
+
@emums data(visible="hidden")!display:none
|
|
157
|
+
ct:blue hover!ct:red
|
|
158
|
+
cb:white dark!cb:black
|
|
159
|
+
mq(width:1000px-)!mx:auto;
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
You can extend a syntax to `<condition>!<CssPropertyName>:<CssPropertyValue>` like above.
|
|
164
|
+
|
|
165
|
+
Each condition (`hover!`, `dark!`, `mq(...)!`, `data(...)!`, and `aria(...)!`) are able to mate with others.
|
|
166
|
+
|
|
167
|
+
```scss
|
|
168
|
+
h1 {
|
|
169
|
+
@enums dark!hover!ct:red;
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
But can you not prepend consecutively same conditional type about `mq(...)!`, `data(...)!`, and `aria(...)!`.
|
|
174
|
+
Because these are only able to add the 1 type by 1 CSS property.
|
|
175
|
+
|
|
176
|
+
If you want to enumerate conditions, please use by `,` splitting that located between `(` and`)`.
|
|
177
|
+
|
|
178
|
+
The case of there are designated consecutively same optional types, this plugin will be applying the only first one, and ignoring following others.
|
|
179
|
+
|
|
180
|
+
```scss
|
|
181
|
+
/* ❌️NG */
|
|
182
|
+
h1 {
|
|
183
|
+
@enums mq(width:-640px)!mq(orientation:portrait)!m2:auto
|
|
184
|
+
data(state="succeed")!data(target-href^="https://")!text-indent:1rem;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/* ⭕️OK */
|
|
188
|
+
h1 {
|
|
189
|
+
@enums mq(width:-640px,orientation:portrait)!m2:auto
|
|
190
|
+
data(state="succeed",target-href^="https://")!text-indent:1rem;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/* 🙂Unzip */
|
|
194
|
+
@media screen and (max-width: 640px) and (orientation: portrait) {
|
|
195
|
+
h1 {
|
|
196
|
+
margin-bottom: auto;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
h1[data-state="succeed"][data-target-href^="https://"] {
|
|
200
|
+
text-indent: 1rem;
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
#### Dark mode
|
|
206
|
+
|
|
207
|
+
Using `dark!` case that of conditional syntax, this plugin behave to judge whether does `root:` (html element) have a `dark` class?
|
|
208
|
+
|
|
209
|
+
```scss
|
|
210
|
+
/* 🚧Before */
|
|
211
|
+
h1 {
|
|
212
|
+
@emums cb:white dark!cb:black;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* 🚀After */
|
|
216
|
+
h1 {
|
|
217
|
+
background-color: white;
|
|
218
|
+
}
|
|
219
|
+
:root.dark h1 {
|
|
220
|
+
background-color: black;
|
|
221
|
+
}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
#### Mouse over state
|
|
226
|
+
|
|
227
|
+
Using `hover!` case that of conditional syntax, this plugin behave to add `:hover` pseudo class.
|
|
228
|
+
|
|
229
|
+
```scss
|
|
230
|
+
/* 🚧Before */
|
|
231
|
+
h1 {
|
|
232
|
+
@emums ct:blue hover!ct:red;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/* 🚀After */
|
|
236
|
+
h1 {
|
|
237
|
+
color: blue;
|
|
238
|
+
}
|
|
239
|
+
h1:hover {
|
|
240
|
+
color: red;
|
|
241
|
+
}
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
#### Media Queries
|
|
246
|
+
|
|
247
|
+
Using `mq(...)!` case that of conditional syntax, this plugin behave to insert into `@media` rules.
|
|
248
|
+
|
|
249
|
+
If you wish to combine multiple media queries consecutively, can describe by `,` splitting syntax.
|
|
250
|
+
|
|
251
|
+
```scss
|
|
252
|
+
/* 🚧Before */
|
|
253
|
+
h1 {
|
|
254
|
+
@emums mq(width:1000px-)!m2:auto
|
|
255
|
+
mq(height:-1000px,aspect-ratio:1-)!p:1.5rem;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/* 🚀After */
|
|
259
|
+
@media screen and (min-width: 1000px) {
|
|
260
|
+
h1 {
|
|
261
|
+
margin-bottom: auto;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
@media screen and (max-height: 1000px) and (min-aspect-ratio: 1) {
|
|
265
|
+
h1 {
|
|
266
|
+
padding: 1.5rem;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
The media queries (which are as arguments of `mq(...)` function) can be described in these combination; `media feature`, `:`, `value of condition`.
|
|
272
|
+
|
|
273
|
+
There are usable media features as a below, however this plugin will change outputting actual media feathres by what do you use any values of condition.
|
|
274
|
+
|
|
275
|
+
- `orientation`: orientation
|
|
276
|
+
- `width`: width, min-width, max-width
|
|
277
|
+
- `height`: height, min-height, max-height
|
|
278
|
+
- `aspect-ratio`: aspect-ratio, min-aspect-ratio, max-aspect-ratio
|
|
279
|
+
|
|
280
|
+
> In `orientation` case; there is designatable value, `portrait` (long vertical or square shapes) or `landscape` (long horizontal shape) only.
|
|
281
|
+
|
|
282
|
+
```scss
|
|
283
|
+
body {
|
|
284
|
+
@enums
|
|
285
|
+
mq(orientation:portrait)!m2:1rem
|
|
286
|
+
mq(orientation:landscape)!m8:1rem
|
|
287
|
+
;
|
|
288
|
+
}
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
> In `width` case; there are 3 type of designatable value. `-<length>`, `<length>-<length>`, and `<length>-`.
|
|
292
|
+
>
|
|
293
|
+
> You will be able to designate to `<length>` as these numeric values, that is related to length which tied with CSS sizing units; `px`, `rem`, `vw`, etc.
|
|
294
|
+
>
|
|
295
|
+
> + In `-<length>` case (the syntax is `<length>` with `-` prefix) -- this plugin recognize it as "This media query is smaller than `<length>`". (Applied media feature is `max-width`.)
|
|
296
|
+
> + In `<length>-<length>` case (the syntax is `-` sandwiching by 2 `<length>`) -- this plugin recognize it as "This media query still is range of between first `<length>` and second `<length>`". (Applied media feature are `min-width` and `max-width`.)
|
|
297
|
+
> + In `<length>-` case (the syntax is `<length>` with `-` postfix) -- this plugin recognize it as "This media query is larger than `<length>`". (Applied media feature is `min-width`.)
|
|
298
|
+
|
|
299
|
+
```scss
|
|
300
|
+
body {
|
|
301
|
+
@enums
|
|
302
|
+
mq(width:-480px)!m2:1rem
|
|
303
|
+
mq(width:640px-1024px)!mx:1rem
|
|
304
|
+
mq(width:1280px)!m8:1rem
|
|
305
|
+
;
|
|
306
|
+
}
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
> In `height` case; there are designatable value of condition and behavior that is same as `width`.
|
|
310
|
+
>
|
|
311
|
+
> But applying media feature are changed to `height`, `min-height`, and `max-height`.
|
|
312
|
+
|
|
313
|
+
```scss
|
|
314
|
+
body {
|
|
315
|
+
@enums
|
|
316
|
+
mq(height:-480px)!m2:1rem
|
|
317
|
+
mq(height:640px-1024px)!mx:1rem
|
|
318
|
+
mq(height:1280px)!m8:1rem
|
|
319
|
+
;
|
|
320
|
+
}
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
> In `aspect-ratio` case; you can only designate a value in numeric which is integer (like a `1`) or float (like a `0.85`) type.
|
|
324
|
+
>
|
|
325
|
+
> Notice: Must NOT designate value with divide operator (`/`), by what you wish to transform it from `@media (aspect-ratio: 16/9)`. You should designate a calculated literal number. (e.g. 16/9 🔀 1.78)
|
|
326
|
+
>
|
|
327
|
+
> + In `-<number>` case (the syntax is `<number>` with `-` prefix) -- this plugin recognize it as "This aspect ratio is smaller than `<number>`". (Applied media feature is `max-aspect-ratio`.)
|
|
328
|
+
> + In `<number>-<number>` case (the syntax is `-` sandwiching by 2 `<number>`) -- this plugin recognize it as "This aspect ratio stillis range of between first `<number>` and second `<number>`". (Applied media feature are `min-aspect-ratio` and `max-aspect-ratio`.)
|
|
329
|
+
> + In `<number>-` case (the syntax is `<number>` with `-` postfix) -- this plugin recognize it as "This aspect ratio is largeer than `<number>`". (Applied media feature is `min-aspect-ratio`.)
|
|
330
|
+
> + In `<number>` case (the syntax only is `<number>` and without any `-`) -- this plugin recognize it as "This aspect ratio is as just equal as `<number>`". (Applied media feature is `aspect-ratio`.)
|
|
331
|
+
|
|
332
|
+
```scss
|
|
333
|
+
body {
|
|
334
|
+
@enums
|
|
335
|
+
mq(aspect-ratio:-0.5)!m2:1rem
|
|
336
|
+
mq(aspect-ratio:0.55-0.95)!mx:1rem
|
|
337
|
+
mq(aspect-ratio:1.25-)!m8:1rem
|
|
338
|
+
mq(aspect-ratio:1)!p:1rem
|
|
339
|
+
;
|
|
340
|
+
}
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
#### Custom data attribute
|
|
345
|
+
|
|
346
|
+
Using `data(...)!` case that conditional syntax, this plugin behave to combine CSS selector and custom data attributes.
|
|
347
|
+
|
|
348
|
+
If you wish to combine multiple custom data attributes consecutively, can describe by `,` splitting syntax.
|
|
349
|
+
|
|
350
|
+
```scss
|
|
351
|
+
/* 🚧Before */
|
|
352
|
+
h1 {
|
|
353
|
+
@emums data(visible="hidden")!display:none;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/* 🚀After */
|
|
357
|
+
h1[data-visible="hidden"] {
|
|
358
|
+
display: none;
|
|
359
|
+
}
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
The custom data attributes (which are as arguments of `data(...)` function) can be described in these combination; `attribute name`, `conditional operator`, `attribute value`.
|
|
363
|
+
|
|
364
|
+
If do you need a attribute value (that means you want to need only attribute name like as `*[data-loading]`), should not designate `conditional operator` and `attribute value`,
|
|
365
|
+
|
|
366
|
+
```scss
|
|
367
|
+
/* 🚧Before */
|
|
368
|
+
h1 {
|
|
369
|
+
@enums data(loading)!display:none
|
|
370
|
+
data(is-empty="false")!m8:1rem;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/* 🚀After */
|
|
374
|
+
h1[data-loading] {
|
|
375
|
+
display: none;
|
|
376
|
+
}
|
|
377
|
+
h1[data-is-empty="false"] {
|
|
378
|
+
margin-top: 1rem;
|
|
379
|
+
}
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
> At attribute name; designated value is only string which is following onto `data-`.
|
|
383
|
+
>
|
|
384
|
+
> Strictly speaking, there are available only `/[A-Za-z\d_\-]/` characters. But you cannot put `-` characters at first or last.
|
|
385
|
+
|
|
386
|
+
> At conditional operator; there are usable kinds as a below.
|
|
387
|
+
>
|
|
388
|
+
> + `=`: The case of matching between designated value and custom data attributes absolutely. (e.g. `[data-foo="bar"]`)
|
|
389
|
+
> + `~=`: The case of matching between one of designated value ([required] string must be space character separated style) and custom data attributes. (e.g. `[data-tags~="ipsum"]` vs. `<span data-tags="lorem ipsum dolor sit amet"></span>`)
|
|
390
|
+
> + `^=`: The case of matching between designated value and custom data attributes starting with the same characters. (e.g. `[data-href^="https://"]`)
|
|
391
|
+
> + `$=`: The case of matching between designated value and custom data attributes finishing with the same characters. (e.g. `[data-href$=".webp"]`)
|
|
392
|
+
> + `*=`: The case of matching between designated value and custom data attributes including with the same characters. (e.g. `[data-alphabet*="bcdef"]`)
|
|
393
|
+
> + `|=`: The case of matching between designated value and custom data attributes starting with the same characters, and string of custom data attribute followed `/-[A-Za-z]+/`. (e.g. `[data-lang|="en"]`)
|
|
394
|
+
>
|
|
395
|
+
> > This expression is offen used by tag of languages (like a `en-US`, `en-GB`) which based on ISO 639 + ISO 3166.
|
|
396
|
+
|
|
397
|
+
> At attribute value; you need to sandwich a designated value by quote symbols (`"` or `'`).
|
|
398
|
+
>
|
|
399
|
+
> Please notice if you want to handle quote symbol characters in custom data attributes.
|
|
400
|
+
>
|
|
401
|
+
> And saying, this plugin transform at percent encoding (%xx) against below characters in attribute value by internal processing.
|
|
402
|
+
> + `%`: %25
|
|
403
|
+
> + `"`: %22
|
|
404
|
+
> + `'`: %27
|
|
405
|
+
> + ```: %60
|
|
406
|
+
> + `\`: %5D
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
#### ARIA attributes
|
|
410
|
+
|
|
411
|
+
Using `aria(...)!` case that conditional syntax, this plugin behave to combine CSS selector and ARIA attributes.
|
|
412
|
+
|
|
413
|
+
If you wish to combine multiple ARIA attributes consecutively, can describe by `,` splitting syntax.
|
|
414
|
+
|
|
415
|
+
```scss
|
|
416
|
+
/* 🚧Before */
|
|
417
|
+
h1 {
|
|
418
|
+
@emums aria(label="heading")!fs:1.5rem;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/* 🚀After */
|
|
422
|
+
h1[aria-label="heading"] {
|
|
423
|
+
font-size: 1.5rem;
|
|
424
|
+
}
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
The ARIA attributes (which are as arguments of `aria(...)` function) can be described in these combination; `attribute name`, `=`, `attribute value`.
|
|
428
|
+
|
|
429
|
+
> At attribute name; designated value is only string which is following onto `aria-`.
|
|
430
|
+
>
|
|
431
|
+
> Strictly speaking, there are available only `/[a-z]/` characters.
|
|
432
|
+
|
|
433
|
+
> At conditional operator; there is only available character `=`.
|
|
434
|
+
>
|
|
435
|
+
> If there are desirable more operators, I would be extending to a level of same kinds as `data(...)!` maybe.
|
|
436
|
+
|
|
437
|
+
> At attribute value; you need to sandwich a designated value by quote symbols (`"` or `'`).
|
|
438
|
+
>
|
|
439
|
+
> Please notice if you want to handle quote symbol characters in ARIA attributes.
|
|
440
|
+
>
|
|
441
|
+
> And saying, this plugin transform at percent encoding (%xx) against below characters in attribute value by internal processing.
|
|
442
|
+
> + `%`: %25
|
|
443
|
+
> + `"`: %22
|
|
444
|
+
> + `'`: %27
|
|
445
|
+
> + ```: %60
|
|
446
|
+
> + `\`: %5D
|
|
447
|
+
|
|
448
|
+
|
|
117
449
|
### Special characters
|
|
118
450
|
|
|
119
451
|
There are 5 characters which behave especially; `:`, `^`, `!`, `[[`, and `]]`.
|
|
@@ -132,6 +464,7 @@ Please transform to escape the characters by yourself -- `content:"\03A"`.
|
|
|
132
464
|
|
|
133
465
|
When you postfix EXCLAMATION (`!`) character about property value, this plugin recognize "I ordered this property is declared `!important`". There is `padding-top:1rem`, then will be replaced to `padding-top: 1rem !important`.
|
|
134
466
|
|
|
467
|
+
> Notice: This usage case of exclamation character (`!`) which behave as `!important` declaration is different to conditional syntax as `hover!`.
|
|
135
468
|
|
|
136
469
|
#### CIRCUMFLEX character
|
|
137
470
|
|
|
@@ -173,7 +506,7 @@ You can describe as `width:calc[[100vw-(100%+2rem)*(2)+1rem]]` too to omit `^` c
|
|
|
173
506
|
Because there ware annoying `^` characters they appear many and many times about `width:calc(100vw^-^(100%^+^2rem)^*^2^+^1rem)`, that is not visibility at good.
|
|
174
507
|
|
|
175
508
|
> Please must you not use `[[` and `]]` characters about non-mathematical functions like `var()`.
|
|
176
|
-
>
|
|
509
|
+
>
|
|
177
510
|
> Cause for example; `var[[--foo-bar]]` will be wrongly replacing to `var(--foo - var)`. That is destructed and meaningless property value of CSS.
|
|
178
511
|
|
|
179
512
|
This is experimental function. I am improving a transform compiler, so you will face at risk that would not insert whitespace characters to both end of calculation operators normally at your wish.
|
|
@@ -181,6 +514,47 @@ This is experimental function. I am improving a transform compiler, so you will
|
|
|
181
514
|
It works to replace whitespace to `^` characters as this case too. But I recommend to take a surefire way, it is supplements by `^` characters manually without `[[` and `]]`.
|
|
182
515
|
|
|
183
516
|
|
|
517
|
+
### Default colors
|
|
518
|
+
|
|
519
|
+
Default colors forked from [Flexoki] v2.0 to this package.
|
|
520
|
+
|
|
521
|
+
If you want to use it, call a CSS variable from CSS `var()` function.
|
|
522
|
+
|
|
523
|
+
```scss
|
|
524
|
+
body {
|
|
525
|
+
@enums ct:var(--color-red-400);
|
|
526
|
+
}
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
[<img src="README.img/default_color.png" alt="Default color">](README.img/default_color.png)
|
|
530
|
+
|
|
531
|
+
But currently you cannot use a CSS color settings with alpha channel which styles as `#RRGGBBAA`.
|
|
532
|
+
|
|
533
|
+
So this packages includes `_color.scss` file.
|
|
534
|
+
|
|
535
|
+
```scss
|
|
536
|
+
@use '../node_modules/postcss-enumerates-in-line/_color.scss' as c;
|
|
537
|
+
|
|
538
|
+
html {
|
|
539
|
+
color: #{c.$color-red-400}99; // D14D4199
|
|
540
|
+
}
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
> I will implement `color-alpha[[<color-theme>,<color-depth>,<alpha>,<optional:output-style>]]` function futurity.
|
|
544
|
+
|
|
545
|
+
```scss
|
|
546
|
+
/* 🚧Before */
|
|
547
|
+
html {
|
|
548
|
+
color: color-alpha[[red,400,60%,oklch]];
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
/* 🚀After */
|
|
552
|
+
html {
|
|
553
|
+
color: oklch(0.597 0.1692 28.38 / 60%);
|
|
554
|
+
}
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
|
|
184
558
|
### Shorthands of property names
|
|
185
559
|
|
|
186
560
|
There are defined shorthands about some property names.
|
|
@@ -495,7 +869,7 @@ If you designate to `true` (either nothing to designate, or designate `"hsl"` in
|
|
|
495
869
|
|
|
496
870
|
```css
|
|
497
871
|
:root {
|
|
498
|
-
--
|
|
872
|
+
--color-red-400: hsl(5 61% 53.7%);
|
|
499
873
|
}
|
|
500
874
|
```
|
|
501
875
|
|
|
@@ -505,7 +879,7 @@ You want to output by RGB type (without default HSL type), may designate `"rgb"`
|
|
|
505
879
|
|
|
506
880
|
```css
|
|
507
881
|
:root {
|
|
508
|
-
--
|
|
882
|
+
--color-red-400: #D14D41;
|
|
509
883
|
}
|
|
510
884
|
```
|
|
511
885
|
|
|
@@ -513,7 +887,7 @@ Or want to output by OKLCH type, may designate `"oklch"` or `"OKLCH"`.
|
|
|
513
887
|
|
|
514
888
|
```css
|
|
515
889
|
:root {
|
|
516
|
-
--
|
|
890
|
+
--color-red-400: oklch(0.597 0.1692 28.38);
|
|
517
891
|
}
|
|
518
892
|
```
|
|
519
893
|
|
package/_color.scss
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Color theme
|
|
3
|
+
* @author Steph Ango
|
|
4
|
+
* @namespace Flexoki
|
|
5
|
+
* @copyright https://stephango.com/flexoki
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
$color-black-0: "#100F0F";
|
|
9
|
+
$color-black-999: "#000000";
|
|
10
|
+
|
|
11
|
+
$color-white-0: "#FFFCF0";
|
|
12
|
+
$color-white-999: "#FFFFFF";
|
|
13
|
+
|
|
14
|
+
$color-base-50: "#F2F0E5";
|
|
15
|
+
$color-base-100: "#E6E4D9";
|
|
16
|
+
$color-base-150: "#DAD8CE";
|
|
17
|
+
$color-base-200: "#CECDC3";
|
|
18
|
+
$color-base-300: "#B7B5AC";
|
|
19
|
+
$color-base-400: "#9F9D96";
|
|
20
|
+
$color-base-500: "#878580";
|
|
21
|
+
$color-base-600: "#6F6E69";
|
|
22
|
+
$color-base-700: "#575653";
|
|
23
|
+
$color-base-800: "#403E3C";
|
|
24
|
+
$color-base-850: "#343331";
|
|
25
|
+
$color-base-900: "#282726";
|
|
26
|
+
$color-base-950: "#1C1B1A";
|
|
27
|
+
|
|
28
|
+
$color-red-50: "#FFE1D5";
|
|
29
|
+
$color-red-100: "#FFCABB";
|
|
30
|
+
$color-red-150: "#FDB2A2";
|
|
31
|
+
$color-red-200: "#F89A8A";
|
|
32
|
+
$color-red-300: "#E8705F";
|
|
33
|
+
$color-red-400: "#D14D41";
|
|
34
|
+
$color-red-500: "#C03E35";
|
|
35
|
+
$color-red-600: "#AF3029";
|
|
36
|
+
$color-red-700: "#942822";
|
|
37
|
+
$color-red-800: "#6C201C";
|
|
38
|
+
$color-red-850: "#551B18";
|
|
39
|
+
$color-red-900: "#3E1715";
|
|
40
|
+
$color-red-950: "#261312";
|
|
41
|
+
|
|
42
|
+
$color-orange-50: "#FFE7CE";
|
|
43
|
+
$color-orange-100: "#FED3AF";
|
|
44
|
+
$color-orange-150: "#FCC192";
|
|
45
|
+
$color-orange-200: "#F9AE77";
|
|
46
|
+
$color-orange-300: "#EC8B49";
|
|
47
|
+
$color-orange-400: "#DA702C";
|
|
48
|
+
$color-orange-500: "#CB6120";
|
|
49
|
+
$color-orange-600: "#BC5215";
|
|
50
|
+
$color-orange-700: "#9D4310";
|
|
51
|
+
$color-orange-800: "#71320D";
|
|
52
|
+
$color-orange-850: "#59290D";
|
|
53
|
+
$color-orange-900: "#40200D";
|
|
54
|
+
$color-orange-950: "#27180E";
|
|
55
|
+
|
|
56
|
+
$color-yellow-50: "#FAEEC6";
|
|
57
|
+
$color-yellow-100: "#F6E2A0";
|
|
58
|
+
$color-yellow-150: "#F1D67E";
|
|
59
|
+
$color-yellow-200: "#ECCB60";
|
|
60
|
+
$color-yellow-300: "#DFB431";
|
|
61
|
+
$color-yellow-400: "#D0A215";
|
|
62
|
+
$color-yellow-500: "#BE9207";
|
|
63
|
+
$color-yellow-600: "#AD8301";
|
|
64
|
+
$color-yellow-700: "#8E6B01";
|
|
65
|
+
$color-yellow-800: "#664D01";
|
|
66
|
+
$color-yellow-850: "#503D02";
|
|
67
|
+
$color-yellow-900: "#3A2D04";
|
|
68
|
+
$color-yellow-950: "#241E08";
|
|
69
|
+
|
|
70
|
+
$color-green-50: "#EDEECF";
|
|
71
|
+
$color-green-100: "#DDE2B2";
|
|
72
|
+
$color-green-150: "#CDD597";
|
|
73
|
+
$color-green-200: "#BEC97E";
|
|
74
|
+
$color-green-300: "#A0AF54";
|
|
75
|
+
$color-green-400: "#879A39";
|
|
76
|
+
$color-green-500: "#768D21";
|
|
77
|
+
$color-green-600: "#66800B";
|
|
78
|
+
$color-green-700: "#536907";
|
|
79
|
+
$color-green-800: "#3D4C07";
|
|
80
|
+
$color-green-850: "#313D07";
|
|
81
|
+
$color-green-900: "#252D09";
|
|
82
|
+
$color-green-950: "#1A1E0C";
|
|
83
|
+
|
|
84
|
+
$color-cyan-50: "#DDF1E4";
|
|
85
|
+
$color-cyan-100: "#BFE8D9";
|
|
86
|
+
$color-cyan-150: "#A2DECE";
|
|
87
|
+
$color-cyan-200: "#87D3C3";
|
|
88
|
+
$color-cyan-300: "#5ABDAC";
|
|
89
|
+
$color-cyan-400: "#3AA99F";
|
|
90
|
+
$color-cyan-500: "#2F968D";
|
|
91
|
+
$color-cyan-600: "#24837B";
|
|
92
|
+
$color-cyan-700: "#1C6C66";
|
|
93
|
+
$color-cyan-800: "#164F4A";
|
|
94
|
+
$color-cyan-850: "#143F3C";
|
|
95
|
+
$color-cyan-900: "#122F2C";
|
|
96
|
+
$color-cyan-950: "#101F1D";
|
|
97
|
+
|
|
98
|
+
$color-blue-50: "#E1ECEB";
|
|
99
|
+
$color-blue-100: "#C6DDE8";
|
|
100
|
+
$color-blue-150: "#ABCFE2";
|
|
101
|
+
$color-blue-200: "#92BFDB";
|
|
102
|
+
$color-blue-300: "#66A0C8";
|
|
103
|
+
$color-blue-400: "#4385BE";
|
|
104
|
+
$color-blue-500: "#3171B2";
|
|
105
|
+
$color-blue-600: "#205EA6";
|
|
106
|
+
$color-blue-700: "#1A4F8C";
|
|
107
|
+
$color-blue-800: "#163B66";
|
|
108
|
+
$color-blue-850: "#133051";
|
|
109
|
+
$color-blue-900: "#12253B";
|
|
110
|
+
$color-blue-950: "#101A24";
|
|
111
|
+
|
|
112
|
+
$color-purple-50: "#F0EAEC";
|
|
113
|
+
$color-purple-100: "#E2D9E9";
|
|
114
|
+
$color-purple-150: "#D3CAE6";
|
|
115
|
+
$color-purple-200: "#C4B9E0";
|
|
116
|
+
$color-purple-300: "#A699D0";
|
|
117
|
+
$color-purple-400: "#8B7EC8";
|
|
118
|
+
$color-purple-500: "#735EB5";
|
|
119
|
+
$color-purple-600: "#5E409D";
|
|
120
|
+
$color-purple-700: "#4F3685";
|
|
121
|
+
$color-purple-800: "#3C2A62";
|
|
122
|
+
$color-purple-850: "#31234E";
|
|
123
|
+
$color-purple-900: "#261C39";
|
|
124
|
+
$color-purple-950: "#1A1623";
|
|
125
|
+
|
|
126
|
+
$color-magenta-50: "#FEE4E5";
|
|
127
|
+
$color-magenta-100: "#FCCFDA";
|
|
128
|
+
$color-magenta-150: "#F9B9CF";
|
|
129
|
+
$color-magenta-200: "#F4A4C2";
|
|
130
|
+
$color-magenta-300: "#E47DA8";
|
|
131
|
+
$color-magenta-400: "#CE5D97";
|
|
132
|
+
$color-magenta-500: "#B74583";
|
|
133
|
+
$color-magenta-600: "#A02F6F";
|
|
134
|
+
$color-magenta-700: "#87285E";
|
|
135
|
+
$color-magenta-800: "#641F46";
|
|
136
|
+
$color-magenta-850: "#4F1B39";
|
|
137
|
+
$color-magenta-900: "#39172B";
|
|
138
|
+
$color-magenta-950: "#24131D";
|