Buttons

Button Element with semantic variants for all actions and contexts. This is the ONLY button system — all patterns must use these classes.

Primary Secondary Tertiary Danger Icon Glass Variants Sizes

📐 Context vs. Theme

Context = Physical placement in the layout (standard page vs. glassy overlay/hero).
Theme = Site-wide user preference (light/dark mode toggle 🌙).

Below previews show each button in both contexts. Use the 🌙 toggle (top-right) to test how buttons look in both themes. Buttons should work correctly in all 4 combinations: Light+Standard, Light+Glassy, Dark+Standard, Dark+Glassy.

1. Primary Button

Main call-to-action button for primary user flows (booking, submitting forms, confirmations). Works in both standard and glassy contexts due to solid background.

1.1 Standard Layout Preview

Standard Context

For use on normal page surfaces (content areas, cards, dialogs)

1.2 Standard Layout HTML Snippet

HTML
<button class="btn btn--primary">Book Now</button>

<!-- Disabled state -->
<button class="btn btn--primary" disabled>Disabled</button>

1.3 Glassy Layout Preview

Glassy Context

For use on dark overlays and hero sections

1.4 Glassy Layout HTML Snippet

HTML
<button class="btn btn--primary">Book Now</button>

<!-- Disabled state -->
<button class="btn btn--primary" disabled>Disabled</button>

2. Secondary Button

Outline button for secondary actions like "Cancel", "Back", or "Skip". Use .btn--secondary for standard contexts and .btn--secondary-glass for glassy contexts.

2.1 Standard Layout Preview

Standard Context

For use on normal page surfaces (content areas, cards, dialogs)

2.2 Standard Layout HTML Snippet

HTML
<button class="btn btn--secondary">Cancel</button>

2.3 Glassy Layout Preview

Glassy Context

For use on dark overlays and hero sections

2.4 Glassy Layout HTML Snippet

HTML
<button class="btn btn--secondary-glass">Contact Us</button>

3. Tertiary Button (Ghost)

Text-only button for low-priority actions. No border, minimal background on hover. Use .btn--tertiary for standard contexts and .btn--tertiary-glass for glassy contexts.

3.1 Standard Layout Preview

Standard Context

For use on normal page surfaces

3.2 Standard Layout HTML Snippet

HTML
<button class="btn btn--tertiary">Skip</button>

3.3 Glassy Layout Preview

Glassy Context

For use on dark overlays and hero sections

3.4 Glassy Layout HTML Snippet

HTML
<button class="btn btn--tertiary-glass">Skip</button>

4. Danger Button

Destructive action button for confirmations or deletions. Use sparingly for actions with permanent consequences. Works in both contexts due to solid background.

4.1 Standard Layout Preview

Standard Context

For use on normal page surfaces

4.2 Standard Layout HTML Snippet

HTML
<button class="btn btn--danger">Delete</button>

4.3 Glassy Layout Preview

Glassy Context

For use on dark overlays and hero sections

4.4 Glassy Layout HTML Snippet

HTML
<button class="btn btn--danger">Delete</button>

5. Icon Button

Square button for icon-only actions. Always include aria-label or title for accessibility. Use .btn--icon for standard contexts and .btn--icon-glass for glassy contexts.

5.1 Standard Layout Preview

Standard Context

For use on normal page surfaces

5.2 Standard Layout HTML Snippet

HTML
<button class="btn btn--icon" title="Close" aria-label="Close">
  <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
  </svg>
</button>

5.3 Glassy Layout Preview

Glassy Context

For use on dark overlays and hero sections

5.4 Glassy Layout HTML Snippet

HTML
<button class="btn btn--icon-glass" title="Close" aria-label="Close">
  <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
  </svg>
</button>

6. Size Variants

Button sizes for different contexts and visual hierarchies. Size modifiers work with all button variants.

Standard Context

Normal page surfaces

Glassy Context

Dark overlays and hero sections

HTML
<button class="btn btn--primary btn--xs">Extra Small</button>
<button class="btn btn--primary btn--sm">Small</button>
<button class="btn btn--primary">Normal</button>
<button class="btn btn--primary btn--lg">Large</button>

9. Full Width Button

Use .btn--full to make buttons stretch to fill their container. Useful for mobile forms and CTAs. Works with all button variants.

Standard Context

Normal page surfaces

Glassy Context

Dark overlays and hero sections

HTML
<button class="btn btn--primary btn--full">Complete Booking</button>

Usage Guidelines

✅ Do

  • • Use .btn--primary for main CTAs (works in all contexts)
  • • Use .btn--secondary for actions in standard contexts
  • • Use .btn--secondary-glass on glassy contexts (dark overlays, hero sections)
  • • Use .btn--tertiary for low-priority actions in standard contexts
  • • Use .btn--tertiary-glass for low-priority actions in glassy contexts
  • • Use .btn--icon / .btn--icon-glass based on context
  • • Test buttons in all 4 combinations (Light/Dark Theme × Standard/Glassy Context) using 🌙 toggle
  • • Combine size classes: .btn--primary .btn--sm
  • • Use standard disabled attribute for unavailable actions
  • • Include aria-label on icon-only buttons
  • • Add meaningful labels (avoid "Click here" or generic "Submit")
  • • Maintain minimum 48px touch targets for mobile

❌ Don't

  • Never use standard variants in glassy contexts (won't be visible)
  • Never use inverse variants in standard contexts (unnecessary)
  • • Never rely on theme preference (Light/Dark) to fix context issues
  • • Never create custom button classes in patterns/views (e.g., .offer-card-cta)
  • • Never use Tailwind utility classes for button styling
  • • Never duplicate button styling in component-specific CSS
  • • Don't mix multiple primary buttons in one section
  • • Don't use .btn--danger for non-destructive actions
  • • Don't add inline styles that override button classes
  • • Don't place buttons immediately next to each other without gap
  • • Don't use different color schemes (only use defined variants)

📐 Layering Contract

Buttons inside Cards, Forms, Modals, or any higher-level pattern MUST use Button Element classes defined in /assets/css/button.css. If you need a new button variant, add it to the Button Element definition, not to the higher-level component.

CSS Location

All button styles are defined in:

/assets/css/button.css

Imported by: /assets/css/ui-system.css

Includes: Base styles, variant styles (primary, secondary, secondary-inverse, tertiary, danger), size modifiers (xs, sm, lg, xl), icon button, full-width variant, disabled states, hover/active transitions, dark mode support.

Related Documentation