Tailwind Theme & Customization
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The NEXUS project utilizes Tailwind CSS as its primary styling engine, integrated with a Shadcn UI foundation. The theme is designed with a "cyberpunk-meets-luxury" aesthetic, characterized by high-contrast dark modes, electric blue accents, and glassmorphism effects. The customization layer extends standard Tailwind utilities with project-specific design tokens for colors, animations, and typography.
The system relies on a multi-layered configuration involving PostCSS for processing, a centralized Tailwind configuration file for theme extensions, and CSS variables for dynamic value injection. This architecture allows the application to support seamless theme switching and complex visual effects like particle backgrounds and breathing animations.
Sources: frontend/tailwind.config.js, frontend/src/App.css:1-40, test_result.md:144-149
Core Architecture and Configuration
The styling pipeline is built on a standard React/Tailwind stack, using postcss-loader to process directives and tailwindcss-animate for complex transitions.
Styling Pipeline Flow
The following diagram illustrates how configuration files and CSS layers interact to generate the final application styles.
This flow ensures that Tailwind's utility classes remain synchronized with the custom CSS variables defined in the base layer.
Sources: frontend/postcss.config.js:1-7, frontend/tailwind.config.js:1-77, frontend/src/index.css:1-3
Dependency Structure
The project leverages several key libraries to manage styling and component logic:
| Dependency | Purpose |
|---|---|
tailwindcss | Utility-first CSS framework |
tailwindcss-animate | Plugin for Radix UI compatible animations |
class-variance-authority | Tools for managing component variants |
tailwind-merge | Utility for merging Tailwind classes without conflicts |
lucide-react | Primary icon library |
Sources: frontend/package.json:11-66, frontend/components.json:1-21
Theme Customization
NEXUS implements a comprehensive theme extension in tailwind.config.js, primarily using HSL-based CSS variables to allow for dynamic switching between light and dark modes.
Color Palette and Variables
The theme defines specific semantic roles for colors, such as primary, secondary, destructive, and accent. These map directly to CSS variables defined in the base @layer.
| Semantic Key | Default (Light) HSL | Dark Mode HSL |
|---|---|---|
background | 0 0% 100% | 0 0% 3.9% |
foreground | 0 0% 3.9% | 0 0% 98% |
primary | 0 0% 9% | 0 0% 98% |
destructive | 0 84.2% 60.2% | 0 62.8% 30.6% |
border | 0 0% 89.8% | 0 0% 14.9% |
Sources: frontend/tailwind.config.js:15-58, frontend/src/index.css:26-79
Border Radius and Utility Extensions
Custom radius values are calculated based on a base --radius variable to ensure consistent rounding across components:
lg:var(--radius)(0.5rem)md:calc(var(--radius) - 2px)sm:calc(var(--radius) - 4px)
Sources: frontend/tailwind.config.js:10-14, frontend/src/index.css:52
Cyberpunk Visual Extensions
While Tailwind handles structural utilities, App.css introduces the specific "Cyberpunk" aesthetic through custom variables and complex animations that go beyond standard utility classes.
Cyberpunk Design Tokens
NEXUS utilizes a specific set of vibrant neon colors and glassmorphism gradients:
:root {
--electric-blue: #00D4FF;
--vibrant-purple: #9D4EDD;
--hot-pink: #FF10F0;
--glass-bg: rgba(255, 255, 255, 0.05);
--gradient-primary: linear-gradient(135deg, var(--electric-blue), var(--vibrant-purple));
--shadow-glow: 0 0 20px rgba(0, 212, 255, 0.3);
}
Sources: frontend/src/App.css:5-35
Animation Logic
The theme includes specialized animations for a "breathing" UI. These are defined both in the Tailwind config for utility usage and in raw CSS for complex keyframes.
Key animations include:
- accordion-down: Handles expansion from height 0 to Radix content height.
- breathe: A 4s ease-in-out scale transformation (
scale(1)toscale(1.02)). - pulse: Opacity oscillation for the
cyber-title.
Sources: frontend/tailwind.config.js:59-75, frontend/src/App.css:662-675
Global Styles and Base Layers
The project utilizes Tailwind's @layer directives to apply project-wide defaults and normalize behavior.
Base Layer Overrides
The base layer ensures that all elements use the defined border colors and that the body inherits the correct background and foreground tokens.
@layer base {
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
}
}
Sources: frontend/src/index.css:83-91
Typography and Fonts
The project imports external fonts via @import to achieve its distinct look:
- Inter: Standard UI text.
- Orbitron: Stylized headers and cyberpunk titles.
- JetBrains Mono: Numerical data and code-like elements.
Sources: frontend/src/App.css:2-3
Conclusion
The Tailwind Theme and Customization in NEXUS is a hybrid system that blends Tailwind CSS's utility-first efficiency with custom CSS variables for complex visual effects. By extending the default configuration with semantic HSL tokens and adding a specialized Cyberpunk design layer, the project achieves a high-end, responsive aesthetic while maintaining the flexibility of a modern UI framework.