Skip to content

Commit

Permalink
Fix default values not working with intellisense (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniGuardiola authored Nov 5, 2023
1 parent a5c8345 commit b1abfce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/strong-toes-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tailwind-ink": patch
---

Fix default values not working with intellisense (grow and shrink utilities)
5 changes: 4 additions & 1 deletion src/intellisense/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ export function numericUtility(
values?: DynamicUtilityValues;
} = {},
): DynamicUtility {
const valuesWithDefault = { ...values };
if (options.defaultValue)
valuesWithDefault.DEFAULT = String(options.defaultValue);
return [
(value) => {
const transformer = numericTransformer(property, options);
Expand All @@ -109,7 +112,7 @@ export function numericUtility(
return `${key}: ${value}`;
}
},
values,
valuesWithDefault,
];
}

Expand Down

0 comments on commit b1abfce

Please sign in to comment.