Overview
Chapinismos uses a modern CSS architecture built on Tailwind CSS v4 with CSS variables for theme customization. The styling system supports dark/light modes and provides consistent design tokens across the entire application.CSS Architecture
The project follows a layered CSS approach:- Global styles - Base styles and CSS variables (
src/styles/global.css) - Tailwind utilities - Utility-first classes via Tailwind v4
- Custom utilities - Project-specific utility classes
- Component styles - Scoped Astro component styles
File Structure
CSS Variables
Chapinismos uses CSS variables extensively for theming. Variables are defined at two levels:Tailwind Theme Variables
Defined in the@theme block for use with Tailwind utilities:
src/styles/global.css
Runtime CSS Variables
Theme-aware variables that change based on light/dark mode:src/styles/global.css
Typography
The project uses two custom fonts loaded via@fontsource:
Font Configuration
src/styles/global.css
Font Usage
- Sans serif (body): Baloo 2 Variable - Friendly, rounded, variable font
- Serif (titles): Alice - Classic serif for headings (
<h1>)
Customizing Colors
Change Primary Brand Color
Editsrc/styles/global.css:
src/styles/global.css
Customize Dark Mode Colors
src/styles/global.css
Customize Light Mode Colors
src/styles/global.css
Customizing Fonts
Change to Different Fonts
- Install new fonts:
- Update global.css:
src/styles/global.css
- Update font-display optimization:
src/styles/global.css
Adjust Font Sizes
Font sizes use Tailwind’s default scale, but you can customize in components:Global Background
The background uses a radial gradient with a decorative image overlay:src/styles/global.css
Customize Background
src/styles/global.css
View Transitions
The site uses CSS View Transitions for smooth page navigation:src/styles/global.css
Customize Transition Speed
src/styles/global.css
Next Steps
Tailwind Configuration
Learn about custom Tailwind utilities and configuration
Design System
Explore the complete design token system