Skip to content

Commit

Permalink
fix: toggle and row hover colors (#4169)
Browse files Browse the repository at this point in the history
* Fix toggle colors

* Fix row hover color
  • Loading branch information
lucaseduoli authored Oct 16, 2024
1 parent 9a97fc9 commit c670778
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/frontend/src/components/ui/switch.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
"use client";

import { cn } from "@/utils/utils";
import * as SwitchPrimitives from "@radix-ui/react-switch";
import * as React from "react";
import { cn } from "../../utils/utils";

const Switch = React.forwardRef<
React.ElementRef<typeof SwitchPrimitives.Root>,
React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>
>(({ className, ...props }, ref) => (
<SwitchPrimitives.Root
className={cn(
"peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-ring",
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
className,
)}
{...props}
ref={ref}
>
<SwitchPrimitives.Thumb
aria-disabled={props.disabled}
className={cn(
"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform aria-disabled:bg-muted/70 data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",
"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",
)}
/>
</SwitchPrimitives.Root>
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/style/ag-theme-shadcn.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
--ag-selected-row-background-color: hsl(var(--accent));
--ag-menu-background-color: hsl(var(--accent));
--ag-panel-background-color: hsl(var(--accent));
--ag-row-hover-color: hsl(var(--accent));
--ag-row-hover-color: hsl(var(--primary-foreground));
--ag-header-height: 2.5rem;
}

Expand Down

0 comments on commit c670778

Please sign in to comment.