feat(WIP): update color variables and button styles

This commit includes the following changes:

- Remove the `--card` CSS variable as it is no longer used.
- Update the `--color-disabled-secondary` variable to use the correct value.
- Change the `--color-accent` variable to use a more neutral color.
- Refactor the `buttonVariants` function to accept only the `variant` and `size` props, and apply the `className` prop separately.
- Update the `select` component styles to use the correct text color for focused items.
- Add error handling for the `Logo` component to display a warning if the logo asset is not found.

These changes improve the overall styling and consistency of the application.
This commit is contained in:
Maximilian Liebmann 2025-05-22 15:53:00 +02:00
parent d8cbffa611
commit 5de022b356
4 changed files with 16 additions and 6 deletions

View file

@ -48,8 +48,6 @@
--foreground: oklch(0.13 0.028 261.692);
--card: oklch(1 0 0);
--card-foreground: oklch(0.13 0.028 261.692);
--popover: oklch(1 0 0);
@ -153,7 +151,7 @@
--color-secondary: var(--secondary);
--color-hover-secondary: var(--hover-secondary);
--color-active-secondary: var(--active-secondary);
--disabled-secondary: var(--disabled-secondary);
--color-disabled-secondary: var(--disabled-secondary);
/* Custom values */
@ -189,7 +187,7 @@
--color-muted-foreground: var(--muted-foreground);
--color-accent: var(--accent);
--color-accent: var(--color-neutral-750);
--color-accent-foreground: var(--accent-foreground);

View file

@ -51,7 +51,7 @@ function Button({
return (
<Comp
data-slot='button'
className={cn(buttonVariants({ variant, size, className }))}
className={cn(buttonVariants({ variant, size }), className)}
{...props}
/>
);

View file

@ -110,6 +110,18 @@ export default function Logo({
// Match the varName with the Logo-Asset name and store it in "logoVar"
const logoVar = logoAssets[varName as keyof typeof logoAssets];
if (!logoVar) {
console.error(`Logo: Could not find logo asset for ${varName}`);
return (
<div
role='alert'
className='p-2 text-red-700 bg-red-100 border border-red-500 rounded-md text-xs'
>
Error: Logo asset not found. Check console.
</div>
);
}
return (
<Image
src={logoVar}

View file

@ -107,7 +107,7 @@ function SelectItem({
<SelectPrimitive.Item
data-slot='select-item'
className={cn(
"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
"focus:bg-accent focus:text-text [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
className,
)}
{...props}