Skip to content

Commit 1a99cf4

Browse files
authored
Added symbol conversion for single quote and bug fixes (#58)
* narrow down the match rule of universal selector * add symbol conversion for single quote * bump version to 1.5.3
1 parent 80553a6 commit 1a99cf4

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@dcasia/mini-program-tailwind-webpack-plugin",
3-
"version": "1.5.1",
3+
"version": "1.5.3",
44
"description": "让你的小程序用上原汁原味的 Tailwind/Windi CSS",
55
"keywords": [
66
"mini-program",

src/postcss/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function transformSelector(options: Options) {
2424
customReplacement.set(/^(\.-?space-\w-reverse).*/, spaceBetweenItems.map(item => `$1>${ item }:not([hidden])`).join(', '))
2525
customReplacement.set(/^(\.-?divide-\w+)(-.+?)?\s?>.*/, divideItems.map(item => `$1$2:not($1-reverse)>${ item }:not([hidden]):not(:first-child), $1$2$1-reverse>${ item }:not([hidden]):not(:last-child)`).join(', '))
2626
customReplacement.set(/^(\.-?divide-\w-reverse).*/, divideItems.map(item => `$1>${ item }:not([hidden])`).join(', '))
27-
customReplacement.set('*', allComponents.join(', '))
27+
customReplacement.set(/(\*$|\*(?=,))/, allComponents.join(', '))
2828

2929
return {
3030
postcssPlugin: 'transformSelectorName',

src/utilities.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const charactersMap = {
3232
':': '-c-',
3333
',': '-2c-',
3434
'%': '-p-',
35+
'\'': '-q-',
3536
}
3637

3738
const specialCharactersMap = {

0 commit comments

Comments
 (0)