From 0d7c64b4e9293e8bb224f925772ca76befbf23a2 Mon Sep 17 00:00:00 2001 From: FlowerF <1647231392@qq.com> Date: Fri, 2 Sep 2022 00:50:06 +0800 Subject: [PATCH 1/2] fix: add the colon operator support for react-jsx --- packages/transformer-attributify-jsx/README.md | 4 ---- packages/transformer-attributify-jsx/src/index.ts | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/transformer-attributify-jsx/README.md b/packages/transformer-attributify-jsx/README.md index ad5111b09d..8df15d5d6b 100644 --- a/packages/transformer-attributify-jsx/README.md +++ b/packages/transformer-attributify-jsx/README.md @@ -73,8 +73,6 @@ export default defineConfig({ ```html
-
-
``` @@ -83,8 +81,6 @@ Instead, you may want to use valued attributes instead: ```html
-
-
``` diff --git a/packages/transformer-attributify-jsx/src/index.ts b/packages/transformer-attributify-jsx/src/index.ts index 59ea69df27..6bcb415c6e 100644 --- a/packages/transformer-attributify-jsx/src/index.ts +++ b/packages/transformer-attributify-jsx/src/index.ts @@ -73,7 +73,7 @@ export default function transformerAttributifyJsx(options: TransformerAttributif for (const item of Array.from(code.original.matchAll(elementRE))) { for (const attr of item[3].matchAll(attributeRE)) { - const matchedRule = attr[0] + const matchedRule = attr[0].replace(/\:/i, '-') if (matchedRule.includes('=') || isBlocked(matchedRule)) continue From 145b68630fba350a1163a3d6b3db1b1efe7c31d4 Mon Sep 17 00:00:00 2001 From: FlowerF <1647231392@qq.com> Date: Fri, 2 Sep 2022 00:52:44 +0800 Subject: [PATCH 2/2] fix: add the colon operator support for react-jsx --- test/transformer-attributify-jsx.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/transformer-attributify-jsx.test.ts b/test/transformer-attributify-jsx.test.ts index 9a28678226..a831a095aa 100644 --- a/test/transformer-attributify-jsx.test.ts +++ b/test/transformer-attributify-jsx.test.ts @@ -15,7 +15,7 @@ describe('transformerAttributifyJs', () => {
The instant on-demand Atomic CSS engine.
-