Skip to content

Commit

Permalink
feat: support completions in dynamic plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
voorjaar committed May 24, 2021
1 parent 58ebc9a commit bb15061
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 37 deletions.
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
"ts-jest": "26.5.6",
"tslib": "2.2.0",
"typescript": "4.2.4",
"windicss": "3.0.9",
"windicss": "3.0.12",
"windicss-analysis": "0.2.0"
}
}
3 changes: 1 addition & 2 deletions src/utils/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ export function generateCompletions(processor: Processor, colors: colorObject, a
dynamic: {},
},
};

const staticUtilities = processor.resolveStaticUtilities(true);
// generate normal utilities completions
for (const [config, list] of Object.entries(utilities)) {
for (const [config, list] of Object.entries({ ...utilities, ...processor._plugin.completions })) {
for (const utility of list) {
const bracket = utility.indexOf('[');
if (bracket !== -1) {
Expand Down
26 changes: 0 additions & 26 deletions src/utils/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -786,32 +786,6 @@ const utilities: { [key:string]: string[]} = {
'z-{int}',
'z-${var}',
],

// Plugins
typography: [
'prose-sm',
'prose',
'prose-lg',
'prose-xl',
'prose-2xl',
'prose-red',
'prose-yellow',
'prose-green',
'prose-blue',
'prose-indigo',
'prose-purple',
'prose-pink',
],
aspectRatio: [
'aspect-none',
'aspect-w-{float}',
'aspect-h-{float}',
'aspect-{fraction}',
],
lineClamp: [
'line-clamp-none',
'line-clamp-{int}',
],
};

const negative: { [key:string]: true} = {
Expand Down

0 comments on commit bb15061

Please sign in to comment.