Overview
The Sushi Restaurant App uses Tailwind CSS for utility-first styling, creating a cohesive marine-themed design system. Tailwind is integrated with Ionic components to provide a modern, responsive interface.Configuration
The Tailwind configuration is minimal and extends the default Tailwind theme:tailwind.config.js
Content Paths
Tailwind scans all HTML and TypeScript files in thesrc/ directory to detect which utility classes are used, enabling automatic purging of unused styles in production.
Integration with Ionic
Tailwind is imported inglobal.scss alongside Ionic’s core styles:
global.scss
The order matters: Tailwind’s base layer comes after Ionic’s core CSS to ensure proper styling hierarchy.
Marine Theme Color Palette
The app uses a consistent marine-inspired color scheme:Color Usage Guide
| Color Class | Usage | Example |
|---|---|---|
bg-blue-900 | Primary headers, toolbars | Navigation bar |
text-blue-900 | Primary text, headings | Page titles, item names |
bg-cyan-50 | Page backgrounds | Content areas |
text-cyan-600 | Secondary text, links | Action prompts |
border-cyan-100 | Subtle borders | Card outlines |
bg-teal-400 | Accent elements | Decorative bars, borders |
text-teal-500 | Icons, success states | Checkmark icons |
Real-World Examples
Home Page Header
Fromhome.page.html:2-6:
- bg-blue-900: Deep ocean blue background
- text-black: Black text for contrast
- shadow-md: Medium shadow for depth
- text-center, text-xl, font-bold: Typography utilities
- tracking-widest, uppercase: Stylistic text transformations
Menu List Items
Fromhome.page.html:23-46:
- Rounded corners:
rounded-2xlfor modern card design - Hover effects:
hover:shadow-mdfor interactivity - Transitions:
transition-all duration-300for smooth animations - Spacing:
mb-4,ml-3,my-3for consistent layout - Border accent:
border-teal-400for visual interest
Detail Page Hero Section
Fromdetalle-registro.page.html:16-34:
- Position utilities:
relative,absolute,inset-0for layering - Gradient overlays:
bg-gradient-to-t from-blue-900/80for image darkening - Object fit:
object-coverfor proper image scaling - Drop shadows:
drop-shadow-lgfor text readability - Decorative elements:
h-1.5 w-24 bg-teal-400 rounded-fullaccent bar
Content Card
Fromdetalle-registro.page.html:37-46:
- Card elevation:
shadow-xlfor prominent cards - Soft borders:
border-cyan-100/50using opacity - Flexbox layouts:
flex items-centerfor alignment - Icon backgrounds:
bg-teal-100 rounded-fullfor icon containers
Common Patterns
Cards and Containers
Buttons
The button uses a 3D effect with
border-b-4 and active:border-b-0 combined with active:mt-5 to simulate a pressed state.Typography
Best Practices
Use Consistent Spacing
Stick to Tailwind’s spacing scale (4px increments). Use
p-4, mb-6, mx-3 rather than custom values.Combine with Ionic Classes
Use Ionic utilities like
ion-no-border alongside Tailwind classes for optimal integration.Leverage Transitions
Add
transition-all duration-300 to interactive elements for smooth state changes.Use Color Opacity
Apply opacity with
/ notation: bg-blue-900/80 for semi-transparent backgrounds.Performance
Tailwind automatically purges unused styles in production builds, keeping the CSS bundle size minimal. The configuration ensures only classes used in your.html and .ts files are included in the final build.