postcss-enumerates-in-line 1.0.0 → 1.1.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 +7 -24
- package/README_EN.md +7 -25
- package/index.mjs +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,29 +5,9 @@
|
|
|
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
|
-
## 更新点: v1.
|
|
8
|
+
## 更新点: v1.1.0
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
- サンプルプログラムの更新
|
|
13
|
-
- メジャーアップデート
|
|
14
|
-
|
|
15
|
-
1. 色設定
|
|
16
|
-
|
|
17
|
-
- CSSプロパティ値に色設定を行う`color[[...]]`関数を追加
|
|
18
|
-
- プラグインのオプションに色テーマを追加する`appendUserColors(...)`を追加
|
|
19
|
-
- プラグインオプション`prependDefaultColor`の初期設定を`false`に変更
|
|
20
|
-
|
|
21
|
-
2. ショートハンド設定
|
|
22
|
-
|
|
23
|
-
- プラグインのオプションにユーザー定義ショートハンドを拡張する`appendShorthand(...)`を追加
|
|
24
|
-
|
|
25
|
-
3. CSSプロパティ
|
|
26
|
-
|
|
27
|
-
- 条件付きCSSプロパティ`attr(<attributes>)!`を追加
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
## 実装予定
|
|
10
|
+
- `color[[...]]`で引数がなかった場合、`#0000`へ変換するよう処理を変更
|
|
31
11
|
|
|
32
12
|
|
|
33
13
|
---
|
|
@@ -88,8 +68,7 @@
|
|
|
88
68
|
## 目次
|
|
89
69
|
|
|
90
70
|
- [PostCSS Enumerates in Line](#postcss-enumerates-in-line)
|
|
91
|
-
- [更新点: v1.
|
|
92
|
-
- [実装予定](#実装予定)
|
|
71
|
+
- [更新点: v1.1.0](#更新点-v110)
|
|
93
72
|
- [目次](#目次)
|
|
94
73
|
- [CSSでの記述方法](#cssでの記述方法)
|
|
95
74
|
- [条件付き書式](#条件付き書式)
|
|
@@ -590,6 +569,8 @@ h1 {
|
|
|
590
569
|
>
|
|
591
570
|
> 未定義の色テーマや濃度レベルを指定した場合、エラーとして扱われ無視されます。
|
|
592
571
|
|
|
572
|
+
> また引数が何も指定されず`color[[]]`とだけ指定された場合、エラー処理として`#0000`へと変換します。
|
|
573
|
+
|
|
593
574
|
この関数を使うことで、透過率が設定できる他、色テーマをプラグインのオプションである`appendUserColors(...)`でユーザー独自の定義を追加できる上に、`prependDefaultColor`を初期値の`false`以外にするとCSS変数として色情報が`:root`ブロックに出力されることでCSSファイルサイズが大きくなるなど、様々なデメリットが解消されるでしょう。
|
|
594
575
|
|
|
595
576
|
|
|
@@ -1085,6 +1066,8 @@ h1 {
|
|
|
1085
1066
|
|
|
1086
1067
|
ただし構文上の制約から、最低1種類は引数として指定してください。
|
|
1087
1068
|
|
|
1069
|
+
引数がなく`color[[]]`と記述してしまった場合、エラー処理として`#0000`へと変換されます。
|
|
1070
|
+
|
|
1088
1071
|
> 1. 色テーマ名
|
|
1089
1072
|
>
|
|
1090
1073
|
> デフォルトカラーまたは`appendUserColor(...)`で登録したもの。
|
package/README_EN.md
CHANGED
|
@@ -5,30 +5,9 @@
|
|
|
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 v1.
|
|
8
|
+
## Revision: in v1.1.0
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
- Update sample programs.
|
|
13
|
-
- Upgrade major version to v1.
|
|
14
|
-
|
|
15
|
-
1. Color settings
|
|
16
|
-
|
|
17
|
-
- Added a function `color[[...]]` for value of CSS property which designate a color.
|
|
18
|
-
- Added a plugin's option `appendUserColors(...)` for extending user color themes.
|
|
19
|
-
- Changed a plugin's option `prependDefaultColor` that default value turn to `false`.
|
|
20
|
-
|
|
21
|
-
2. Shorthand settings
|
|
22
|
-
|
|
23
|
-
- Added a plugin's option `appendShorthand(...)` for extending user shorthands which is used about CSS property name.
|
|
24
|
-
|
|
25
|
-
3. CSS property
|
|
26
|
-
|
|
27
|
-
- Added conditional CSS property name about below.
|
|
28
|
-
+ `attr(<attributes>)`
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
## Maybe add functions
|
|
10
|
+
- When `color[[...]]` didn't lead any arguments, this package transform it to `#0000`.
|
|
32
11
|
|
|
33
12
|
|
|
34
13
|
---
|
|
@@ -88,8 +67,7 @@ I think primary usage is [gulp] and [gulp-postcss]. However it also works on JS-
|
|
|
88
67
|
## Indexes
|
|
89
68
|
|
|
90
69
|
- [PostCSS Enumerates in Line](#postcss-enumerates-in-line)
|
|
91
|
-
- [Revision: in v1.
|
|
92
|
-
- [Maybe add functions](#maybe-add-functions)
|
|
70
|
+
- [Revision: in v1.1.0](#revision-in-v110)
|
|
93
71
|
- [Indexes](#indexes)
|
|
94
72
|
- [Method of writing in CSS files.](#method-of-writing-in-css-files)
|
|
95
73
|
- [Conditional CSS property](#conditional-css-property)
|
|
@@ -585,6 +563,8 @@ This function-like syntax takes 4 kind arguments in maximum.
|
|
|
585
563
|
> 3. `100%`
|
|
586
564
|
> 4. `hsl`
|
|
587
565
|
|
|
566
|
+
> And also if `color[[...]]` leads no arguments like a `color[[]]`, this package transform it to `#0000` as error handling.
|
|
567
|
+
|
|
588
568
|
You will eliminate some problems as below if use this function.
|
|
589
569
|
- Can apply opacity.
|
|
590
570
|
- And that also apply to user defined color theme which added by `appendUserColors(...)` in package option.
|
|
@@ -1086,6 +1066,8 @@ Every kinds are optional arguments, so there are omittable.
|
|
|
1086
1066
|
|
|
1087
1067
|
But, by and for syntax restriction, you need to designate arguments at least 1 kind and up.
|
|
1088
1068
|
|
|
1069
|
+
And also if there are no arguments like a `color[[]]`, this package transform it to `#0000` as error handling.
|
|
1070
|
+
|
|
1089
1071
|
> 1. Color theme
|
|
1090
1072
|
>
|
|
1091
1073
|
> The name of default color theme, or that registered in `appendUserColor(...)` option.
|
package/index.mjs
CHANGED
|
@@ -482,6 +482,7 @@ const replaceCssPropertyValueWBracket = value => value.replace(/\^/g, ' ')
|
|
|
482
482
|
.replace(/\[\[([^}]+)\]\]/g,(_,expr)=>`[[${expr.replace(/([+\*/]|(?<=[0-9a-zA-Z\)])[-%](?=[0-9a-zA-Z\(]))/g,' $1 ')}]]`)
|
|
483
483
|
.replace('[[', '(')
|
|
484
484
|
.replace(']]', ')')
|
|
485
|
+
.replace('color()', '#0000')
|
|
485
486
|
.replace(/ +/g, ' ')
|
|
486
487
|
|
|
487
488
|
/**
|