Skip to content

feat: adopt Tailwind CSS utility classes for styling - #6

Open
nicomiguelino wants to merge 2 commits into
developmentfrom
chore/adopt-tailwind-css
Open

feat: adopt Tailwind CSS utility classes for styling#6
nicomiguelino wants to merge 2 commits into
developmentfrom
chore/adopt-tailwind-css

Conversation

@nicomiguelino

Copy link
Copy Markdown
Contributor

Summary

Migrates menu-board-app to Tailwind CSS utility classes, part of the company-wide rollout across edge-app repos. Reference pilot implementations: Screenly/clock-app#12 and Screenly/weather-app#6.

  • index.html: replaced custom CSS classes with Tailwind utility classes using arbitrary-value bracket syntax for exact px/rem/gradient/shadow/color values (e.g. text-[3.5rem], bg-[linear-gradient(...)], shadow-[...], max-[1200px]: for the app's custom max-width breakpoints).
  • src/main.ts: the dynamically rendered menu item cards (renderPage()) now carry Tailwind utility classes appended to their existing class names. Named CSS grid areas (grid-template-areas) are expressed via Tailwind's arbitrary-property bracket syntax directly on the elements.
  • src/css/style.css: slimmed to the standard layered import (@layer theme, base, utilities + tailwindcss/theme.css + @screenly/edge-apps/styles + tailwindcss/utilities.css), plus the two custom @font-face rules (Playfair Display, Source Sans 3) and a handful of things that genuinely can't be static utilities:
    • .fade-out { opacity: 0 } — toggled at runtime via classList.add/remove('fade-out').
    • .label.vegetarian/.spicy/.gluten-free color overrides — keyed off arbitrary, user-configured label text lower-cased at render time, so they can't be resolved into the template ahead of time.
    • The @supports not (backdrop-filter: blur(10px)) fallback.
    • :root custom properties --accent-color (overridden at runtime via documentElement.style.setProperty) and --spacing-md (read by main.ts for the header's fallback margin), still referenced from Tailwind arbitrary values (text-[var(--accent-color)], etc.).
  • package.json: bumped @screenly/edge-apps to ^1.3.0 (unpublished; ships Tailwind support). Lockfile untouched.
  • Regenerated all screenshots/*.webp.

This repo did not previously import @screenly/edge-apps/styles (it had its own bespoke reset/tokens) — it's now brought in line with the rest of the fleet via the standard layered CSS entry point, same as the two pilot repos.

Test plan

  • bun run type-check — passes
  • bun test src/ — 14/14 pass
  • bun run build — builds cleanly (only pre-existing, unrelated import.meta/chunk-size warnings)
  • bun run screenshots — all 10 resolutions generated successfully
  • Visually compared several new screenshots (1920x1080, 1080x1920 portrait, 800x480) against the previous versions — pixel-identical layout, including a pre-existing logo/card overlap quirk at very short viewport heights that predates this change.

Rework index.html to use Tailwind utility classes instead of custom CSS
classes, keeping visual appearance and behavior unchanged. Slim the CSS
entry point down to just the design-system import. Bump
@screenly/edge-apps to ^1.3.0 for upcoming Tailwind CSS support.
Regenerate screenshots to reflect the change.
@nicomiguelino
nicomiguelino marked this pull request as ready for review August 4, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant