- Colour tokens reach WCAG AA: lighter muted text and accent in the dark theme, darker muted/success/warning/danger/donate in the light theme, and new accent-solid / danger-solid fills for buttons with white text. tests/styles/contrast.test.ts checks every text token on every surface. - Generated text carries its language (lang) on Output, the YouTube and quick previews, History, Batch, Social and Playlist, so screen readers read Japanese output with a Japanese voice. - RouteAnnouncer reads the new page's name after a navigation; focus stays. - Toast region and close button are translated; Alt+T is in the shortcut list. - Endings table inputs and the custom bank name get accessible names; the From/To headers are translated. - Settings > Editor > Single-key shortcuts turns the bare ? off (WCAG 2.1.4). - Text inputs use outline-hidden so the focus outline shows in Windows High Contrast; the genre remove button is 24px, small close/dismiss buttons grow on touch screens. - Desktop: zoomHotkeysEnabled (Ctrl/Cmd + = / -), with the set-webview-zoom permission for the macOS/Linux polyfill. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
461 lines
11 KiB
CSS
461 lines
11 KiB
CSS
@import "tailwindcss";
|
||
|
||
/*
|
||
* YTDescGen design system (v1.0.0).
|
||
*
|
||
* Tailwind 4 is configured in CSS:
|
||
* @custom-variant dark — the app toggles a `.dark` / `.light` class on
|
||
* <html> (theme-init.js, settings-store) rather than
|
||
* following the OS.
|
||
* @theme — maps Tailwind names (bg-surface-1, text-text-muted,
|
||
* rounded-card …) onto the runtime variables below.
|
||
*
|
||
* The palette lives in the plain `:root` / `.light` blocks because those are
|
||
* what the theme toggle rewrites at runtime; @theme does not own the values.
|
||
* Components use tokens only — never raw colours — so both themes stay right.
|
||
*/
|
||
@custom-variant dark (&:where(.dark, .dark *));
|
||
|
||
@theme {
|
||
--color-surface-0: var(--surface-0);
|
||
--color-surface-1: var(--surface-1);
|
||
--color-surface-2: var(--surface-2);
|
||
--color-surface-3: var(--surface-3);
|
||
--color-overlay: var(--overlay);
|
||
|
||
--color-border: var(--border);
|
||
--color-border-strong: var(--border-strong);
|
||
|
||
--color-text-primary: var(--text-primary);
|
||
--color-text-secondary: var(--text-secondary);
|
||
--color-text-muted: var(--text-muted);
|
||
|
||
--color-accent: var(--accent);
|
||
--color-accent-hover: var(--accent-hover);
|
||
--color-accent-muted: var(--accent-muted);
|
||
--color-accent-fg: var(--accent-fg);
|
||
--color-accent-solid: var(--accent-solid);
|
||
--color-accent-solid-hover: var(--accent-solid-hover);
|
||
--color-brand-from: var(--brand-from);
|
||
--color-brand-to: var(--brand-to);
|
||
|
||
--color-success: var(--success);
|
||
--color-warning: var(--warning);
|
||
--color-danger: var(--danger);
|
||
--color-danger-solid: var(--danger-solid);
|
||
--color-danger-solid-hover: var(--danger-solid-hover);
|
||
--color-info: var(--info);
|
||
--color-donate: var(--donate);
|
||
|
||
--font-sans: var(--font-sans-stack);
|
||
--font-mono: var(--font-mono-stack);
|
||
|
||
--radius-control: 0.625rem;
|
||
--radius-card: 0.875rem;
|
||
--radius-panel: 1.125rem;
|
||
|
||
--shadow-card: var(--shadow-card-value);
|
||
--shadow-pop: var(--shadow-pop-value);
|
||
|
||
/* Controls are compact on a mouse and 44px on touch (see :root). */
|
||
--spacing-control: var(--control-h);
|
||
--spacing-control-sm: var(--control-h-sm);
|
||
--spacing-touch: 44px;
|
||
|
||
--animate-fade-in: fade-in 160ms ease-out;
|
||
--animate-pop-in: pop-in 180ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
|
||
--animate-slide-up: slide-up 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
|
||
--animate-shimmer: shimmer 1.6s linear infinite;
|
||
|
||
@keyframes fade-in {
|
||
from {
|
||
opacity: 0;
|
||
}
|
||
to {
|
||
opacity: 1;
|
||
}
|
||
}
|
||
@keyframes pop-in {
|
||
from {
|
||
opacity: 0;
|
||
transform: scale(0.96);
|
||
}
|
||
to {
|
||
opacity: 1;
|
||
transform: scale(1);
|
||
}
|
||
}
|
||
@keyframes slide-up {
|
||
from {
|
||
opacity: 0;
|
||
transform: translateY(8px);
|
||
}
|
||
to {
|
||
opacity: 1;
|
||
transform: translateY(0);
|
||
}
|
||
}
|
||
@keyframes shimmer {
|
||
from {
|
||
background-position: -200% 0;
|
||
}
|
||
to {
|
||
background-position: 200% 0;
|
||
}
|
||
}
|
||
}
|
||
|
||
:root {
|
||
/* Dark theme (default) — cool neutrals, indigo→violet brand. */
|
||
color-scheme: dark;
|
||
|
||
--surface-0: #0b0b10;
|
||
--surface-1: #121219;
|
||
--surface-2: #1a1a23;
|
||
--surface-3: #24242f;
|
||
--overlay: rgba(4, 4, 8, 0.66);
|
||
|
||
--border: #25252f;
|
||
--border-strong: #363644;
|
||
|
||
/*
|
||
* Text and status colours keep WCAG AA (4.5:1) on every surface they sit
|
||
* on, and white keeps 4.5:1 on the *-solid fills that carry text (buttons).
|
||
* tests/styles/contrast.test.ts checks both themes — change a value here
|
||
* and it tells you whether the pair still passes.
|
||
*/
|
||
--text-primary: #ececf3;
|
||
--text-secondary: #a4a4b8;
|
||
--text-muted: #8a8aa1;
|
||
|
||
/* `accent` is text, outlines and small marks; filled controls with text on
|
||
them use `accent-solid`, which is darker so white stays readable. */
|
||
--accent: #8b80f8;
|
||
--accent-hover: #9d94f9;
|
||
--accent-muted: rgba(139, 128, 248, 0.16);
|
||
--accent-fg: #ffffff;
|
||
--accent-solid: #6557ee;
|
||
--accent-solid-hover: #5a4ce8;
|
||
--brand-from: #6366f1;
|
||
--brand-to: #a855f7;
|
||
|
||
--success: #34d399;
|
||
--warning: #fbbf24;
|
||
--danger: #f87171;
|
||
--danger-solid: #dc2626;
|
||
--danger-solid-hover: #b91c1c;
|
||
--info: #60a5fa;
|
||
--donate: #f472b6;
|
||
|
||
--shadow-card-value: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px -16px rgba(0, 0, 0, 0.7);
|
||
--shadow-pop-value: 0 24px 60px -20px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.04);
|
||
|
||
--control-h: 2.25rem;
|
||
--control-h-sm: 1.875rem;
|
||
|
||
--font-sans-stack:
|
||
"Inter Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Noto Sans",
|
||
"Noto Sans JP", "Noto Sans KR", "Noto Sans SC", sans-serif;
|
||
--font-mono-stack: "JetBrains Mono Variable", ui-monospace, "Cascadia Code", Menlo, monospace;
|
||
}
|
||
|
||
.light {
|
||
color-scheme: light;
|
||
|
||
--surface-0: #f6f6fa;
|
||
--surface-1: #ffffff;
|
||
--surface-2: #f1f1f6;
|
||
--surface-3: #e6e6ee;
|
||
--overlay: rgba(20, 20, 32, 0.4);
|
||
|
||
--border: #e2e2eb;
|
||
--border-strong: #c8c8d6;
|
||
|
||
--text-primary: #15151d;
|
||
--text-secondary: #4a4a5c;
|
||
--text-muted: #66667a;
|
||
|
||
--accent: #5b4fe6;
|
||
--accent-hover: #6d62ee;
|
||
--accent-muted: rgba(91, 79, 230, 0.1);
|
||
--accent-fg: #ffffff;
|
||
--accent-solid: #5b4fe6;
|
||
--accent-solid-hover: #5246d8;
|
||
|
||
--success: #047857;
|
||
--warning: #a3480a;
|
||
--danger: #c81e1e;
|
||
--danger-solid: #dc2626;
|
||
--danger-solid-hover: #b91c1c;
|
||
--info: #2563eb;
|
||
--donate: #be185d;
|
||
|
||
--shadow-card-value: 0 1px 2px rgba(20, 20, 40, 0.04), 0 8px 24px -18px rgba(20, 20, 40, 0.25);
|
||
--shadow-pop-value: 0 24px 60px -24px rgba(20, 20, 40, 0.35), 0 0 0 1px rgba(20, 20, 40, 0.06);
|
||
}
|
||
|
||
/* Fingers need bigger targets than cursors. */
|
||
@media (pointer: coarse) {
|
||
:root {
|
||
--control-h: 2.75rem;
|
||
--control-h-sm: 2.5rem;
|
||
}
|
||
}
|
||
|
||
/* Toasts clear the phone bottom bar, which shows below the md breakpoint
|
||
(sonner's own "mobile" switch is at 600px, so it can't be relied on). */
|
||
:root {
|
||
--toast-offset-bottom: calc(4.5rem + env(safe-area-inset-bottom));
|
||
}
|
||
@media (min-width: 48rem) {
|
||
:root {
|
||
--toast-offset-bottom: max(1rem, env(safe-area-inset-bottom));
|
||
}
|
||
}
|
||
|
||
@layer base {
|
||
html {
|
||
-webkit-text-size-adjust: 100%;
|
||
text-rendering: optimizeLegibility;
|
||
}
|
||
|
||
body {
|
||
@apply bg-surface-0 text-text-primary font-sans antialiased;
|
||
margin: 0;
|
||
min-height: 100dvh;
|
||
font-size: 0.875rem;
|
||
line-height: 1.5;
|
||
font-feature-settings: "cv11", "ss01";
|
||
}
|
||
|
||
::selection {
|
||
background: var(--accent-muted);
|
||
color: var(--text-primary);
|
||
}
|
||
|
||
/* One focus style everywhere, keyboard only. */
|
||
:focus-visible {
|
||
outline: 2px solid var(--accent);
|
||
outline-offset: 2px;
|
||
}
|
||
|
||
input,
|
||
textarea,
|
||
select,
|
||
button {
|
||
font: inherit;
|
||
}
|
||
|
||
/* Numbers that change (counters, sizes) should not jiggle. */
|
||
.tabular {
|
||
font-variant-numeric: tabular-nums;
|
||
}
|
||
}
|
||
|
||
@layer utilities {
|
||
.bg-brand-gradient {
|
||
background-image: linear-gradient(135deg, var(--brand-from), var(--brand-to));
|
||
}
|
||
.text-brand-gradient {
|
||
background-image: linear-gradient(135deg, var(--brand-from), var(--brand-to));
|
||
-webkit-background-clip: text;
|
||
background-clip: text;
|
||
color: transparent;
|
||
}
|
||
.scrollbar-thin {
|
||
scrollbar-width: thin;
|
||
scrollbar-color: var(--surface-3) transparent;
|
||
}
|
||
.skeleton {
|
||
background: linear-gradient(
|
||
90deg,
|
||
var(--surface-2) 25%,
|
||
var(--surface-3) 37%,
|
||
var(--surface-2) 63%
|
||
);
|
||
background-size: 400% 100%;
|
||
}
|
||
.safe-bottom {
|
||
padding-bottom: env(safe-area-inset-bottom);
|
||
}
|
||
.safe-top {
|
||
padding-top: env(safe-area-inset-top);
|
||
}
|
||
}
|
||
|
||
@media (prefers-reduced-motion: reduce) {
|
||
*,
|
||
*::before,
|
||
*::after {
|
||
animation-duration: 0.01ms !important;
|
||
animation-iteration-count: 1 !important;
|
||
transition-duration: 0.01ms !important;
|
||
scroll-behavior: auto !important;
|
||
}
|
||
}
|
||
|
||
/* Scrollbars (WebKit; Firefox uses .scrollbar-thin / its own defaults). */
|
||
::-webkit-scrollbar {
|
||
width: 10px;
|
||
height: 10px;
|
||
}
|
||
::-webkit-scrollbar-track {
|
||
background: transparent;
|
||
}
|
||
::-webkit-scrollbar-thumb {
|
||
background: var(--surface-3);
|
||
border-radius: 999px;
|
||
border: 3px solid var(--surface-0);
|
||
}
|
||
::-webkit-scrollbar-thumb:hover {
|
||
background: var(--border-strong);
|
||
}
|
||
|
||
/*
|
||
* Settings › Appearance › Hide scrollbars (v1.1.0, src/utils/scrollbars.ts).
|
||
* Only the bars go; the wheel, touchpad, touch and keyboard still scroll.
|
||
* `scrollbar-width` is not inherited, hence the `*`: it covers Chromium
|
||
* (WebView2, Android) and Firefox, while WebKit (the macOS and Linux
|
||
* webviews) needs the pseudo-element. Unlayered, so it beats .scrollbar-thin.
|
||
*/
|
||
html.hide-scrollbars,
|
||
html.hide-scrollbars * {
|
||
scrollbar-width: none;
|
||
}
|
||
html.hide-scrollbars::-webkit-scrollbar,
|
||
html.hide-scrollbars *::-webkit-scrollbar {
|
||
display: none;
|
||
}
|
||
|
||
/*
|
||
* Legal Center documents (src/pages/LegalPage.tsx). The HTML is rendered at
|
||
* build time from the repo's Markdown, so it arrives as bare elements that
|
||
* utility classes cannot reach — style them by descendant here instead.
|
||
*/
|
||
.legal-prose {
|
||
color: var(--text-secondary);
|
||
font-size: 0.9375rem;
|
||
line-height: 1.7;
|
||
overflow-wrap: anywhere;
|
||
}
|
||
.legal-prose h1 {
|
||
color: var(--text-primary);
|
||
font-size: 1.5rem;
|
||
font-weight: 600;
|
||
line-height: 1.3;
|
||
margin: 0 0 0.75rem;
|
||
}
|
||
.legal-prose h2 {
|
||
color: var(--text-primary);
|
||
font-size: 1.125rem;
|
||
font-weight: 600;
|
||
margin: 2rem 0 0.625rem;
|
||
padding-top: 0.75rem;
|
||
border-top: 1px solid var(--border);
|
||
}
|
||
.legal-prose h3 {
|
||
color: var(--text-primary);
|
||
font-size: 1rem;
|
||
font-weight: 600;
|
||
margin: 1.5rem 0 0.5rem;
|
||
}
|
||
.legal-prose p,
|
||
.legal-prose ul,
|
||
.legal-prose ol,
|
||
.legal-prose table,
|
||
.legal-prose pre,
|
||
.legal-prose blockquote {
|
||
margin: 0 0 1rem;
|
||
}
|
||
.legal-prose ul,
|
||
.legal-prose ol {
|
||
padding-left: 1.25rem;
|
||
}
|
||
.legal-prose ul {
|
||
list-style: disc;
|
||
}
|
||
.legal-prose ol {
|
||
list-style: decimal;
|
||
}
|
||
.legal-prose li + li {
|
||
margin-top: 0.25rem;
|
||
}
|
||
.legal-prose a {
|
||
color: var(--accent);
|
||
text-decoration: underline;
|
||
text-underline-offset: 2px;
|
||
}
|
||
.legal-prose strong {
|
||
color: var(--text-primary);
|
||
}
|
||
.legal-prose code {
|
||
font-family: var(--font-mono-stack);
|
||
font-size: 0.85em;
|
||
background: var(--surface-2);
|
||
border-radius: 0.375rem;
|
||
padding: 0.1em 0.35em;
|
||
}
|
||
.legal-prose pre {
|
||
background: var(--surface-2);
|
||
border-radius: 0.75rem;
|
||
padding: 1rem;
|
||
overflow-x: auto;
|
||
font-size: 0.8125rem;
|
||
line-height: 1.55;
|
||
}
|
||
.legal-prose pre code {
|
||
background: none;
|
||
padding: 0;
|
||
}
|
||
.legal-prose pre.plain {
|
||
white-space: pre-wrap;
|
||
}
|
||
.legal-prose table {
|
||
display: block;
|
||
overflow-x: auto;
|
||
border-collapse: collapse;
|
||
font-size: 0.875rem;
|
||
}
|
||
.legal-prose th,
|
||
.legal-prose td {
|
||
text-align: left;
|
||
vertical-align: top;
|
||
padding: 0.5rem 0.75rem;
|
||
border-bottom: 1px solid var(--border);
|
||
}
|
||
.legal-prose th {
|
||
color: var(--text-primary);
|
||
font-weight: 600;
|
||
}
|
||
.legal-prose blockquote {
|
||
border-left: 3px solid var(--accent);
|
||
padding-left: 1rem;
|
||
color: var(--text-muted);
|
||
}
|
||
|
||
/* Sheet entrances (Drawer). */
|
||
@keyframes drawer-in-left {
|
||
from {
|
||
transform: translateX(-100%);
|
||
}
|
||
to {
|
||
transform: translateX(0);
|
||
}
|
||
}
|
||
@keyframes drawer-in-right {
|
||
from {
|
||
transform: translateX(100%);
|
||
}
|
||
to {
|
||
transform: translateX(0);
|
||
}
|
||
}
|
||
@keyframes drawer-in-bottom {
|
||
from {
|
||
transform: translateY(100%);
|
||
}
|
||
to {
|
||
transform: translateY(0);
|
||
}
|
||
}
|