rizzo-css 0.0.80 → 0.0.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/rizzo-css.js +15 -3
- package/package.json +1 -1
- package/scaffold/react/DocsSidebar.tsx +130 -28
- package/scaffold/react/ThemeIcon.tsx +57 -0
- package/scaffold/react/base/package.json +1 -1
- package/scaffold/react/themes.ts +54 -0
- package/scaffold/react/variants/full/README-RIZZO.md +35 -0
- package/scaffold/react/variants/full/package.json +24 -0
- package/scaffold/react/variants/full/src/App.tsx +41 -0
- package/scaffold/react/variants/full/src/config/componentCategories.ts +43 -0
- package/scaffold/react/variants/full/src/config/docsNav.ts +70 -0
- package/scaffold/react/variants/full/src/index.css +96 -0
- package/scaffold/react/variants/full/src/layouts/BlocksLayout.tsx +124 -0
- package/scaffold/react/variants/full/src/layouts/DocsLayout.tsx +93 -0
- package/scaffold/react/variants/full/src/main.tsx +13 -0
- package/scaffold/react/variants/full/src/views/BlocksIndex.tsx +56 -0
- package/scaffold/react/variants/full/src/views/DocsComponents.tsx +56 -0
- package/scaffold/react/variants/full/src/views/DocsGettingStarted.tsx +27 -0
- package/scaffold/react/variants/full/src/views/DocsIndex.tsx +39 -0
- package/scaffold/react/variants/full/src/views/DocsOverview.tsx +39 -0
- package/scaffold/react/variants/full/src/views/Home.tsx +104 -0
- package/scaffold/react/variants/full/src/views/Themes.tsx +118 -0
- package/scaffold/svelte/Settings.svelte +11 -48
- package/scaffold/svelte/variants/full/README-RIZZO.md +1 -0
- package/scaffold/svelte/variants/full/src/config/docsNav.ts +23 -3
- package/scaffold/svelte/variants/full/src/routes/+layout.svelte +4 -1
- package/scaffold/svelte/variants/full/src/routes/blocks/+layout.svelte +4 -2
- package/scaffold/svelte/variants/full/src/routes/docs/+layout.svelte +3 -1
- package/scaffold/svelte/variants/full/src/routes/themes/+page.svelte +130 -69
- package/scaffold/vanilla/README-RIZZO.md +1 -1
- package/scaffold/vanilla/components/accordion.html +8 -0
- package/scaffold/vanilla/components/alert-dialog.html +8 -0
- package/scaffold/vanilla/components/alert.html +8 -0
- package/scaffold/vanilla/components/aspect-ratio.html +8 -0
- package/scaffold/vanilla/components/avatar.html +8 -0
- package/scaffold/vanilla/components/back-to-top.html +8 -0
- package/scaffold/vanilla/components/badge.html +8 -0
- package/scaffold/vanilla/components/breadcrumb.html +8 -0
- package/scaffold/vanilla/components/button-group.html +8 -0
- package/scaffold/vanilla/components/button.html +8 -0
- package/scaffold/vanilla/components/calendar.html +8 -0
- package/scaffold/vanilla/components/cards.html +8 -0
- package/scaffold/vanilla/components/carousel.html +8 -0
- package/scaffold/vanilla/components/chart.html +8 -0
- package/scaffold/vanilla/components/collapsible.html +8 -0
- package/scaffold/vanilla/components/command.html +8 -0
- package/scaffold/vanilla/components/context-menu.html +8 -0
- package/scaffold/vanilla/components/copy-to-clipboard.html +8 -0
- package/scaffold/vanilla/components/dashboard.html +8 -0
- package/scaffold/vanilla/components/direction.html +8 -0
- package/scaffold/vanilla/components/divider.html +8 -0
- package/scaffold/vanilla/components/docs-sidebar.html +8 -0
- package/scaffold/vanilla/components/dropdown.html +8 -0
- package/scaffold/vanilla/components/empty.html +8 -0
- package/scaffold/vanilla/components/font-switcher.html +8 -0
- package/scaffold/vanilla/components/footer.html +8 -0
- package/scaffold/vanilla/components/forms.html +8 -0
- package/scaffold/vanilla/components/hover-card.html +8 -0
- package/scaffold/vanilla/components/icons.html +8 -0
- package/scaffold/vanilla/components/index.html +8 -0
- package/scaffold/vanilla/components/input-group.html +8 -0
- package/scaffold/vanilla/components/input-otp.html +8 -0
- package/scaffold/vanilla/components/kbd.html +8 -0
- package/scaffold/vanilla/components/label.html +8 -0
- package/scaffold/vanilla/components/menubar.html +8 -0
- package/scaffold/vanilla/components/modal.html +8 -0
- package/scaffold/vanilla/components/navbar.html +8 -0
- package/scaffold/vanilla/components/pagination.html +8 -0
- package/scaffold/vanilla/components/popover.html +8 -0
- package/scaffold/vanilla/components/progress-bar.html +8 -0
- package/scaffold/vanilla/components/range-calendar.html +8 -0
- package/scaffold/vanilla/components/resizable.html +8 -0
- package/scaffold/vanilla/components/scroll-area.html +8 -0
- package/scaffold/vanilla/components/search.html +8 -0
- package/scaffold/vanilla/components/separator.html +8 -0
- package/scaffold/vanilla/components/settings.html +8 -0
- package/scaffold/vanilla/components/sheet.html +8 -0
- package/scaffold/vanilla/components/skeleton.html +8 -0
- package/scaffold/vanilla/components/slider.html +8 -0
- package/scaffold/vanilla/components/sound-effects.html +8 -0
- package/scaffold/vanilla/components/spinner.html +8 -0
- package/scaffold/vanilla/components/switch.html +8 -0
- package/scaffold/vanilla/components/table.html +8 -0
- package/scaffold/vanilla/components/tabs.html +8 -0
- package/scaffold/vanilla/components/theme-switcher.html +8 -0
- package/scaffold/vanilla/components/toast.html +8 -0
- package/scaffold/vanilla/components/toggle-group.html +8 -0
- package/scaffold/vanilla/components/toggle.html +8 -0
- package/scaffold/vanilla/components/tooltip.html +8 -0
- package/scaffold/vanilla/index.html +8 -0
- package/scaffold/vue/DocsSidebar.vue +132 -4
- package/scaffold/vue/ThemeIcon.vue +50 -0
- package/scaffold/vue/base/package.json +1 -1
- package/scaffold/vue/themes.ts +54 -0
- package/scaffold/vue/variants/full/README-RIZZO.md +35 -0
- package/scaffold/vue/variants/full/package.json +22 -0
- package/scaffold/vue/variants/full/src/App.vue +17 -0
- package/scaffold/vue/variants/full/src/config/componentCategories.ts +43 -0
- package/scaffold/vue/variants/full/src/config/docsNav.ts +70 -0
- package/scaffold/vue/variants/full/src/layouts/BlocksLayout.vue +136 -0
- package/scaffold/vue/variants/full/src/layouts/DocsLayout.vue +145 -0
- package/scaffold/vue/variants/full/src/main.ts +6 -0
- package/scaffold/vue/variants/full/src/router/index.ts +38 -0
- package/scaffold/vue/variants/full/src/views/BlocksIndex.vue +111 -0
- package/scaffold/vue/variants/full/src/views/DocsComponents.vue +115 -0
- package/scaffold/vue/variants/full/src/views/DocsGettingStarted.vue +45 -0
- package/scaffold/vue/variants/full/src/views/DocsIndex.vue +69 -0
- package/scaffold/vue/variants/full/src/views/DocsOverview.vue +66 -0
- package/scaffold/vue/variants/full/src/views/Home.vue +240 -0
- package/scaffold/vue/variants/full/src/views/Themes.vue +257 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { Link } from 'react-router-dom';
|
|
2
|
+
import CopyToClipboard from '@/components/rizzo/CopyToClipboard';
|
|
3
|
+
|
|
4
|
+
const ADD_COMMAND = 'npx rizzo-css add <ComponentName>';
|
|
5
|
+
|
|
6
|
+
export default function Home() {
|
|
7
|
+
return (
|
|
8
|
+
<main id="main-content" className="home">
|
|
9
|
+
<div className="home__container">
|
|
10
|
+
<header className="home__hero">
|
|
11
|
+
<h1 className="home__title">Rizzo CSS</h1>
|
|
12
|
+
<p className="home__subtitle">
|
|
13
|
+
A modern CSS design system with semantic theming, accessibility-first components, and one CLI for Vanilla, Astro, Svelte, React, and Vue. Start here then make it your own.
|
|
14
|
+
</p>
|
|
15
|
+
<div className="home__hero-ctas">
|
|
16
|
+
<Link to="/docs/getting-started" className="btn btn-primary home__hero-cta">Get Started</Link>
|
|
17
|
+
<Link to="/docs/components" className="btn btn-outline home__hero-cta">View Components</Link>
|
|
18
|
+
</div>
|
|
19
|
+
</header>
|
|
20
|
+
|
|
21
|
+
<section className="home__features" aria-labelledby="home-features-heading">
|
|
22
|
+
<h2 id="home-features-heading" className="home__section-title">Features</h2>
|
|
23
|
+
<p className="home__features-intro">A complete design system that works across Vanilla, Astro, Svelte, React, and Vue — same CSS, same components, zero lock-in.</p>
|
|
24
|
+
<div className="home__features-featured">
|
|
25
|
+
<div className="home__card home__card--featured">
|
|
26
|
+
<span className="home__card-icon" aria-hidden="true">Themes</span>
|
|
27
|
+
<h3>14 beautiful themes</h3>
|
|
28
|
+
<p>7 dark and 7 light with OKLCH for perceptual uniformity. System preference, persistence, and a unique icon per theme.</p>
|
|
29
|
+
</div>
|
|
30
|
+
<div className="home__card home__card--featured">
|
|
31
|
+
<span className="home__card-icon" aria-hidden="true">A11y</span>
|
|
32
|
+
<h3>Accessibility first</h3>
|
|
33
|
+
<p>WCAG AA compliant with full keyboard navigation, ARIA, focus management, and screen reader support.</p>
|
|
34
|
+
</div>
|
|
35
|
+
<div className="home__card home__card--featured">
|
|
36
|
+
<span className="home__card-icon" aria-hidden="true">Components</span>
|
|
37
|
+
<h3>All components</h3>
|
|
38
|
+
<p>Navbar, Settings, Theme Switcher, Font Switcher, Modal, Dropdown, Tabs, Forms, and more — all accessible and themeable.</p>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
<h3 className="home__features-supporting-label">And more</h3>
|
|
42
|
+
<div className="home__grid home__grid--supporting">
|
|
43
|
+
<div className="home__card home__card--supporting">
|
|
44
|
+
<h3>Semantic variables</h3>
|
|
45
|
+
<p>CSS variables that adapt to themes. No hardcoded colors; override once, update everywhere.</p>
|
|
46
|
+
</div>
|
|
47
|
+
<div className="home__card home__card--supporting">
|
|
48
|
+
<h3>PostCSS powered</h3>
|
|
49
|
+
<p>Imports, autoprefixing, and production minification. Fits into any build pipeline.</p>
|
|
50
|
+
</div>
|
|
51
|
+
<div className="home__card home__card--supporting">
|
|
52
|
+
<h3>Typography & spacing</h3>
|
|
53
|
+
<p>Scaling font sizes, weights, line heights, and a consistent spacing scale (0–24).</p>
|
|
54
|
+
</div>
|
|
55
|
+
<div className="home__card home__card--supporting">
|
|
56
|
+
<h3>Responsive & utilities</h3>
|
|
57
|
+
<p>Mobile-first breakpoints and utility classes for layout, display, and flexbox.</p>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</section>
|
|
61
|
+
|
|
62
|
+
<section className="home__add-command" aria-labelledby="home-add-command-heading">
|
|
63
|
+
<h2 id="home-add-command-heading" className="home__section-title">Add a component</h2>
|
|
64
|
+
<p className="home__features-intro" style={{ marginBottom: 'var(--spacing-4)' }}>Add any component from the CLI:</p>
|
|
65
|
+
<div className="home__add-command-block">
|
|
66
|
+
<pre><code>npx rizzo-css add <ComponentName></code></pre>
|
|
67
|
+
<CopyToClipboard value={ADD_COMMAND} iconOnly buttonLabel="Copy" format="command" label="Copy command" className="home__add-command-copy" />
|
|
68
|
+
</div>
|
|
69
|
+
</section>
|
|
70
|
+
|
|
71
|
+
<section className="home__docs">
|
|
72
|
+
<h2 className="home__section-title">Documentation</h2>
|
|
73
|
+
<div className="home__docs-grid">
|
|
74
|
+
<Link to="/docs/getting-started" className="home__doc-card">
|
|
75
|
+
<h3>Getting Started</h3>
|
|
76
|
+
<p>Installation, project structure, and quick start guide</p>
|
|
77
|
+
</Link>
|
|
78
|
+
<Link to="/docs/components" className="home__doc-card">
|
|
79
|
+
<h3>Components</h3>
|
|
80
|
+
<p>Component library with usage examples and live demos</p>
|
|
81
|
+
</Link>
|
|
82
|
+
<Link to="/themes" className="home__doc-card">
|
|
83
|
+
<h3>Themes</h3>
|
|
84
|
+
<p>Theme system, 14 themes, and live preview</p>
|
|
85
|
+
</Link>
|
|
86
|
+
<Link to="/blocks" className="home__doc-card">
|
|
87
|
+
<h3>Blocks</h3>
|
|
88
|
+
<p>Pre-built layouts: landing, pricing, dashboard, docs, login, signup</p>
|
|
89
|
+
</Link>
|
|
90
|
+
<Link to="/docs" className="home__doc-card">
|
|
91
|
+
<h3>Docs Overview</h3>
|
|
92
|
+
<p>Condensed index of documentation and links</p>
|
|
93
|
+
</Link>
|
|
94
|
+
<a href="https://rizzo-css.vercel.app/docs/theming" className="home__doc-card" target="_blank" rel="noopener noreferrer">
|
|
95
|
+
<h3>Theming (full docs)</h3>
|
|
96
|
+
<p>Custom themes, persistence, color format — on main site</p>
|
|
97
|
+
<span className="sr-only"> (opens in new tab)</span>
|
|
98
|
+
</a>
|
|
99
|
+
</div>
|
|
100
|
+
</section>
|
|
101
|
+
</div>
|
|
102
|
+
</main>
|
|
103
|
+
);
|
|
104
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { Link } from 'react-router-dom';
|
|
2
|
+
import ThemeIcon from '@/components/rizzo/ThemeIcon';
|
|
3
|
+
import ThemeSwitcher from '@/components/rizzo/ThemeSwitcher';
|
|
4
|
+
import Card from '@/components/rizzo/Card';
|
|
5
|
+
import CopyToClipboard from '@/components/rizzo/CopyToClipboard';
|
|
6
|
+
import { THEMES_DARK, THEMES_LIGHT } from '@/components/rizzo/themes';
|
|
7
|
+
|
|
8
|
+
const defaultTheme = 'github-dark-classic';
|
|
9
|
+
const snippet = `<html lang="en" data-theme="${defaultTheme}">`;
|
|
10
|
+
|
|
11
|
+
const themeCardContent: Record<string, { description: string; author: string }> = {
|
|
12
|
+
'github-dark-classic': { description: 'Official GitHub dark theme for VS Code', author: 'Primer (GitHub)' },
|
|
13
|
+
'shades-of-purple': { description: 'Professional theme with bold purple shades', author: 'Ahmad Awais' },
|
|
14
|
+
'sandstorm-classic': { description: 'Dark, red-based theme for late-night coding', author: 'Devan Sisson' },
|
|
15
|
+
'rocky-blood-orange': { description: 'Dark theme with blood-orange accent', author: 'Luca Heyworth' },
|
|
16
|
+
'minimal-dark-neon-yellow': { description: 'Minimal dark theme with neon yellow accent', author: 'Gabriel D Sanchez' },
|
|
17
|
+
'hack-the-box': { description: 'Dark blue with lime green accent, built for hackers', author: 'silofy' },
|
|
18
|
+
'pink-cat-boo': { description: 'Sweet and cute dark theme with rose pink accents', author: 'Fiona Fan' },
|
|
19
|
+
'github-light': { description: 'Official GitHub light theme for VS Code', author: 'Primer (GitHub)' },
|
|
20
|
+
'red-velvet-cupcake': { description: 'Velvet-cupcake light theme with red accent', author: 'Fahad Ashraf Chaudhry' },
|
|
21
|
+
'orangy-one-light': { description: 'Light theme with orange accent', author: 'maher-cshub' },
|
|
22
|
+
sunflower: { description: 'Yellow light theme', author: 'Hashirama Naiff' },
|
|
23
|
+
'green-breeze-light': { description: 'Green and blue focused light theme with good contrast', author: 'icy9ptcl' },
|
|
24
|
+
'cute-pink': { description: 'Cute pink light theme for VSCode', author: 'WebFreak' },
|
|
25
|
+
'semi-light-purple': { description: 'Light aesthetic theme with soft purple tones', author: 'Kapil Yadav' },
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
function applyTheme(value: string) {
|
|
29
|
+
if (typeof document !== 'undefined') {
|
|
30
|
+
document.documentElement.setAttribute('data-theme', value);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export default function Themes() {
|
|
35
|
+
return (
|
|
36
|
+
<div className="themes-page">
|
|
37
|
+
<div className="themes-page__container">
|
|
38
|
+
<header className="themes-page__hero">
|
|
39
|
+
<h1 id="available-themes" className="themes-page__title">Available Themes</h1>
|
|
40
|
+
<p className="themes-page__subtitle">
|
|
41
|
+
Rizzo CSS includes 14 themes. Switch instantly via the Settings panel (gear icon in the navbar) or try the Theme Switcher below. Each theme uses semantic OKLCH variables.
|
|
42
|
+
</p>
|
|
43
|
+
<div className="themes-page__hero-demo example">
|
|
44
|
+
<div className="example-title">Try Themes</div>
|
|
45
|
+
<ThemeSwitcher idPrefix="page" />
|
|
46
|
+
</div>
|
|
47
|
+
<div className="themes-page__hero-ctas">
|
|
48
|
+
<a href="https://rizzo-css.vercel.app/docs/theming" className="btn btn-primary themes-page__hero-cta" target="_blank" rel="noopener noreferrer">Theming docs</a>
|
|
49
|
+
<Link to="/docs/components" className="btn btn-outline themes-page__hero-cta">Components</Link>
|
|
50
|
+
</div>
|
|
51
|
+
</header>
|
|
52
|
+
|
|
53
|
+
<div className="themes-page__main">
|
|
54
|
+
<section className="themes-page__section" aria-labelledby="dark-themes">
|
|
55
|
+
<h2 id="dark-themes" className="themes-page__section-title">Dark Themes</h2>
|
|
56
|
+
<div className="themes-page__grid">
|
|
57
|
+
{THEMES_DARK.map((theme) => {
|
|
58
|
+
const content = themeCardContent[theme.value];
|
|
59
|
+
return (
|
|
60
|
+
<Card key={theme.value} variant="elevated">
|
|
61
|
+
<div className="card__body">
|
|
62
|
+
<div className="themes-page__card-header">
|
|
63
|
+
<ThemeIcon themeId={theme.value} size={24} className="themes-page__card-icon" />
|
|
64
|
+
<h3 className="themes-page__card-title">
|
|
65
|
+
<button type="button" className="themes-page__card-title-btn" onClick={() => applyTheme(theme.value)}>
|
|
66
|
+
{theme.label}
|
|
67
|
+
</button>
|
|
68
|
+
</h3>
|
|
69
|
+
</div>
|
|
70
|
+
{content && <p className="themes-page__card-desc">{content.description}</p>}
|
|
71
|
+
{content && <p className="themes-page__card-meta"><strong>Author:</strong> {content.author}</p>}
|
|
72
|
+
<p className="themes-page__card-meta"><code>{theme.value}</code></p>
|
|
73
|
+
</div>
|
|
74
|
+
</Card>
|
|
75
|
+
);
|
|
76
|
+
})}
|
|
77
|
+
</div>
|
|
78
|
+
</section>
|
|
79
|
+
|
|
80
|
+
<section className="themes-page__section" aria-labelledby="light-themes">
|
|
81
|
+
<h2 id="light-themes" className="themes-page__section-title">Light Themes</h2>
|
|
82
|
+
<div className="themes-page__grid">
|
|
83
|
+
{THEMES_LIGHT.map((theme) => {
|
|
84
|
+
const content = themeCardContent[theme.value];
|
|
85
|
+
return (
|
|
86
|
+
<Card key={theme.value} variant="elevated">
|
|
87
|
+
<div className="card__body">
|
|
88
|
+
<div className="themes-page__card-header">
|
|
89
|
+
<ThemeIcon themeId={theme.value} size={24} className="themes-page__card-icon" />
|
|
90
|
+
<h3 className="themes-page__card-title">
|
|
91
|
+
<button type="button" className="themes-page__card-title-btn" onClick={() => applyTheme(theme.value)}>
|
|
92
|
+
{theme.label}
|
|
93
|
+
</button>
|
|
94
|
+
</h3>
|
|
95
|
+
</div>
|
|
96
|
+
{content && <p className="themes-page__card-desc">{content.description}</p>}
|
|
97
|
+
{content && <p className="themes-page__card-meta"><strong>Author:</strong> {content.author}</p>}
|
|
98
|
+
<p className="themes-page__card-meta"><code>{theme.value}</code></p>
|
|
99
|
+
</div>
|
|
100
|
+
</Card>
|
|
101
|
+
);
|
|
102
|
+
})}
|
|
103
|
+
</div>
|
|
104
|
+
</section>
|
|
105
|
+
|
|
106
|
+
<section id="using-themes" className="themes-page__copy-section" aria-labelledby="copy-heading">
|
|
107
|
+
<h2 id="copy-heading" className="themes-page__section-title">Use a theme in your app</h2>
|
|
108
|
+
<p className="themes-page__copy-desc">Set the theme on your HTML root. For persistence and custom themes, see the <a href="https://rizzo-css.vercel.app/docs/theming" target="_blank" rel="noopener noreferrer">theming docs</a>.</p>
|
|
109
|
+
<div className="themes-page__code-block">
|
|
110
|
+
<pre><code>{snippet}</code></pre>
|
|
111
|
+
<CopyToClipboard value={snippet} buttonLabel="Copy" format="code" label="Copy snippet" />
|
|
112
|
+
</div>
|
|
113
|
+
</section>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import ThemeSwitcher from './ThemeSwitcher.svelte';
|
|
3
|
+
import FontSwitcher from './FontSwitcher.svelte';
|
|
4
|
+
import SoundEffects from './SoundEffects.svelte';
|
|
3
5
|
|
|
4
6
|
interface Props {
|
|
5
7
|
open?: boolean;
|
|
@@ -11,8 +13,6 @@
|
|
|
11
13
|
const isBrowser = typeof window !== 'undefined' && typeof localStorage?.getItem === 'function';
|
|
12
14
|
let fontSizeLabel = $state('100%');
|
|
13
15
|
let fontSizeSlider = $state(1);
|
|
14
|
-
let fontPairValue = $state(isBrowser ? localStorage.getItem('fontPair') || FONT_PAIR_DEFAULT : FONT_PAIR_DEFAULT);
|
|
15
|
-
let soundEffects = $state(isBrowser && localStorage.getItem('soundEffects') === 'true');
|
|
16
16
|
let reducedMotion = $state(isBrowser && localStorage.getItem('reducedMotion') === 'true');
|
|
17
17
|
let highContrast = $state(isBrowser && localStorage.getItem('highContrast') === 'true');
|
|
18
18
|
let scrollbarStyle = $state((isBrowser ? localStorage.getItem('scrollbarStyle') || 'thin' : 'thin') as 'thin' | 'thick' | 'hidden');
|
|
@@ -24,16 +24,6 @@
|
|
|
24
24
|
fontSizeLabel = `${Math.round(scale * 100)}%`;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
function applyFontPair(value: string) {
|
|
28
|
-
if (typeof document === 'undefined') return;
|
|
29
|
-
const pair = FONT_PAIRS.find((p) => p.value === value);
|
|
30
|
-
if (pair) {
|
|
31
|
-
document.documentElement.style.setProperty('--font-family', pair.sans);
|
|
32
|
-
document.documentElement.style.setProperty('--font-family-mono', pair.mono);
|
|
33
|
-
localStorage?.setItem('fontPair', value);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
27
|
$effect(() => {
|
|
38
28
|
if (typeof window === 'undefined') return;
|
|
39
29
|
(window as unknown as { openSettings?: () => void }).openSettings = () => {
|
|
@@ -61,21 +51,12 @@
|
|
|
61
51
|
const scale = saved ? parseFloat(saved) : 1;
|
|
62
52
|
fontSizeSlider = scale;
|
|
63
53
|
fontSizeLabel = `${Math.round(scale * 100)}%`;
|
|
64
|
-
const savedPair = localStorage?.getItem('fontPair') || FONT_PAIR_DEFAULT;
|
|
65
|
-
fontPairValue = savedPair;
|
|
66
|
-
soundEffects = localStorage?.getItem('soundEffects') === 'true';
|
|
67
54
|
reducedMotion = localStorage?.getItem('reducedMotion') === 'true';
|
|
68
55
|
highContrast = localStorage?.getItem('highContrast') === 'true';
|
|
69
56
|
scrollbarStyle = (localStorage?.getItem('scrollbarStyle') || 'thin') as 'thin' | 'thick' | 'hidden';
|
|
70
57
|
}
|
|
71
58
|
});
|
|
72
59
|
|
|
73
|
-
function onSoundEffectsChange(e: Event) {
|
|
74
|
-
const checked = (e.target as HTMLInputElement).checked;
|
|
75
|
-
soundEffects = checked;
|
|
76
|
-
localStorage?.setItem('soundEffects', checked ? 'true' : 'false');
|
|
77
|
-
}
|
|
78
|
-
|
|
79
60
|
function close() {
|
|
80
61
|
openInternal = false;
|
|
81
62
|
}
|
|
@@ -87,13 +68,6 @@
|
|
|
87
68
|
applyFontSize(scale);
|
|
88
69
|
}
|
|
89
70
|
|
|
90
|
-
function onFontPairChange(e: Event) {
|
|
91
|
-
const target = e.target as HTMLSelectElement;
|
|
92
|
-
const value = target.value;
|
|
93
|
-
fontPairValue = value;
|
|
94
|
-
applyFontPair(value);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
71
|
function onReducedMotionChange(e: Event) {
|
|
98
72
|
const checked = (e.target as HTMLInputElement).checked;
|
|
99
73
|
reducedMotion = checked;
|
|
@@ -133,6 +107,12 @@
|
|
|
133
107
|
<button type="button" class="settings__close" data-settings-close aria-label="Close settings" onclick={close}>×</button>
|
|
134
108
|
</div>
|
|
135
109
|
<div class="settings__content" tabindex="-1" aria-label="Settings options">
|
|
110
|
+
<section class="settings__section">
|
|
111
|
+
<h3 class="settings__section-title">Theme</h3>
|
|
112
|
+
<div class="settings__control">
|
|
113
|
+
<ThemeSwitcher idPrefix="settings" />
|
|
114
|
+
</div>
|
|
115
|
+
</section>
|
|
136
116
|
<section class="settings__section">
|
|
137
117
|
<h3 class="settings__section-title">Font Size</h3>
|
|
138
118
|
<div class="settings__control">
|
|
@@ -159,31 +139,14 @@
|
|
|
159
139
|
<section class="settings__section">
|
|
160
140
|
<h3 class="settings__section-title">Font</h3>
|
|
161
141
|
<div class="settings__control">
|
|
162
|
-
<
|
|
163
|
-
<select
|
|
164
|
-
id="font-pair-select"
|
|
165
|
-
class="form-control"
|
|
166
|
-
aria-label="Font pair"
|
|
167
|
-
data-font-pair
|
|
168
|
-
style="width: 100%;"
|
|
169
|
-
value={fontPairValue}
|
|
170
|
-
onchange={onFontPairChange}
|
|
171
|
-
>
|
|
172
|
-
{#each FONT_PAIRS as pair}
|
|
173
|
-
<option value={pair.value} data-sans={pair.sans} data-mono={pair.mono}>{pair.label}</option>
|
|
174
|
-
{/each}
|
|
175
|
-
</select>
|
|
142
|
+
<FontSwitcher idPrefix="settings" />
|
|
176
143
|
<p class="settings__help-text">Body text and code blocks use the selected pair.</p>
|
|
177
144
|
</div>
|
|
178
145
|
</section>
|
|
179
146
|
<section class="settings__section">
|
|
180
147
|
<h3 class="settings__section-title">Sound</h3>
|
|
181
148
|
<div class="settings__control">
|
|
182
|
-
<
|
|
183
|
-
<input type="checkbox" class="settings__checkbox" aria-label="Play sound on click" checked={soundEffects} onchange={onSoundEffectsChange} />
|
|
184
|
-
<span>Play sound on click</span>
|
|
185
|
-
</label>
|
|
186
|
-
<p class="settings__help-text">Short click sound when you interact with buttons and links. Off by default.</p>
|
|
149
|
+
<SoundEffects showHelp={true} />
|
|
187
150
|
</div>
|
|
188
151
|
</section>
|
|
189
152
|
<section class="settings__section">
|
|
@@ -44,6 +44,7 @@ SvelteKit project with Rizzo CSS. Scaffolded with `npx rizzo-css init` when you
|
|
|
44
44
|
- `src/routes/+layout.svelte` — Root layout
|
|
45
45
|
- `src/routes/+page.svelte` — Home page
|
|
46
46
|
- **Navbar** — Flat links (Docs, Components, Blocks, Themes, Colors); Search and Settings in the scaffold
|
|
47
|
+
- **Settings** — Slide-in panel (gear icon): Theme (ThemeSwitcher), Font Size, Font (FontSwitcher), Sound (SoundEffects), Accessibility (reduce motion, high contrast, scrollbar style). Same contents as the docs site.
|
|
47
48
|
- `static/css/rizzo.min.css` — Rizzo CSS bundle (added by CLI; font URLs point to `/assets/fonts/`)
|
|
48
49
|
- `static/assets/fonts/` — Rizzo font files (added by CLI)
|
|
49
50
|
- `README-RIZZO.md` — This file (scaffold docs; does not replace your project README)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Docs nav for the full template. Matches main site structure (Introduction, Components, Blocks, Themes).
|
|
3
3
|
*/
|
|
4
4
|
export interface DocsNavSection {
|
|
5
5
|
id: string;
|
|
@@ -23,8 +23,28 @@ export const DOCS_NAV: DocsNavGroup[] = [
|
|
|
23
23
|
{
|
|
24
24
|
label: 'Introduction',
|
|
25
25
|
links: [
|
|
26
|
-
{
|
|
27
|
-
|
|
26
|
+
{
|
|
27
|
+
href: 'overview',
|
|
28
|
+
label: 'Overview',
|
|
29
|
+
frameworkOnly: true,
|
|
30
|
+
sections: [
|
|
31
|
+
{ id: 'overview', label: 'Overview' },
|
|
32
|
+
{ id: 'installation', label: 'Installation' },
|
|
33
|
+
{ id: 'components', label: 'Components' },
|
|
34
|
+
{ id: 'blocks', label: 'Blocks' },
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
href: 'getting-started',
|
|
39
|
+
label: 'Getting Started',
|
|
40
|
+
sections: [
|
|
41
|
+
{ id: 'installation', label: 'Installation' },
|
|
42
|
+
{ id: 'project-structure', label: 'Project Structure' },
|
|
43
|
+
{ id: 'development', label: 'Development' },
|
|
44
|
+
{ id: 'using-components', label: 'Using Components' },
|
|
45
|
+
{ id: 'using-themes', label: 'Using Themes' },
|
|
46
|
+
],
|
|
47
|
+
},
|
|
28
48
|
],
|
|
29
49
|
},
|
|
30
50
|
{
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
2
3
|
import Navbar from '$lib/rizzo/Navbar.svelte';
|
|
3
4
|
import Footer from '$lib/rizzo/Footer.svelte';
|
|
4
5
|
import Settings from '$lib/rizzo/Settings.svelte';
|
|
5
6
|
import BackToTop from '$lib/rizzo/BackToTop.svelte';
|
|
7
|
+
|
|
8
|
+
let { children }: { children: Snippet } = $props();
|
|
6
9
|
</script>
|
|
7
10
|
|
|
8
11
|
<Navbar siteName="Rizzo CSS" />
|
|
9
|
-
|
|
12
|
+
{@render children()}
|
|
10
13
|
<Footer />
|
|
11
14
|
<BackToTop />
|
|
12
15
|
<Settings />
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
2
3
|
import { onMount } from 'svelte';
|
|
3
4
|
import { page } from '$app/stores';
|
|
4
5
|
import BackToTop from '$lib/rizzo/BackToTop.svelte';
|
|
5
6
|
|
|
7
|
+
let { children }: { children: Snippet } = $props();
|
|
6
8
|
const currentPath = $derived($page.url.pathname);
|
|
7
9
|
const BLOCKS_NAV = [
|
|
8
10
|
{ href: '/blocks', label: 'Overview' },
|
|
@@ -64,7 +66,7 @@
|
|
|
64
66
|
<span class="docs__sidebar-toggle-text">Blocks</span>
|
|
65
67
|
</button>
|
|
66
68
|
<div class="docs__sidebar-overlay" data-docs-sidebar-overlay aria-hidden="true"></div>
|
|
67
|
-
<aside id="docs-sidebar" class="docs-sidebar" aria-label="Blocks navigation"
|
|
69
|
+
<aside id="docs-sidebar" class="docs-sidebar" aria-label="Blocks navigation">
|
|
68
70
|
<nav class="docs-sidebar__nav">
|
|
69
71
|
<div class="docs-sidebar__group">
|
|
70
72
|
<h2 class="docs-sidebar__group-label">Blocks</h2>
|
|
@@ -90,7 +92,7 @@
|
|
|
90
92
|
<div class="docs__main">
|
|
91
93
|
<div class="docs__container">
|
|
92
94
|
<div class="docs__content">
|
|
93
|
-
|
|
95
|
+
{@render children()}
|
|
94
96
|
</div>
|
|
95
97
|
</div>
|
|
96
98
|
</div>
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
2
3
|
import { onMount } from 'svelte';
|
|
3
4
|
import { page } from '$app/stores';
|
|
4
5
|
import DocsSidebar from '$lib/rizzo/DocsSidebar.svelte';
|
|
5
6
|
import BackToTop from '$lib/rizzo/BackToTop.svelte';
|
|
6
7
|
|
|
8
|
+
let { children }: { children: Snippet } = $props();
|
|
7
9
|
const currentPath = $derived($page.url.pathname);
|
|
8
10
|
|
|
9
11
|
onMount(() => {
|
|
@@ -66,7 +68,7 @@
|
|
|
66
68
|
<div class="docs__main">
|
|
67
69
|
<div class="docs__container">
|
|
68
70
|
<div class="docs__content">
|
|
69
|
-
|
|
71
|
+
{@render children()}
|
|
70
72
|
</div>
|
|
71
73
|
</div>
|
|
72
74
|
</div>
|