refactor: simplify theme structure and remove color-related code

This commit is contained in:
Hachi-R 2025-02-15 20:42:26 -03:00
parent 0a37ce4cda
commit ec638d1a7a
5 changed files with 9 additions and 80 deletions

View file

@ -1,24 +1,6 @@
import { z } from "zod";
const isValidHexColor = (color: string): boolean => {
const hexColorRegex = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
return hexColorRegex.test(color);
};
const hexColorSchema = z.string().refine(isValidHexColor);
type HexColorType = z.infer<typeof hexColorSchema>;
export interface Theme {
id: string;
name: string;
colors: {
accent: HexColorType;
background: HexColorType;
surface: HexColorType;
optional1?: HexColorType;
optional2?: HexColorType;
};
description?: string;
author: string | undefined;
authorName: string | undefined;
isActive: boolean;