Files
star-erp/resources/css/app.css

281 lines
7.7 KiB
CSS
Raw Normal View History

2025-12-30 15:03:19 +08:00
@import "tailwindcss";
@plugin "@tailwindcss/typography";
2025-12-30 15:03:19 +08:00
@theme {
--font-sans: 'Noto Sans TC', ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
/* Map Tailwind colors to CSS variables */
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-card: var(--card);
--color-card-foreground: var(--card-foreground);
--color-popover: var(--popover);
--color-popover-foreground: var(--popover-foreground);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
--color-secondary: var(--secondary);
--color-secondary-foreground: var(--secondary-foreground);
--color-muted: var(--muted);
--color-muted-foreground: var(--muted-foreground);
--color-accent: var(--accent);
--color-accent-foreground: var(--accent-foreground);
--color-destructive: var(--destructive);
--color-destructive-foreground: var(--destructive-foreground);
--color-border: var(--border);
--color-input: var(--input);
--color-ring: var(--ring);
--color-background-light: var(--background-light);
--color-background-light-grey: var(--background-light-grey);
--color-grey-0: var(--grey-0);
--color-grey-1: var(--grey-1);
--color-grey-2: var(--grey-2);
--color-grey-3: var(--grey-3);
--color-grey-4: var(--grey-4);
--color-grey-5: var(--grey-5);
--color-primary-main: var(--primary-main);
--color-primary-dark: var(--primary-dark);
--color-primary-light: var(--primary-light);
--color-primary-lighter: var(--primary-lighter);
--color-primary-lightest: var(--primary-lightest);
--radius-lg: var(--radius-card);
--radius-md: var(--radius-button);
--radius-sm: var(--radius-xs);
}
@layer base {
:root {
/* Typography */
--font-h1: 40px;
--line-h1: 48px;
--font-h2: 32px;
--line-h2: 40px;
--font-h3: 28px;
--line-h3: 36px;
--font-h4: 24px;
--line-h4: 32px;
--font-h5: 20px;
--line-h5: 28px;
--font-body: 16px;
--line-body: 24px;
--weight-regular: 400;
--weight-medium: 500;
--weight-semibold: 600;
--weight-bold: 700;
--weight-extrabold: 800;
/* Colors */
--grey-0: #1a1a1a;
--grey-1: #4a4a4a;
--grey-2: #6b6b6b;
--grey-3: #9e9e9e;
--grey-4: #e0e0e0;
--grey-5: #fff;
--primary-main: #01ab83;
--primary-dark: #018a6a;
--primary-light: #33bc9a;
--primary-lightest: #e6f7f3;
--background-light: #f8fdfb;
--background-light-grey: #f5f5f5;
--background-white: #fff;
/* Shadcn Semantic Mapping */
--background: var(--background-light);
--foreground: var(--grey-0);
--card: var(--background-white);
--card-foreground: var(--grey-0);
--popover: var(--background-white);
--popover-foreground: var(--grey-0);
--primary: var(--primary-main);
--primary-foreground: var(--grey-5);
--secondary: var(--background-light-grey);
--secondary-foreground: var(--grey-0);
--muted: var(--grey-4);
--muted-foreground: var(--grey-2);
--accent: var(--primary-light);
--accent-foreground: var(--grey-5);
--destructive: #dc2626;
--destructive-foreground: var(--grey-5);
--border: var(--grey-4);
--input: transparent;
--ring: var(--primary-main);
--radius: 8px;
--radius-button: 8px;
--radius-card: 12px;
/* Other State Colors */
--other-success: #01ab83;
--other-error: #dc2626;
--other-warning: #f59e0b;
--other-info: #3b82f6;
/* Button Colors */
--button-success-normal: #01ab83;
--button-success-hover: #33bc9a;
--button-success-active: #018a6a;
--button-info-normal: #3b82f6;
--button-info-hover: #60a5fa;
--button-info-active: #2563eb;
--button-warning-normal: #f59e0b;
--button-warning-hover: #fbbf24;
--button-warning-active: #d97706;
--button-err-normal: #dc2626;
--button-err-hover: #ef4444;
--button-err-active: #b91c1c;
--button-main-normal: #018a6a;
--button-main-disable: #b3e5d9;
--button-main-hover: #01ab83;
--button-main-active: #016b54;
}
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
font-family: 'Noto Sans TC', sans-serif;
}
/* Exact typography logic modified to check the element itself, not parent/siblings */
h1:where(:not([class*=" text-"]):not([class^="text-"])) {
font-size: var(--font-h1);
font-weight: var(--weight-bold);
line-height: var(--line-h1);
}
h2:where(:not([class*=" text-"]):not([class^="text-"])) {
font-size: var(--font-h2);
font-weight: var(--weight-semibold);
line-height: var(--line-h2);
}
h3:where(:not([class*=" text-"]):not([class^="text-"])) {
font-size: var(--font-h3);
font-weight: var(--weight-semibold);
line-height: var(--line-h3);
}
p:where(:not([class*=" text-"]):not([class^="text-"])) {
font-size: var(--font-body);
font-weight: var(--weight-regular);
line-height: var(--line-body);
}
}
.button-filled-primary {
@apply bg-[var(--primary-main)] text-[var(--grey-5)] border-transparent transition-colors shadow-sm disabled:bg-[var(--button-main-disable)] disabled:text-[var(--grey-5)] disabled:cursor-not-allowed;
}
.button-filled-primary:hover {
@apply bg-[var(--primary-dark)];
}
.button-filled-primary:active {
@apply bg-[var(--button-main-active)];
}
.button-outlined-primary {
@apply border-2 text-[var(--grey-0)] bg-transparent transition-colors disabled:border-[var(--grey-4)] disabled:text-[var(--grey-3)] disabled:cursor-not-allowed;
border-color: var(--primary-main);
}
.button-outlined-primary:hover {
@apply bg-[var(--primary-lightest)] text-[var(--grey-0)];
border-color: var(--primary-main);
}
.button-filled-success {
@apply bg-[var(--button-success-normal)] text-[var(--grey-5)] border-transparent transition-colors shadow-sm;
}
.button-filled-success:hover {
@apply bg-[var(--button-success-hover)];
}
.button-filled-success:active {
@apply bg-[var(--button-success-active)];
}
.button-outlined-success {
@apply border-2 text-[var(--grey-0)] bg-transparent transition-colors;
border-color: var(--other-success);
}
.button-filled-info {
@apply bg-[var(--button-info-normal)] text-[var(--grey-5)] border-transparent transition-colors shadow-sm;
}
.button-filled-info:hover {
@apply bg-[var(--button-info-hover)];
}
.button-filled-info:active {
@apply bg-[var(--button-info-active)];
}
.button-outlined-info {
@apply border-2 text-[var(--grey-0)] bg-transparent transition-colors;
border-color: var(--other-info);
}
.button-filled-warning {
@apply bg-[var(--button-warning-normal)] text-[var(--grey-5)] border-transparent transition-colors shadow-sm;
}
.button-filled-warning:hover {
@apply bg-[var(--button-warning-hover)];
}
.button-filled-warning:active {
@apply bg-[var(--button-warning-active)];
}
.button-outlined-warning {
@apply border-2 text-[var(--grey-0)] bg-transparent transition-colors;
border-color: var(--other-warning);
}
.button-filled-error {
@apply bg-[var(--button-err-normal)] text-[var(--grey-5)] border-transparent transition-colors shadow-sm;
}
.button-filled-error:hover {
@apply bg-[var(--button-err-hover)];
}
.button-filled-error:active {
@apply bg-[var(--button-err-active)];
}
.button-outlined-error {
@apply border-2 text-[var(--grey-0)] bg-transparent transition-colors disabled:border-[var(--grey-4)] disabled:text-[var(--grey-3)] disabled:cursor-not-allowed;
border-color: var(--other-error);
}
.button-outlined-error:hover {
@apply bg-red-50 text-[var(--grey-0)];
2025-12-30 15:03:19 +08:00
border-color: var(--other-error);
}
.button-text-primary {
@apply text-[var(--primary-main)] bg-transparent border-none transition-colors;
}
.button-text-primary:hover {
@apply bg-[var(--background-light)] text-[var(--primary-main)];
}