@@ -77,8 +77,14 @@ const thisPlugin: PluginType = createPlugin.withOptions<CapsizePluginOptions>(
7777 // Font-size
7878 matchUtilities (
7979 {
80- // @ts -expect-error -- Extra custom properties mismatches base type.
8180 text ( value : string | [ string , string | FontSizeOptions ] ) {
81+ /**
82+ * For some reason, tailwindcss-intellisense passes
83+ * object and undefined values in here, so we handle
84+ * those cases so it doesn't break IDE plugins.
85+ */
86+ if ( ! value || isPlainObject ( value ) ) return { }
87+
8288 let [ fontSize , options ] = Array . isArray ( value ) ? value : [ value ]
8389 let fontSizeActual = normalizeValue ( fontSize , rootSize )
8490 let { lineHeight } = (
@@ -87,7 +93,7 @@ const thisPlugin: PluginType = createPlugin.withOptions<CapsizePluginOptions>(
8793
8894 return {
8995 '--font-size-px' : String ( fontSizeActual ) ,
90- ...lineHeightProperties ( lineHeight , rootSize ) ,
96+ ...( lineHeight ? lineHeightProperties ( lineHeight , rootSize ) : { } ) ,
9197 }
9298 } ,
9399 } ,
@@ -100,11 +106,10 @@ const thisPlugin: PluginType = createPlugin.withOptions<CapsizePluginOptions>(
100106 // Line-height
101107 matchUtilities (
102108 {
103- // @ts -expect-error -- Extra custom properties mismatches base type.
104109 leading ( value : string | string [ ] ) {
105110 let lineHeight = normalizeThemeValue ( 'lineHeight' , value ) as string
106111
107- return lineHeightProperties ( lineHeight , rootSize )
112+ return lineHeight ? lineHeightProperties ( lineHeight , rootSize ) : { }
108113 } ,
109114 } ,
110115 {
0 commit comments