File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -203,14 +203,13 @@ const IS_COLOR_FN = /^(rgba?|hsla?|hwb|color|(ok)?(lab|lch)|light-dark|color-mix
203203export function isColor ( value : string , theme ?: CustomThemeConfig ) : boolean {
204204 if ( ! value ) return false
205205
206- let isThemeColor = false
207-
208- if ( theme ) {
209- const [ trueValue , ] = segment ( value , '/' )
210- isThemeColor = ! ! trueValue . split ( '-' ) . reduce ( ( acc , val ) => acc [ val ] , theme . colors as any ) ;
211- }
206+ const isThemeColor =
207+ theme &&
208+ ! ! segment ( value , "/" ) ?. [ 0 ]
209+ . split ( "-" )
210+ . reduce ( ( acc , val ) => acc [ val ] , theme . colors as any ) ;
212211
213212 return (
214213 value . charCodeAt ( 0 ) === HASH || IS_COLOR_FN . test ( value ) || NAMED_COLORS . has ( value . toLowerCase ( ) ) || isThemeColor
215214 )
216- }
215+ }
You can’t perform that action at this time.
0 commit comments