Styling Architecture
Relevant source files
The following files were used as context for generating this wiki page:The project employs a modern, utility-first styling architecture centered around Tailwind CSS. This approach facilitates rapid development and ensures a consistent design system. The styling is processed via PostCSS and is primarily defined through utility classes applied directly within the React components' JSX.
A foundational layer of global styles, CSS custom properties (variables), and custom utilities provides a flexible and maintainable theming system. The design is dark-mode-first, with responsive adjustments for various screen sizes.
Core Technologies
The styling pipeline is built on several key devDependencies defined in package.json.
| Dependency | Version | Purpose |
|---|---|---|
tailwindcss | ^3.4.17 | The core utility-first CSS framework. |
postcss | ^8.5.6 | A tool for transforming CSS with plugins. |
autoprefixer | ^10.4.22 | A PostCSS plugin to add vendor prefixes to CSS rules. |
Sources: package.json:25-27
Styling Build Process
The following diagram illustrates how styles are processed from source files to the final browser-ready CSS.
This diagram shows the flow from JSX components with Tailwind classes through the Tailwind JIT compiler and PostCSS pipeline to produce the final CSS.
Sources: postcss.config.js, tailwind.config.js, src/index.css:3-5
Configuration
PostCSS Configuration
The PostCSS configuration is straightforward, enabling the tailwindcss and autoprefixer plugins.
File: postcss.config.js
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
Sources: postcss.config.js:1-6
Tailwind CSS Configuration
The tailwind.config.js file defines which files Tailwind should scan for utility classes and extends the default theme.
File: tailwind.config.js
/** @type {import('tailwindcss').Config} */
export default {
content: [
"./index.html",
"./src/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {
colors: {
'bg-primary': 'var(--bg-primary)',
'bg-secondary': 'var(--bg-secondary)',
// ... and other colors
},
fontFamily: {
sans: ['Inter', 'sans-serif'],
},
},
},
plugins: [],
}
content: Specifies that Tailwind should scan all.htmland.jsx/.tsxfiles in thesrcdirectory for class names.theme.extend.colors: Maps custom color names (e.g.,bg-primary) to CSS variables, integrating the custom property system with Tailwind's color utilities.theme.extend.fontFamily: Sets the default sans-serif font to 'Inter'.
Sources: tailwind.config.js:1-23
Global Styles and Theming
Global styles, fonts, and the core theming system are defined in src/index.css.
Base Layers
The file imports Tailwind's base, components, and utilities layers.
File: src/index.css
@tailwind base;
@tailwind components;
@tailwind utilities;
Sources: src/index.css:3-5
CSS Custom Properties (Theming)
A comprehensive set of CSS variables is defined in the :root selector, establishing a dark-mode-first theme. These variables are then used by Tailwind's utility classes.
| Variable | Default Value | Description |
|---|---|---|
--bg-primary | #050505 | Primary background color for the entire app. |
--bg-secondary | #0A0A0A | Secondary background, used for card-like elements. |
--bg-tertiary | #111111 | Tertiary background color. |
--text-primary | #FFFFFF | Primary text color. |
--text-secondary | #A1A1AA | Secondary text color for less emphasis. |
--text-tertiary | #71717A | Tertiary text color for hints and disabled states. |
--accent-primary | #3B82F6 | Main accent color (blue). |
--border-subtle | rgba(255, 255, 255, 0.08) | A subtle border color. |
--border-highlight | rgba(255, 255, 255, 0.15) | A brighter border color for hover/active states. |
--container-padding | 1.5rem | Default horizontal padding for containers. |
--section-spacing | 8rem | Default vertical spacing between sections. |
Sources: src/index.css:7-22, src/App.jsx:13
Responsive Design
The application uses media queries to adjust layout and typography for different viewports. The base font-size is scaled down on large screens and restored on very large screens, creating a fluid typography system. Container padding is also adjusted.
File: src/index.css
@media (min-width: 768px) {
:root {
--container-padding: 2rem;
--section-spacing: 12rem;
}
}
@media (min-width: 1024px) {
html {
font-size: 14px; /* Scales down everything by ~12.5% */
}
}
Sources: src/index.css:24-38
Typography
The project uses 'Plus Jakarta Sans' and 'JetBrains Mono' from Google Fonts, which are imported in src/index.css. The index.html file also includes preconnect links for performance and imports 'Inter' and 'Outfit' fonts.
File: src/index.css
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');
Sources: src/index.css:1, index.html:7-10
The default body font is set to 'Plus Jakarta Sans'.
Sources: src/index.css:43-48
Custom Utility Classes
src/index.css defines several custom utility classes to supplement Tailwind's defaults.
| Class Name | Description |
|---|---|
.glass | Applies a semi-transparent background, blur, and subtle border for a "glassmorphism" effect. |
.glass-hover | A hover state variant for .glass with increased background opacity and a highlighted border. |
.text-gradient | Creates a white-to-gray gradient for text. |
.text-gradient-blue | Creates a blue gradient for text. |
.no-scrollbar | Hides the scrollbar for elements. |
Sources: src/index.css:54-79
Component-Level Styling
Styling is applied directly to elements using Tailwind's utility classes. This co-location of markup and styling is a core principle of the architecture. Components often use dynamic classes based on props or state to alter appearance.
For example, in the Process.jsx component, the color and gradient of each step card are determined by data passed into the component.
File: src/components/Process.jsx
// ...
<div className={`absolute inset-0 bg-gradient-to-br ${step.gradient} opacity-[0.05]`} />
// ...
<h3 className={`text-2xl font-bold mb-3 tracking-tight bg-gradient-to-br ${step.gradient} bg-clip-text text-transparent`}>
{step.title}
</h3>
// ...
This snippet shows how the step.gradient property is used to dynamically apply different gradient classes to elements within the card.
Sources: src/components/Process.jsx:93, src/components/Process.jsx:114-116
Similarly, the Hero.jsx component uses conditional class application based on the isActive state to highlight the current step in a process list.
File: src/components/Hero.jsx
<div className={`w-12 h-12 rounded-lg flex items-center justify-center transition-colors duration-300 ${isActive ? 'bg-white/10' : 'bg-white/5'}`}>
<step.icon size={20} className={isActive ? step.color : "text-white/20"} />
</div>
Sources: src/components/Hero.jsx:168-170