@@ -4,7 +4,7 @@ import { getIconCSS } from '@iconify/utils/lib/css/icon'
4
4
import type { PropType } from 'vue'
5
5
import type { IconifyIcon } from '@iconify/types'
6
6
import type { NuxtIconRuntimeOptions , NuxtIconRuntimeServerOptions , IconifyIconCustomizeCallback } from '../../types'
7
- import { loadIcon } from './shared'
7
+ import { loadIcon , resolveCustomizeFn } from './shared'
8
8
import { useAppConfig , useNuxtApp , useHead , useRuntimeConfig , onServerPrefetch } from '#imports'
9
9
10
10
// This should only be used in the client side
@@ -72,7 +72,8 @@ export const NuxtIconCss = /* @__PURE__ */ defineComponent({
72
72
required : true ,
73
73
} ,
74
74
customize : {
75
- type : Function as PropType < IconifyIconCustomizeCallback > ,
75
+ type : [ Function , Boolean , null ] as PropType < IconifyIconCustomizeCallback | boolean | null > ,
76
+ default : null ,
76
77
required : false ,
77
78
} ,
78
79
} ,
@@ -101,10 +102,11 @@ export const NuxtIconCss = /* @__PURE__ */ defineComponent({
101
102
if ( options . cssWherePseudo ) {
102
103
iconSelector = `:where(${ iconSelector } )`
103
104
}
105
+
104
106
const css = getIconCSS ( icon , {
105
107
iconSelector,
106
108
format : 'compressed' ,
107
- customise : props . customize ?? options . customize ,
109
+ customise : resolveCustomizeFn ( props . customize , options . customize ) ,
108
110
} )
109
111
if ( options . cssLayer && withLayer ) {
110
112
return `@layer ${ options . cssLayer } { ${ css } }`
0 commit comments