Files
gameyfin/frontend/@/lib/utils.ts
T
grimsi 47f8febbd2 WIP: Theme switcher
- Light/Dark Toggle works
- Theme Preview works
- TODO: Theme switching
2024-04-08 11:33:47 +02:00

21 lines
569 B
TypeScript

import {type ClassValue, clsx} from "clsx"
import {twMerge} from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
export function cssVar(variable: string) {
return getComputedStyle(document.documentElement).getPropertyValue(`--${variable}`);
}
export function hsl(hsl: string) {
return `hsl(${hsl}`;
}
export function rand(min: number, max: number) {
const minCeiled = Math.ceil(min);
const maxFloored = Math.floor(max);
return Math.floor(Math.random() * (maxFloored - minCeiled) + minCeiled);
}