Your VelvetLadle app now has a comprehensive theme system with:
- Centralized colors - All colors in one place for consistency
- Typography scales - Font sizes, weights, and families
- Spacing system - Consistent padding/margin values
- Elevation/shadows - Predefined shadow styles
- Border radius - Consistent corner rounding
constants/theme.ts- Main theme configurationcontexts/ThemeContext.tsx- React context for theme access- Updated components - Button, RecipeList now use theme
- Primary:
#00205B(Deep Navy Blue) - Main brand color - Secondary:
#faf4eb(Warm Cream) - Background color - Accent:
#C8A882(Warm Gold/Bronze) - Highlight color
- Success:
#4CAF50(Green) - Warning:
#FF9800(Orange) - Error:
#F44336(Red) - Info:
#2196F3(Blue)
import { useColors, useSpacing, useTypography } from '../contexts/ThemeContext';
export default function MyComponent() {
const colors = useColors();
const spacing = useSpacing();
const typography = useTypography();
return (
<View style={{
backgroundColor: colors.surface,
padding: spacing.lg,
borderRadius: radius.md,
}}>
<Text style={{
color: colors.textPrimary,
fontSize: typography.fontSize.lg,
fontWeight: typography.fontWeight.bold,
}}>
Hello Theme!
</Text>
</View>
);
}// Primary button (default)
<Button label="Save Recipe" theme="primary" />
// Secondary button
<Button label="Cancel" theme="secondary" />
// Outline button
<Button label="Edit" theme="outline" />
// Danger button
<Button label="Delete" theme="danger" />
// Different sizes
<Button label="Small" size="sm" />
<Button label="Medium" size="md" />
<Button label="Large" size="lg" />
// With icon
<Button label="Save" icon="check" theme="primary" />import { useElevation } from '../contexts/ThemeContext';
const elevation = useElevation();
// Apply shadow
<View style={[styles.card, elevation.md]}>
{/* Content */}
</View>To customize colors, edit constants/theme.ts:
export const theme = {
colors: {
primary: '#YOUR_NEW_COLOR', // Change primary color
accent: '#YOUR_ACCENT_COLOR', // Change accent color
// ... other colors
},
// ... rest of theme
};- ✅ Theme variants: primary, secondary, outline, danger
- ✅ Size variants: sm, md, lg
- ✅ Icon support: Any FontAwesome icon
- ✅ Disabled state: Automatic opacity reduction
- ✅ Elevation: Automatic shadow on enabled buttons
- ✅ Dynamic colors: Uses theme colors throughout
- ✅ Consistent spacing: Uses theme spacing values
- ✅ Typography: Uses theme font sizes and weights
- ✅ Enhanced buttons: Uses new button variants
import { getColorWithOpacity } from '../constants/theme';
const semiTransparentBlue = getColorWithOpacity(colors.primary, 0.5);import { useTheme } from '../contexts/ThemeContext';
const theme = useTheme(); // Access entire theme object- Consistency - All components use the same design tokens
- Maintainability - Change colors in one place, updates everywhere
- Accessibility - Consistent contrast ratios and spacing
- Developer Experience - TypeScript support with autocomplete
- Flexibility - Easy to create theme variants or dark mode
- Apply to more components - Update UrlActionModal, RecipeViewer, etc.
- Add dark mode - Create alternate color schemes
- Component variants - Add more button styles, card types
- Animation - Add consistent transition timings
- Responsive design - Add breakpoint-based spacing/typography
Your theme system is now ready to use throughout your VelvetLadle app! 🚀