From 60e96821fb8aa73b5f626c4d773f5074c6f5076a Mon Sep 17 00:00:00 2001 From: qixiyu Date: Thu, 23 Mar 2023 18:11:54 +0800 Subject: [PATCH 1/2] fix: pseudo-element is not work --- src/utils/stringify.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/utils/stringify.ts b/src/utils/stringify.ts index c3ea03b5..fe71c8e0 100644 --- a/src/utils/stringify.ts +++ b/src/utils/stringify.ts @@ -145,7 +145,11 @@ export const stringify = ( } } else { - cssText = write(cssText, selectors, conditions, name, data, isAtRuleLike, isVariableLike) + let cssRuleData = data + if (name === 'content') { + cssRuleData = data ? `${data}` : '""' + } + cssText = write(cssText, selectors, conditions, name, cssRuleData, isAtRuleLike, isVariableLike) } } } From f5f00f44eeec8eceff726bed3674571f550faac3 Mon Sep 17 00:00:00 2001 From: qixiyu Date: Tue, 28 Mar 2023 19:42:41 +0800 Subject: [PATCH 2/2] fix(stringify.ts): Add single quotes to the content attribute --- src/utils/stringify.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/utils/stringify.ts b/src/utils/stringify.ts index fe71c8e0..8e71371e 100644 --- a/src/utils/stringify.ts +++ b/src/utils/stringify.ts @@ -147,13 +147,12 @@ export const stringify = ( else { let cssRuleData = data if (name === 'content') { - cssRuleData = data ? `${data}` : '""' + cssRuleData = data ? `"${data}"` : '""' } cssText = write(cssText, selectors, conditions, name, cssRuleData, isAtRuleLike, isVariableLike) } } } - return cssText }