Learn how to build, customize, and deploy Thrynd CSS in your projects.
Installation
There are several ways to use Thrynd CSS in your project.
Via npm (Recommended)
npm Installation
# Install via npmnpminstall thrynd
# Or with yarnyarnadd thrynd
# Or with pnpmpnpmadd thrynd
Then import in your project:
Import in JavaScript/TypeScript
// Import in your entry file (main.js, App.tsx, etc.)import'thrynd';// Or import in CSS@import'thrynd';
Via CDN (Rapid Prototyping)
For quick prototypes, CodePen experiments, or static sites:
CDN Installation
<!-- In your HTML <head> --><linkrel="stylesheet"href="https://cdn.jsdelivr.net/npm/thrynd@latest/dist/thrynd.min.css"><!-- Apply a theme to your body --><bodyclass="theme-modern"><!-- Your content --></body>
Download & Self-Host
Manual Download
Download the latest release from GitHub
Extract the dist folder
Copy thrynd.min.css to your project
Link it in your HTML: <link rel="stylesheet" href="/path/to/thrynd.min.css">
Building from Source
Clone the repository and build the CSS yourself for maximum customization.
Build Process
# Clone the repositorygit clone https://github.com/yourusername/thrynd-css.git
cd thrynd-css
# Install dependenciesnpminstall# Build all CSS filesnpm run build:all
# Or build specific partsnpm run build:core # Core styles onlynpm run build:components # Components onlynpm run build:utilities # Utilities onlynpm run build:themes # All themes# Watch for changes during developmentnpm run watch
Customization
CSS Variables
Override CSS variables to customize colors, spacing, and more without rebuilding.
Custom Variables
/* In your custom CSS file */:root{/* Override primary color */--color-primary: #your-color;--color-primary-hover: #your-hover-color;/* Adjust spacing scale */--space-1:0.25rem;--space-2:0.5rem;--space-3:0.75rem;--space-4:1rem;/* Modify border radius */--radius-sm:0.25rem;--radius-base:0.375rem;--radius-md:0.5rem;--radius-lg:0.75rem;/* Change font family */--font-sans:'Your Font', system-ui, sans-serif;}
Custom Theme
Create your own theme by defining a new class with custom variables.
Custom Theme Class
/* custom-theme.css */.theme-custom{/* Semantic colors */--color-primary:#6366f1;--color-secondary:#8b5cf6;--color-success:#10b981;--color-warning:#f59e0b;--color-danger:#ef4444;--color-info:#3b82f6;/* Background colors */--color-background:#ffffff;--color-surface:#f9fafb;/* Text colors */--color-text:#111827;--color-text-secondary:#6b7280;--color-heading:#000000;/* Border and divider */--color-border:#e5e7eb;/* Shadows */--shadow:01px3pxrgba(0,0,0,0.1);--shadow-lg:010px25pxrgba(0,0,0,0.15);/* Typography */--font-sans:'Inter', system-ui, sans-serif;--font-mono:'Fira Code', monospace;}/* Apply to body */body.theme-custom{font-family:var(--font-sans);color:var(--color-text);background:var(--color-background);}
PostCSS Configuration
Customize the build process with your own PostCSS configuration.
// app/layout.tsx or pages/_app.jsimport'thrynd';exportdefaultfunctionRootLayout({ children }){return(<html lang="en"><body className="theme-modern">{children}</body></html>)}// Dynamic theme switching in a componentimport{ useState }from'react'functionThemeSwitcher(){const[theme, setTheme]=useState('theme-modern')return(<div className={theme}><button
className="btn-primary" onClick={()=>setTheme('theme-neon')}>SwitchTheme</button></div>)}