fix icon color inheritance, tweak select chevron

This commit is contained in:
Justin Edmund 2025-11-30 06:02:50 -08:00
parent bc67d22c4b
commit fcc0a884f5
2 changed files with 9 additions and 15 deletions

View file

@ -52,7 +52,7 @@
class="icon {className}" class="icon {className}"
style="width: {typeof size === 'number' ? `${size}px` : size}; style="width: {typeof size === 'number' ? `${size}px` : size};
height: {typeof size === 'number' ? `${size}px` : size}; height: {typeof size === 'number' ? `${size}px` : size};
color: {color}; {color !== 'currentColor' ? `color: ${color};` : ''}
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
justify-content: center;" justify-content: center;"

View file

@ -58,13 +58,7 @@
) )
const selectClasses = $derived( const selectClasses = $derived(
[ ['select', size, contained && 'contained', fullWidth && 'full', disabled && 'disabled']
'select',
size,
contained && 'contained',
fullWidth && 'full',
disabled && 'disabled'
]
.filter(Boolean) .filter(Boolean)
.join(' ') .join(' ')
) )
@ -94,7 +88,7 @@
<SelectPrimitive.Root <SelectPrimitive.Root
type="single" type="single"
{...(value !== undefined && value !== null ? { value: String(value) } : {})} {...value !== undefined && value !== null ? { value: String(value) } : {}}
onValueChange={handleValueChange} onValueChange={handleValueChange}
{disabled} {disabled}
items={stringOptions} items={stringOptions}
@ -112,7 +106,7 @@
{#each options as option} {#each options as option}
<SelectPrimitive.Item <SelectPrimitive.Item
value={String(option.value)} value={String(option.value)}
{...(option.disabled !== undefined ? { disabled: option.disabled } : {})} {...option.disabled !== undefined ? { disabled: option.disabled } : {}}
class="item" class="item"
> >
{#snippet children({ selected })} {#snippet children({ selected })}
@ -139,7 +133,7 @@
{:else} {:else}
<SelectPrimitive.Root <SelectPrimitive.Root
type="single" type="single"
{...(value !== undefined && value !== null ? { value: String(value) } : {})} {...value !== undefined && value !== null ? { value: String(value) } : {}}
onValueChange={handleValueChange} onValueChange={handleValueChange}
{disabled} {disabled}
items={stringOptions} items={stringOptions}
@ -157,7 +151,7 @@
{#each options as option} {#each options as option}
<SelectPrimitive.Item <SelectPrimitive.Item
value={String(option.value)} value={String(option.value)}
{...(option.disabled !== undefined ? { disabled: option.disabled } : {})} {...option.disabled !== undefined ? { disabled: option.disabled } : {}}
class="item" class="item"
> >
{#snippet children({ selected })} {#snippet children({ selected })}
@ -305,7 +299,7 @@
:global(.chevron) { :global(.chevron) {
flex-shrink: 0; flex-shrink: 0;
color: var(--text-secondary); color: var(--text-tertiary);
margin-left: auto; margin-left: auto;
} }
} }