postcss-enumerates-in-line 1.1.0 → 1.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.md CHANGED
@@ -5,9 +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.1.0
8
+ ## 更新点: v1.3.0
9
9
 
10
- - `color[[...]]`で引数がなかった場合、`#0000`へ変換するよう処理を変更
10
+ - 条件付き書式`p-hover(...)!` (親要素がhoverした場合)を追加
11
11
 
12
12
 
13
13
  ---
@@ -45,6 +45,7 @@
45
45
  またCSSプロパティ名の先頭に以下の書式を加筆することで、条件付きCSSプロパティに対応することができます。
46
46
 
47
47
  - `hover!`: :hover
48
+ - `p-hover(<parentSelector>)!`: parentSelector:hover thisSelector
48
49
  - `dark!`: :root.dark
49
50
  - `mq(<mediaQueries>)!`: @media screen and &lt;mediaQueries&gt;
50
51
  - `data(<customDataElements>)!`: [data-&lt;customDataElement&gt;]
@@ -68,12 +69,13 @@
68
69
  ## 目次
69
70
 
70
71
  - [PostCSS Enumerates in Line](#postcss-enumerates-in-line)
71
- - [更新点: v1.1.0](#更新点-v110)
72
+ - [更新点: v1.3.0](#更新点-v130)
72
73
  - [目次](#目次)
73
74
  - [CSSでの記述方法](#cssでの記述方法)
74
75
  - [条件付き書式](#条件付き書式)
75
76
  - [ダークモード](#ダークモード)
76
77
  - [マウスオーバー](#マウスオーバー)
78
+ - [祖先マウスオーバー](#祖先マウスオーバー)
77
79
  - [メディアクエリ](#メディアクエリ)
78
80
  - [カスタムデータ属性](#カスタムデータ属性)
79
81
  - [ARIA属性](#aria属性)
@@ -150,7 +152,7 @@ h1 {
150
152
 
151
153
  上記のように`条件付き書式!CSSプロパティ名:CSSプロパティ値`と記法を拡張することができます。
152
154
 
153
- `hover!`, `dark!`, `mq(...)!`, `data(...)!`, `aria(...)!`, `attr(...)!`はそれぞれ重ね掛けが可能です。
155
+ `hover!`, `p-hover(...)!`, `dark!`, `mq(...)!`, `data(...)!`, `aria(...)!`, `attr(...)!`はそれぞれ重ね掛けが可能です。
154
156
 
155
157
  ```scss
156
158
  h1 {
@@ -229,6 +231,114 @@ h1:hover {
229
231
  ```
230
232
 
231
233
 
234
+ #### 祖先マウスオーバー
235
+
236
+ 条件付き書式`p-hover(<parentSelector>)!`を使うと、祖先要素がマウスオーバー状態(`:hover`)になった場合の擬似クラスを追加できます。
237
+
238
+ ```scss
239
+ /* 🚧Before */
240
+ h1 {
241
+ @emums p-hover(a[download])!ct:red ct:black;
242
+ }
243
+
244
+ /* 🚀After */
245
+ h1 {
246
+ color: black;
247
+ }
248
+ a[download]:hover h1 {
249
+ color: red;
250
+ }
251
+ ```
252
+
253
+ `p-hover(...)`関数の引数は、`:hover`擬似クラスを適用する要素を指定するCSSセレクタになっています。
254
+
255
+ ```scss
256
+ /* ❌️Bad */
257
+ h1 {
258
+ @enums p-hover()!ct:red;
259
+ }
260
+ ```
261
+
262
+ 引数が指定されなかった場合、そのCSSスタイル宣言は無視されます。
263
+
264
+ ```scss
265
+ /* ❌️Bad */
266
+ h1 {
267
+ @enums dark!p-hover(:root)!ct:red;
268
+ }
269
+
270
+ /* 🙁Unzip */
271
+ :root.dark :root:hover h1 {
272
+ color: red;
273
+ }
274
+ ```
275
+
276
+ `p-hover(:root)!`と`dark!`を併用してしまうと、`:root.dark :root:hover thisSelector`という機能することのない無駄なCSSセレクタになってしまうためご注意ください。
277
+
278
+ ```scss
279
+ /* ❌️NG */
280
+ h1 {
281
+ @enums p-hover(.parent .child)!ct:red;
282
+ }
283
+
284
+ /* ⭕️OK */
285
+ h1 {
286
+ @enums p-hover(.parent^.child)!ct:red;
287
+ }
288
+
289
+ /* 🙂Unzip */
290
+ .parent .child:hover h1 {
291
+ color: red;
292
+ }
293
+ ```
294
+
295
+ 宣言の中に半角スペース記号を含むホワイトスペースを使うことはできないため、子孫連結をする場合は`p-hover(.parent .child)!`ではなく`p-hover(.parent^.child)!`のようにしてサーカムフレックス記号(`^`)に置き換えてください。
296
+
297
+ ```scss
298
+ /* ❌️NG */
299
+ h1 {
300
+ @enums p-hover(.parent > .child)!ct:red;
301
+ }
302
+
303
+ /* ⭕️OK */
304
+ h1 {
305
+ @enums p-hover(.parent>.child)!ct:red;
306
+ }
307
+
308
+ /* 🙂Unzip */
309
+ .parent > .child:hover h1 {
310
+ color: red;
311
+ }
312
+ ```
313
+
314
+ 次兄弟結合子(`+`)・子結合子(`>`)・後続兄弟結合子(`~`)・セレクタリスト記号(`,`)を使う場合、`p-hover(.parent>.child)!`のようにして前後に半角スペース記号を付けないでください。
315
+
316
+ ```scss
317
+ /* ❌️Bad */
318
+ h1 {
319
+ @enums p-hover(.classA,.classB)!ct:red;
320
+ }
321
+
322
+ /* ⭕️OK */
323
+ h1 {
324
+ @enums p-hover(:is(.classA,.classB))!ct:red;
325
+ }
326
+
327
+ /* 🙁Unzip Bad */
328
+ .classA, .classB:hover h1 {
329
+ color: red;
330
+ }
331
+
332
+ /* 🙂Unzip OK */
333
+ :is(.classA,.classB):hover h1 {
334
+ color: red;
335
+ }
336
+ ```
337
+
338
+ `:is(...)`や`:where(...)`を用いずに剥き出しの状態でセレクタリストを`p-hover(.classA,.classB)!`のように記述すると、意図しない展開が行われてしまいます。
339
+ 必ず擬似クラスリストを引数に取る関数の中に収めてください。
340
+
341
+
232
342
  #### メディアクエリ
233
343
 
234
344
  条件付き書式`mq(<mediaQueries>)!`を使うと、`@media`ルールの中に入れることができます。
@@ -275,20 +385,22 @@ body {
275
385
  }
276
386
  ```
277
387
 
278
- > `width`に指定可能な条件値は、`-<length>`・`<length>-<length>`・`<length>-`の3種類です。
388
+ > `width`に指定可能な条件値は、`-<length>`・`<length>-<length>`・`<length>-`・`<length>`の4種類です。
279
389
  >
280
390
  > `<length>`に指定可能なのは`px`・`rem`・`vw`など長さに関わる値です。
281
391
  >
282
392
  > + 1つのみある`<length>`の前に`-`を付けた場合、`<length>`以下のメディアクエリを意味します(適用されるメディア特性は`max-width`)
283
393
  > + 2つの`<length>`を`-`で接続した場合、その区間以内であるメディアクエリを意味します(適用されるメディア特性は`min-width`と`max-width`)
284
394
  > + 1つのみある`<length>`の後ろに`-`を付けた場合、`<length>`以上のメディアクエリを意味します(適用されるメディア特性は`min-width`)
395
+ > + `<length>`が1つのみあって`-`がない場合、ビューポートサイズが`<length>`とまったく等しい状態を意味します(適用されるメディア特性は`width`)
285
396
 
286
397
  ```scss
287
398
  body {
288
399
  @enums
289
400
  mq(width:-480px)!m2:1rem
290
401
  mq(width:640px-1024px)!mx:1rem
291
- mq(width:1280px)!m8:1rem
402
+ mq(width:1280px-)!m8:1rem
403
+ mq(width:540px)!m4:1rem
292
404
  ;
293
405
  }
294
406
  ```
@@ -302,7 +414,8 @@ body {
302
414
  @enums
303
415
  mq(height:-480px)!m2:1rem
304
416
  mq(height:640px-1024px)!mx:1rem
305
- mq(height:1280px)!m8:1rem
417
+ mq(height:1280px-)!m8:1rem
418
+ mq(height:540px)!m4:1rem
306
419
  ;
307
420
  }
308
421
  ```
@@ -311,7 +424,7 @@ body {
311
424
  >
312
425
  > `@media (aspect-ratio: 16/9)`のような除算記号(`/`)を使った表記はできません。
313
426
  >
314
- > `width`・`height`に似た表記が可能で、`-<number>`・`<number>-<number>`・`<number>-`の3種類と`<number>`が実際に指定可能な条件値です。
427
+ > `width`・`height`に似た表記が可能で、`-<number>`・`<number>-<number>`・`<number>-`・`<number>`の4種類が実際に指定可能な条件値です。
315
428
  >
316
429
  > + 1つのみある`<number>`の前に`-`を付けた場合、`<number>`以下のメディアクエリを意味します(適用されるメディア特性は`max-aspect-ratio`)
317
430
  > + 2つの`<number>`を`-`で接続した場合、その区間以内であるメディアクエリを意味します(適用されるメディア特性は`min-aspect-ratio`と`max-aspect-ratio`)
package/README_EN.md CHANGED
@@ -5,9 +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.1.0
8
+ ## Revision: in v1.3.0
9
9
 
10
- - When `color[[...]]` didn't lead any arguments, this package transform it to `#0000`.
10
+ - Added new conditional syntax `p-hover(...)!` which will emit at hover event about parental element.
11
11
 
12
12
 
13
13
  ---
@@ -44,6 +44,7 @@ Specific speaking, it takes the syntax like above -- language in [SCSS].
44
44
  And also if you prepend below syntaxes into CSS property, would be available about conditional CSS properties.
45
45
 
46
46
  - `hover!`: :hover
47
+ - `p-hover(<parentSelector>)!`: parentSelector:hover thisSelector
47
48
  - `dark!`: :root.dark
48
49
  - `mq(<mediaQueries>)!`: @media screen and &lt;mediaQueries&gt;
49
50
  - `data(<customDataElements>)!`: [data-&lt;customDataElement&gt;]
@@ -67,12 +68,13 @@ I think primary usage is [gulp] and [gulp-postcss]. However it also works on JS-
67
68
  ## Indexes
68
69
 
69
70
  - [PostCSS Enumerates in Line](#postcss-enumerates-in-line)
70
- - [Revision: in v1.1.0](#revision-in-v110)
71
+ - [Revision: in v1.3.0](#revision-in-v130)
71
72
  - [Indexes](#indexes)
72
73
  - [Method of writing in CSS files.](#method-of-writing-in-css-files)
73
74
  - [Conditional CSS property](#conditional-css-property)
74
75
  - [Dark mode](#dark-mode)
75
76
  - [Mouse over state](#mouse-over-state)
77
+ - [Parental Mouse over state](#parental-mouse-over-state)
76
78
  - [Media Queries](#media-queries)
77
79
  - [Custom data attribute](#custom-data-attribute)
78
80
  - [ARIA attributes](#aria-attributes)
@@ -149,7 +151,7 @@ h1 {
149
151
 
150
152
  You can extend a syntax to `<condition>!<CssPropertyName>:<CssPropertyValue>` like above.
151
153
 
152
- Each condition (`hover!`, `dark!`, `mq(...)!`, `data(...)!`, `aria(...)!`, and `attr(...)!`) are able to mate with others.
154
+ Each condition (`hover!`, `p-hover(...)!`, `dark!`, `mq(...)!`, `data(...)!`, `aria(...)!`, and `attr(...)!`) are able to mate with others.
153
155
 
154
156
  ```scss
155
157
  h1 {
@@ -229,6 +231,121 @@ h1:hover {
229
231
  ```
230
232
 
231
233
 
234
+ #### Parental Mouse over state
235
+
236
+ Using `p-hover(<parentSelector>)!` case that of conditional syntax, this plugin behave to postfix to parental element (`<parentSelector>`) a mouse over pseudo class (`:hover`).
237
+
238
+ ```scss
239
+ /* 🚧Before */
240
+ h1 {
241
+ @emums p-hover(a[download])!ct:red ct:black;
242
+ }
243
+
244
+ /* 🚀After */
245
+ h1 {
246
+ color: black;
247
+ }
248
+ a[download]:hover h1 {
249
+ color: red;
250
+ }
251
+ ```
252
+
253
+ The argument of `p-hover(...)!` function is a CSS selector which is designated HTML element that will be applied with `:hover` pseudo class.
254
+
255
+ ```scss
256
+ /* ❌️Bad */
257
+ h1 {
258
+ @enums p-hover()!ct:red;
259
+ }
260
+ ```
261
+
262
+ If there are no arguments, the CSS style declaration will be ignored.
263
+
264
+ ```scss
265
+ /* ❌️Bad */
266
+ h1 {
267
+ @enums dark!p-hover(:root)!ct:red;
268
+ }
269
+
270
+ /* 🙁Unzip */
271
+ :root.dark :root:hover h1 {
272
+ color: red;
273
+ }
274
+ ```
275
+ Please mind not to use both `p-hover(:root)!` and `dark!` in a same, because there are going to transform to `:root.dark :root:hover thisSelector` that never work and meanless.
276
+
277
+ ```scss
278
+ /* ❌️NG */
279
+ h1 {
280
+ @enums p-hover(.parent .child)!ct:red;
281
+ }
282
+
283
+ /* ⭕️OK */
284
+ h1 {
285
+ @enums p-hover(.parent^.child)!ct:red;
286
+ }
287
+
288
+ /* 🙂Unzip */
289
+ .parent .child:hover h1 {
290
+ color: red;
291
+ }
292
+ ```
293
+
294
+ CSS style declaration does not allow using with whitespace including half-width space character (` `).
295
+ So if you wish connecting by descendant combinator (` `) like `p-hover(.parent .child)!`, then may replace whitespace to circumflex character (`^`) who ought to descript as `p-hover(.parent^.child)!`.
296
+
297
+ ```scss
298
+ /* ❌️NG */
299
+ h1 {
300
+ @enums p-hover(.parent > .child)!ct:red;
301
+ }
302
+
303
+ /* ⭕️OK */
304
+ h1 {
305
+ @enums p-hover(.parent>.child)!ct:red;
306
+ }
307
+
308
+ /* 🙂Unzip */
309
+ .parent > .child:hover h1 {
310
+ color: red;
311
+ }
312
+ ```
313
+
314
+ When using below combinators in CSS selector, you mustn't append whitespace about it at before or after.
315
+ - `+`: next-sibling combinator
316
+ - `>`: child combinator
317
+ - `~`: subsequent sibling combinator
318
+ - `,`: selector list
319
+
320
+ Need to connect parent element, combinator, and child one without any gaps.
321
+ So that will become syntaxes like a `p-hover(.parent>.child)!`.
322
+
323
+ ```scss
324
+ /* ❌️Bad */
325
+ h1 {
326
+ @enums p-hover(.classA,.classB)!ct:red;
327
+ }
328
+
329
+ /* ⭕️OK */
330
+ h1 {
331
+ @enums p-hover(:is(.classA,.classB))!ct:red;
332
+ }
333
+
334
+ /* 🙁Unzip Bad */
335
+ .classA, .classB:hover h1 {
336
+ color: red;
337
+ }
338
+
339
+ /* 🙂Unzip OK */
340
+ :is(.classA,.classB):hover h1 {
341
+ color: red;
342
+ }
343
+ ```
344
+
345
+ The case of selector list in bare state as `p-hover(.classA,.classB)!` that are un-using `:is(...)` or `:where(...)`, this package will transform unfortunately to unintentional CSS selector as `.classA, .classB:hover thisSelector`.
346
+ You should store inside functions which needs pseudo class list as that arguments.
347
+
348
+
232
349
  #### Media Queries
233
350
 
234
351
  Using `mq(...)!` case that of conditional syntax, this plugin behave to insert into `@media` rules.
@@ -275,20 +392,22 @@ body {
275
392
  }
276
393
  ```
277
394
 
278
- > In `width` case; there are 3 type of designatable value. `-<length>`, `<length>-<length>`, and `<length>-`.
395
+ > In `width` case; there are 4 type of designatable value. `-<length>`, `<length>-<length>`, `<length>-`, and `<length>`.
279
396
  >
280
397
  > 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.
281
398
  >
282
399
  > + 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`.)
283
400
  > + 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`.)
284
401
  > + 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`.)
402
+ > + In `<length>` case (the syntax only is `<length>` and without any `-`) -- this plugin recognize it as "This viewport size is as just equal as `<length>`". (Applied media feature is `width`.)
285
403
 
286
404
  ```scss
287
405
  body {
288
406
  @enums
289
407
  mq(width:-480px)!m2:1rem
290
408
  mq(width:640px-1024px)!mx:1rem
291
- mq(width:1280px)!m8:1rem
409
+ mq(width:1280px-)!m8:1rem
410
+ mq(width:540px)!m4:1rem
292
411
  ;
293
412
  }
294
413
  ```
@@ -302,7 +421,8 @@ body {
302
421
  @enums
303
422
  mq(height:-480px)!m2:1rem
304
423
  mq(height:640px-1024px)!mx:1rem
305
- mq(height:1280px)!m8:1rem
424
+ mq(height:1280px-)!m8:1rem
425
+ mq(height:540px)!m4:1rem
306
426
  ;
307
427
  }
308
428
  ```
package/index.mjs CHANGED
@@ -156,6 +156,7 @@ export const enumSpreader = (options = {}) => {
156
156
  let param = node.params.replace(/[\s\t\r\n]+/g, ' ').split(' ')
157
157
  for(let i = 0, l = param.length; i < l; i ++) {
158
158
  let setting = {
159
+ isPHover: '',
159
160
  isHover: false,
160
161
  isDark: false,
161
162
  isMq: '',
@@ -167,6 +168,11 @@ export const enumSpreader = (options = {}) => {
167
168
  value: '',
168
169
  }
169
170
 
171
+ if(/p-hover\(.+?\)!/.test(param[i])) {
172
+ setting.isPHover = (!!param[i].match(/p-hover\((.+?)\)!/)[1] ? param[i].match(/p-hover\((.+?)\)!/)[1] : '').replace(/\^/g, ' ')
173
+ param[i] = param[i].replace(/p-hover\(.+?\)!/g, '')
174
+ }
175
+
170
176
  if(/hover!/.test(param[i])) {
171
177
  setting.isHover = true
172
178
  param[i] = param[i].replace(/hover!/g, '')
@@ -271,9 +277,9 @@ export const enumSpreader = (options = {}) => {
271
277
  if(/data\(.+?\)!/.test(param[i])) {
272
278
  setting.isData = []
273
279
  ;(!!param[i].match(/data\((.+?)\)!/)[1] ? param[i].match(/data\((.+?)\)!/)[1] : '').split(',').forEach(q => {
274
- let v1 = q.match(/^([A-Za-z\d_](?:[A-Za-z\d_\-]*[A-Za-z\d_])?)([\~\|\^\$\*]?=)['"](.*)['"]$/)
280
+ let v1 = q.match(/^([A-Za-z\d_](?:[A-Za-z\d_\-]*[A-Za-z\d_])?)([\~\|\^\$\*]?=)(?:(?=["])["](.*)["]|(?=['])['](.*)['])$/)
275
281
  if(!!v1) {
276
- setting.isData.push(`[data-${v1[1]}${v1[2]}"${v1[3].replace('\%','%25').replace('\"','%22').replace('\'','%27').replace('\`','%60').replace('\\','%5D')}"]`)
282
+ setting.isData.push(`[data-${v1[1]}${v1[2]}"${(v1[3]||v1[4]).replace('\%','%25').replace('\"','%22').replace('\'','%27').replace('\`','%60').replace('\\','%5D')}"]`)
277
283
  } else {
278
284
  let v2 = q.match(/^([A-Za-z\d_](?:[A-Za-z\d_\-]*[A-Za-z\d_])?)$/)
279
285
  if(!!v2) {
@@ -288,9 +294,9 @@ export const enumSpreader = (options = {}) => {
288
294
  if(/aria\(.+?\)!/.test(param[i])) {
289
295
  setting.isAria = []
290
296
  ;(!!param[i].match(/aria\((.+?)\)!/)[1] ? param[i].match(/aria\((.+?)\)!/)[1] : '').split(',').forEach(q => {
291
- let v = q.match(/^([a-z]+)=['"](.*)['"]$/)
297
+ let v = q.match(/^([a-z]+)=(?:(?=["])["](.*)["]|(?=['])['](.*)['])$/)
292
298
  if(!!v) {
293
- setting.isAria.push(`[aria-${v[1]}="${v[2].replace('\%','%25').replace('\"','%22').replace('\'','%27').replace('\`','%60').replace('\\','%5D')}"]`)
299
+ setting.isAria.push(`[aria-${v[1]}="${(v[2]||v[3]).replace('\%','%25').replace('\"','%22').replace('\'','%27').replace('\`','%60').replace('\\','%5D')}"]`)
294
300
  }
295
301
  })
296
302
  setting.isAria = setting.isAria.join('')
@@ -300,9 +306,9 @@ export const enumSpreader = (options = {}) => {
300
306
  if(/attr\(.+?\)!/.test(param[i])) {
301
307
  setting.isAttr = []
302
308
  ;(!!param[i].match(/attr\((.+?)\)!/)[1] ? param[i].match(/attr\((.+?)\)!/)[1] : '').split(',').forEach(q => {
303
- let v1 = q.match(/^([A-Za-z\d_](?:[A-Za-z\d_\-]*[A-Za-z\d_])?)([\~\|\^\$\*]?=)['"](.*)['"]$/)
309
+ let v1 = q.match(/^([A-Za-z\d_](?:[A-Za-z\d_\-]*[A-Za-z\d_])?)([\~\|\^\$\*]?=)(?:(?=["])["](.*)["]|(?=['])['](.*)['])$/)
304
310
  if(!!v1) {
305
- setting.isAttr.push(`[${v1[1]}${v1[2]}"${v1[3].replace('\%','%25').replace('\"','%22').replace('\'','%27').replace('\`','%60').replace('\\','%5D')}"]`)
311
+ setting.isAttr.push(`[${v1[1]}${v1[2]}"${(v1[3]||v1[4]).replace('\%','%25').replace('\"','%22').replace('\'','%27').replace('\`','%60').replace('\\','%5D')}"]`)
306
312
  } else {
307
313
  let v2 = q.match(/^([A-Za-z\d_](?:[A-Za-z\d_\-]*[A-Za-z\d_])?)$/)
308
314
  if(!!v2) {
@@ -314,14 +320,18 @@ export const enumSpreader = (options = {}) => {
314
320
  param[i] = param[i].replace(/attr\(.+?\)!/g, '')
315
321
  }
316
322
 
317
- if(setting.isHover || setting.isDark || (setting.isMq !== '') || (setting.isData !== '') || (setting.isAria !== '') || (setting.isAttr !== '')) {
323
+ if((setting.isPHover !== '') || setting.isHover || setting.isDark || (setting.isMq !== '') || (setting.isData !== '') || (setting.isAria !== '') || (setting.isAttr !== '')) {
318
324
  let regex = param[i].match(/^([\d\-a-z]+):([^!\s]+)(!)?$/)
319
325
  setting.important = (!!regex[3]) ? ' !important' : ''
320
326
  setting.prop = expandShorthand(regex[1])
321
327
  setting.value = replaceCssPropertyValueWBracket(regex[2])
322
328
 
329
+ if(setting.isPHover !== '') {
330
+ setting.isPHover += ':hover '
331
+ }
332
+
323
333
  for(let j = 0, m = setting.prop.length; j < m; j ++) {
324
- const css = `${setting.isMq !== '' ? '@media screen and ' + setting.isMq + ' { ' : ''}${setting.isDark ? ':root.dark ' : ''}${rule.selector}${setting.isData}${setting.isAria}${setting.isAttr}${setting.isHover ? ':hover' : ''}{${setting.prop[j]}: ${setting.value}}${setting.isMq !== '' ? ' }' : ''}`
334
+ const css = `${setting.isMq !== '' ? '@media screen and ' + setting.isMq + ' { ' : ''}${setting.isDark ? ':root.dark ' : ''}${setting.isPHover}${rule.selector}${setting.isData}${setting.isAria}${setting.isAttr}${setting.isHover ? ':hover' : ''}{${setting.prop[j]}: ${setting.value}}${setting.isMq !== '' ? ' }' : ''}`
325
335
  rule.after(css)
326
336
  }
327
337
  } else if(/^([\d\-a-z]+):([^!\s]+)(!)?$/.test(param[i])) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "postcss-enumerates-in-line",
3
3
  "type": "module",
4
- "version": "1.1.0",
4
+ "version": "1.3.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/hadukinei/postcss-enumerates-in-line"