le-hoetel

Design system

Brand tokens, fonts, type scale, spacing and the components built on them.

Mobile first: most guests scan a QR code on a cheap Android phone, hotel staff use the dashboard on a phone or a desktop. Both must be fast and comfortable.

Tokens

The brand tokens live in packages/ui/src/styles/theme.css (:root and .dark) and are the le-hoetel brand as given in the kickoff prompt. Never edit them per component and never hard code a color. Hotels override --primary and one accent at runtime through their branding config, so every color in the UI must come from a token (bg-primary, text-muted-foreground, border-border).

Hotel branding at runtime

A hotel's primary_color and accent_color become css variables through brandStyle (@le-hoetel/common/color): --primary with --primary-foreground, and --brand-accent with --brand-accent-foreground (bg-brand-accent, text-brand-accent-foreground). The foreground is black or white, whichever has more contrast, so text on a brand color always passes AA (4.5:1). The dashboard layout sets them on the app shell, the public capture page does the same. A color that is under 3:1 against the light or dark page background (WCAG 1.4.11, brandContrastIssues) is not blocked: the admin create form and the hotel settings page show a warning under the field.

  • globals.css maps the tokens to Tailwind (@theme inline), holds the type scale, the coarse variant and a few utilities
  • --radius is 0.625rem. Controls and cards use rounded-lg, small items (menu rows, kbd, tooltip) rounded-md, badges rounded-full
  • dark mode is the .dark class set by next-themes; test both themes for every new screen

Fonts

RoleFontWhy
Latin (en, fr)Inter, variableone file for every weight (about 48 KB for the latin subset, covers French accents), very readable at small sizes on low density screens, tabular and lining numbers
Arabic (ar)Cairo, variableone file for every weight (about 31 KB, arabic subset), clean modern naskh/kufi hybrid, renders well at 14 to 16 px on low end Android, ships with Latin digits that match Inter
MonoJetBrains Monocodes and ids only, never preloaded

Decisions:

  • both are loaded with next/font/google, display: "swap" and only the subsets we need. Each file is self hosted, so there is no request to Google at runtime
  • variable fonts beat several static weights: one request instead of three or four, and the file sizes above are the whole cost
  • the browser downloads a font file only when a character from its unicode-range is on screen. So French and English pages never download Cairo, and the Arabic font is not preloaded (preload: false). Arabic pages pay one small swap
  • --font-sans is var(--font-latin), var(--font-arabic), system-ui. Mixed text (an Arabic sentence with a Latin hotel name) picks the right font per character with no extra code
  • we chose Cairo over IBM Plex Sans Arabic and Noto Kufi Arabic because those ship as separate static weights (more requests) or as larger files, and Cairo stays legible at body size on 720p phones
  • numbers stay Western digits (0-9), the habit in Tunisia and what Inter and Cairo both draw
  • Arabic text gets a taller line height (:lang(ar) in globals.css), because Arabic marks need the room

Each app declares the fonts in app/fonts.ts (next/font must run inside the app) and sets fontVariables on <html>. The lang and dir attributes on <html> are owned by the i18n routing.

Type scale

Defined in globals.css, usable as Tailwind classes:

ClassSizeUse
text-display36 to 56 px fluidlanding hero only
text-h128 to 40 px fluidpage title
text-h222 to 30 px fluidsection title
text-h320 pxcard or dialog title
text-body16 pxdefault, forms
text-small14 pxsecondary text, dense tables
text-caption12 pxbadges, hints, legal

Form inputs are 16 px on mobile (below that iOS zooms the page on focus) and 14 px from md.

Spacing and touch targets

  • spacing is Tailwind's 4 px scale. Page padding is px-4 on mobile, md:px-6 after; stack with gap-*, avoid margin between siblings
  • every control a thumb can hit is at least 44 px (h-11, token --spacing-touch). Button, input, select, tabs, switch and menu rows already follow it
  • compact variants (size="sm", xs, icon buttons) are small with a mouse and grow to 44 px on touch screens through the coarse: variant (@media (pointer: coarse)). Do not rebuild that per screen
  • checkboxes and radios are 20 px with a 44 px hit area, put them inside a Field with a label so the label is tappable
  • keep 8 px between two tap targets
  • use pb-safe and pt-safe for bars pinned to a screen edge (iPhone notch and home indicator)

Components

All in @le-hoetel/ui/components/*, built on shadcn with Base UI, with the RTL migration applied ("rtl": true in components.json). Add more with pnpm ui:add <component>, then check it against the rules in component patterns.

NeedComponent
actionsbutton (variants, sizes, loading)
text inputinput, textarea, input-group
choicecheckbox, radio-group, switch, select
form layout and errorsfield (Field, FieldLabel, FieldDescription, FieldError), label
phone numberphone-input (dial code and number, shell only, validate in the api)
overlaysdialog, alert-dialog, sheet (start, end, top, bottom), dropdown-menu, tooltip
navigationtabs, breadcrumb, sidebar
datatable, card, badge, avatar, item
feedbacksonner toasts, alert, spinner
statesempty-state, loading-state (ListSkeleton, CardSkeleton), skeleton

Empty and loading states

  • loading: show a skeleton with the shape of the final content (ListSkeleton, CardSkeleton, Skeleton), never a blank page and never a lone spinner for a whole page. A spinner is for a pending button (<Button loading>) or a short inline wait
  • skeletons carry role="status" and a screen reader label, passed in by the caller so it is translated
  • empty: use EmptyState with an icon, a one line title, a sentence that says what to do next, and one primary action. An empty list is an onboarding moment, not an error
  • error: Alert with variant="destructive" for a block, a toast for a transient failure. Say what happened and what to try, never expose raw errors

Dark mode

Tokens switch under .dark. Rules: no bg-white or text-black, use bg-background and text-foreground; images and logos must work on both backgrounds; borders come from border-border, which turns into a translucent white in dark mode.

On this page