Getting Started
Installation, project structure, and quick start guide
Installation
Using the npm package? Run npx rizzo-css init â choose framework (Vanilla, Astro, or Svelte), then add to existing or create new project. For Astro/Svelte youâll see What to include?: CSS only, Recommended set, All components, or Pick components. Create new gives a full clone (stylesheet link included); add to existing copies CSS + optional components (you must add the <link> yourself; the CLI prints the exact tag). The package includes dist/rizzo.min.css, the CLI (init / add / theme), and scaffolds plus 25 optional components (including ThemeSwitcher). Each scaffold has a README. See the npm package and project README for CLI details.
Rizzo CSS is built on Astro. To work on this docs site and reference components (clone the repo):
# Clone the project
git clone <repository-url>
cd rizzo-css # Install dependencies
pnpm install Project Structure
rizzo-css/
âââ src/
â âââ components/ # Astro components
â â âââ Accordion.astro
â â âââ Alert.astro
â â âââ Badge.astro
â â âââ Breadcrumb.astro
â â âââ Button.astro
â â âââ Card.astro
â â âââ CodeBlock.astro
â â âââ CopyToClipboard.astro
â â âââ Dropdown.astro
â â âââ FormGroup.astro
â â âââ Input.astro
â â âââ Textarea.astro
â â âââ Select.astro
â â âââ Checkbox.astro
â â âââ Radio.astro
â â âââ Modal.astro
â â âââ Navbar.astro
â â âââ Pagination.astro
â â âââ ProgressBar.astro
â â âââ Search.astro
â â âââ Spinner.astro
â â âââ Avatar.astro
â â âââ Divider.astro
â â âââ Table.astro
â â âââ Settings.astro
â â âââ Tabs.astro
â â âââ ThemeSwitcher.astro
â â âââ Toast.astro
â â âââ Tooltip.astro
â â âââ icons/ # Icon components (same set for Astro, Svelte, Vanilla)
â â âââ Copy.astro
â â âââ Check.astro
â â âââ ChevronDown.astro
â â âââ Circle.astro
â â âââ Close.astro
â â âââ Cmd.astro
â â âââ Eye.astro
â â âââ Gear.astro
â â âââ IceCream.astro
â â âââ Moon.astro
â â âââ Owl.astro
â â âââ Palette.astro
â â âââ Rainbow.astro
â â âââ Search.astro
â â âââ Snowflake.astro
â â âââ devicons/ # Devicon brand icons
â â âââ Astro.astro
â â âââ Bash.astro
â â âââ Css3.astro
â â âââ Git.astro
â â âââ Html5.astro
â â âââ Javascript.astro
â â âââ Nodejs.astro
â â âââ Plaintext.astro
â â âââ React.astro
â â âââ Svelte.astro
â â âââ Vue.astro
â âââ layouts/ # Page layouts
â â âââ Layout.astro
â âââ pages/ # Route pages
â âââ styles/ # CSS files
â âââ accessibility.css
â âââ base.css
â âââ buttons.css
â âââ components.css
â âââ forms.css
â âââ layout.css
â âââ main.css
â âââ pages.css
â âââ reset.css
â âââ spacing.css
â âââ sizes.css
â âââ typography.css
â âââ utilities.css
â âââ variables.css
â âââ media-queries.css
â âââ themes/ # Theme files (14 themes: 7 dark, 7 light)
â âââ dark/
â â âââ github-dark-classic.css
â â âââ shades-of-purple.css
â â âââ sandstorm-classic.css
â â âââ rocky-blood-orange.css
â â âââ minimal-dark-neon-yellow.css
â â âââ hack-the-box.css
â â âââ pink-cat-boo.css
â âââ light/
â âââ github-light.css
â âââ red-velvet-cupcake.css
â âââ orangy-one-light.css
â âââ sunflower.css
â âââ green-breeze-light.css
â âââ cute-pink.css
â âââ semi-light-purple.css
âââ docs/ # Documentation
âââ public/ # Static assets
â âââ css/ # Generated CSS
â âââ main.min.css
âââ scripts/ # Build scripts
âââ build-css.js Development
Start the development server:
pnpm dev The site will be available at http://localhost:4321
Building
Build for production:
pnpm build This will:
- Build and minify CSS to
public/css/main.min.css - Build the Astro site to
dist/
Using Components
Rizzo CSS includes a comprehensive set of accessible components. Each component has its own dedicated documentation page with live examples, usage instructions, and API details.
Component Documentation
- Navbar - Responsive, accessible navigation bar
- Settings - Comprehensive settings panel
- Theme Switcher - Accessible theme switcher
- Button - Semantic button component
- Badge - Small labels and tags with variants and sizes
- Accordion - Collapsible sections with single/multiple open and keyboard navigation
- Breadcrumb - Navigation breadcrumbs with separator customization
- Pagination - Pagination navigation with prev/next, page numbers, and ellipsis
- Progress Bar - Progress bar with variants, sizes, and indeterminate state
- Spinner - Accessible loading spinner with variants and sizes
- Avatar - User avatar with image or initials fallback
- Divider - Horizontal or vertical divider with optional label
- Table - Data table with sorting and filtering
- Icons - Reusable SVG icon components (same set for Astro, Svelte, Vanilla; includes Cmd icon)
- CopyToClipboard - Copy to clipboard component
- Forms - Form components (FormGroup, Input, Textarea, Select, Checkbox, Radio)
- Cards - Flexible card component
- Modal - Accessible modal/dialog component
- Alert - Alert/notification component with auto-dismiss
- Toast - Fixed position toast notifications
- Search - Search with Algolia integration; Cmd icon + K in trigger (same size as search icon); same live example on Astro, Svelte, and Vanilla
- Tooltip - Accessible tooltip component with positioning options
- Dropdown - Accessible dropdown menu with keyboard navigation and nested submenus
- Tabs - Accessible tabs component with keyboard navigation and ARIA tab pattern
See the Components Documentation for an overview and links to all component pages.
Using Themes
Rizzo CSS includes 14 built-in themes (7 dark, 7 light). Themes are applied via the data-theme attribute on the HTML element:
<html lang="en" data-theme="github-dark-classic"> See Theming Documentation for more details.
CSS Architecture
File Organization
CSS is organized into logical files:
variables.css- Default theme variables and typography systemreset.css- Modern CSS resetbase.css- Base HTML element stylestypography.css- Typography system (font families, sizes, weights, line heights, utilities)accessibility.css- Accessibility utilitiesbuttons.css- Button component styleslayout.css- Layout utilitiesspacing.css- Margin and padding utility classessizes.css- Width, height, min/max dimensions, and container utilitiesutilities.css- Utility classes (colors, borders, focus states)forms.css- Form component stylespages.css- Page-specific stylesmedia-queries.css- Responsive breakpoints and media query definitionscomponents.css- Component styles (Accordion, Alert, Avatar, Badge, Breadcrumb, Card, CodeBlock, CopyToClipboard, Divider, Dropdown, Modal, Navbar, Pagination, Progress Bar, Search, Settings, Spinner, Table, Tabs, ThemeSwitcher, Toast, Tooltip)themes/- Theme definitions (dark/light)
Semantic Variables
All styles use semantic theme variables:
.my-component {
background-color: var(--background);
color: var(--text);
border: 1px solid var(--border);
} PostCSS Processing
- Development: PostCSS processes imports and adds vendor prefixes
- Production: CSS is minified via
build:cssscript - Linting: Stylelint configured for BEM naming convention
- No Inline Styles: All component styles are in external CSS files
Spacing Utilities
Rizzo CSS includes comprehensive spacing utilities for margins and padding:
<!-- Margin utilities -->
<div class="m-4">Margin on all sides</div>
<div class="mx-auto">Centered with auto margins</div>
<div class="mt-6 mb-4">Top and bottom margins</div>
<!-- Padding utilities -->
<div class="p-4">Padding on all sides</div>
<div class="px-6 py-4">Horizontal and vertical padding</div>
<!-- Sizes: 0, 1 (4px), 2 (8px), 3 (12px), 4 (16px), 5 (20px), 6 (24px), 8 (32px), 10 (40px), 12 (48px), 16 (64px), 20 (80px), 24 (96px) --> See Design System Documentation for available variables and utilities.