A comprehensive design system built with Utlyze Blue (#4169E1) and Accent Color (#34495E) as the foundation colors.
frontend/src/styles/
├── design-system.ts # Core design tokens and system
├── globals.css # Global CSS with CSS variables
├── css-variables.ts # CSS variable generator utility
└── README.md # This file
frontend/src/components/examples/
├── ButtonExamples.tsx # Button component examples
├── FormExamples.tsx # Form component examples
└── UIExamples.tsx # UI component examples
frontend/src/pages/
└── style-guide.tsx # Complete style guide documentation
- Primary Palette: 11 shades of Utlyze Blue (#4169E1)
- Accent Palette: 11 shades of Dark Slate (#34495E)
- Neutral Grays: Complete grayscale palette
- Semantic Colors: Success, warning, error, and info states
- UI Colors: Background, text, border, and overlay variations
- Font Families: Sans (Inter), Serif (Merriweather), Mono (JetBrains Mono)
- Font Sizes: 11 sizes from xs (12px) to 7xl (72px)
- Font Weights: 9 weights from thin (100) to black (900)
- Heading Presets: Pre-configured styles for h1-h6
- 8px Base Grid: Consistent spacing scale from 0 to 96 (24rem)
- Pixel-perfect: Includes px value for precise adjustments
- Shadows: 8 shadow depths plus colored shadows
- Border Radius: 9 options from none to full circle
- Transitions: Pre-configured animation properties
Pre-styled tokens for:
- Buttons (primary, secondary, outline, ghost)
- Form inputs and controls
- Cards
- Badges
- Alerts
import { colors, spacing, typography, effects, components } from '@/styles/design-system';
// Use tokens in your components
const buttonStyle = {
backgroundColor: colors.primary[400],
padding: `${spacing[3]} ${spacing[6]}`,
fontSize: typography.fontSize.base.size,
borderRadius: effects.borderRadius.md,
};Include the global CSS file in your app:
import '@/styles/globals.css';Then use CSS variables:
.button {
background-color: var(--color-primary-400);
padding: var(--space-3) var(--space-6);
font-size: var(--text-base);
border-radius: var(--radius-md);
}import { generateCompleteCSS, generateTailwindConfig } from '@/styles/css-variables';
// Generate complete CSS file
const css = generateCompleteCSS();
// Generate Tailwind config
const tailwindConfig = generateTailwindConfig();import { ButtonWithTokens } from '@/components/examples/ButtonExamples';
<ButtonWithTokens variant="primary">
Click me
</ButtonWithTokens>import { Input, FormField } from '@/components/examples/FormExamples';
<FormField label="Email" required error={errors.email}>
<Input
type="email"
placeholder="Enter your email"
error={!!errors.email}
/>
</FormField>import { Card, Badge, Alert } from '@/components/examples/UIExamples';
<Card padding="md" hoverable>
<Badge variant="success">Active</Badge>
<Alert variant="info" title="Note">
This is an informational message.
</Alert>
</Card>import { hexToRgba, getContrastColor } from '@/styles/design-system';
// Convert hex to rgba
const transparentBlue = hexToRgba('#4169E1', 0.5); // rgba(65, 105, 225, 0.5)
// Get contrast color (black or white)
const textColor = getContrastColor('#4169E1'); // #FFFFFFimport { focusRing } from '@/styles/design-system';
const focusStyles = focusRing(colors.primary[400]);
// Returns focus outline styles for accessibilityimport { mediaQuery } from '@/styles/design-system';
const styles = `
${mediaQuery.up('md')} {
display: flex;
}
${mediaQuery.between('sm', 'lg')} {
padding: 1rem;
}
`;- Consistency: All design decisions follow the 8px grid system
- Accessibility: Colors meet WCAG contrast requirements
- Scalability: Token-based system allows easy theme changes
- Performance: CSS variables enable runtime theming
- Developer Experience: Full TypeScript support with autocompletion
View the complete style guide by navigating to:
/pages/style-guide
This interactive guide showcases:
- All color palettes with hex values
- Typography scales and examples
- Spacing visualization
- Component examples
- Shadow and border radius options
- Usage code snippets
To customize the design system:
- Modify the base colors in
design-system.ts:
const baseColors = {
primary: '#YourPrimaryColor',
accent: '#YourAccentColor',
};- Regenerate CSS variables:
npm run generate-css-vars- Update component styles as needed
The component examples require React:
npm install react react-dom @types/react @types/react-domFor styled-components or emotion:
npm install @emotion/styled @emotion/react
# or
npm install styled-components- Use semantic color names instead of direct color values
- Stick to the spacing scale for consistent layouts
- Use typography presets for text styles
- Apply effects consistently across similar components
- Follow the component patterns in the examples
This design system is part of the LawyerOfOne project.