Skip to content

Commit

Permalink
Added symbol conversion for single quote and bug fixes (#58)
Browse files Browse the repository at this point in the history
* narrow down the match rule of universal selector

* add symbol conversion for single quote

* bump version to 1.5.3
  • Loading branch information
ItsRyanWu authored Aug 14, 2022
1 parent 80553a6 commit 1a99cf4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dcasia/mini-program-tailwind-webpack-plugin",
"version": "1.5.1",
"version": "1.5.3",
"description": "让你的小程序用上原汁原味的 Tailwind/Windi CSS",
"keywords": [
"mini-program",
Expand Down
2 changes: 1 addition & 1 deletion src/postcss/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function transformSelector(options: Options) {
customReplacement.set(/^(\.-?space-\w-reverse).*/, spaceBetweenItems.map(item => `$1>${ item }:not([hidden])`).join(', '))
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(', '))
customReplacement.set(/^(\.-?divide-\w-reverse).*/, divideItems.map(item => `$1>${ item }:not([hidden])`).join(', '))
customReplacement.set('*', allComponents.join(', '))
customReplacement.set(/(\*$|\*(?=,))/, allComponents.join(', '))

return {
postcssPlugin: 'transformSelectorName',
Expand Down
1 change: 1 addition & 0 deletions src/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const charactersMap = {
':': '-c-',
',': '-2c-',
'%': '-p-',
'\'': '-q-',
}

const specialCharactersMap = {
Expand Down

0 comments on commit 1a99cf4

Please sign in to comment.