mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-19 02:17:09 +00:00
Add a two-dimensional theme system: Style (Clean/Playful) × Mode (Light/Dark/System). Theme infrastructure: - ThemeContext with style + mode state, matchMedia listener, localStorage persistence - ThemePopover in sidebar for switching style and mode - FOUC prevention via inline script in index.html - CSS custom properties for radius, shadows, fonts (resolved per theme) - design.ts migrated to CSS variable refs Playful theme features: - Wobbly border-radius on cards, buttons, badges, inputs, dialogs - Hard offset shadows (no blur) for sketch aesthetic - Caveat handwritten font for headings, DM Sans for body text - Dotted paper texture background - Skill cards as pastel sticky notes with masking tape strips - Wavy underlines on links - Dashed sidebar border with Caveat section headers - Per-card wobble variety (6 unique border-radius patterns) Component enhancements: - ss-* CSS class hooks on all themed components for CSS-only overrides - SegmentedControl: aria-pressed for theme targeting, clean defaults - SkillDetailSkeleton: custom loading skeleton matching detail page layout - Dashboard Quick Action cards: hover animations (pulse/bounce) - AuditPage: fix tour step targeting Clean theme unchanged — all Playful styles scoped under [data-theme="playful"].
35 lines
1.4 KiB
HTML
35 lines
1.4 KiB
HTML
<!doctype html>
|
|
<html lang="en" data-theme="playful">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<link rel="icon" type="image/png" href="/logo.png" />
|
|
<link rel="shortcut icon" type="image/png" href="/logo.png" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>Skillshare Web Dashboard</title>
|
|
<!-- DM Sans (all) + Caveat (Playful headings) — single CDN request -->
|
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
<link
|
|
href="https://fonts.googleapis.com/css2?family=Caveat:wght@600;700&family=DM+Sans:wght@400;500;600;700&display=swap"
|
|
rel="stylesheet"
|
|
/>
|
|
<script>
|
|
// FOUC prevention: handle Clean theme + dark mode before first paint
|
|
// Default is Playful (already set on <html>); only remove for explicit Clean
|
|
(function() {
|
|
var style = localStorage.getItem('skillshare-style');
|
|
var pref = localStorage.getItem('skillshare-theme-preference');
|
|
if (style === 'clean') {
|
|
document.documentElement.removeAttribute('data-theme');
|
|
}
|
|
var dark = pref === 'dark' || (pref === 'system' && matchMedia('(prefers-color-scheme: dark)').matches);
|
|
if (dark) document.documentElement.classList.add('dark');
|
|
})();
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div id="root"></div>
|
|
<script type="module" src="/src/main.tsx"></script>
|
|
</body>
|
|
</html>
|