Skip to content

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

Draft
nicomiguelino wants to merge 1 commit into
developmentfrom
chore/adopt-tailwind-css
Draft

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

Conversation

@nicomiguelino

Copy link
Copy Markdown
Contributor

Summary

Part of the company-wide rollout of Tailwind CSS across Edge App repos. This mirrors the pattern established in:

Changes:

  • index.html: replaced custom CSS classes with Tailwind utility classes, using arbitrary-value bracket syntax for exact px/gradient/shadow/color values and preserving the app's calc(N * var(--su)) signage-scaling unit convention exactly as before. portrait: variants express the @media (orientation: portrait) overrides. Original class names (card, card-header, card-icon, card-label, card-value, widgets, label-chips, label-chip, no-labels) were kept alongside the new utility classes since the JS/tests reference .label-chip and .no-labels by selector.
  • src/app.ts: the dynamically-created label chip / "no labels" spans now carry the equivalent Tailwind utility classes appended to their existing class names (no rendering logic changes).
  • src/css/style.css: slimmed down to the standard 4-import Tailwind layer setup pointing at @screenly/edge-apps/styles.
  • src/main.ts: added the explicit import '@screenly/edge-apps/components' side-effect import (same pattern already used in clock-app/weather-app). Without it, the new library build's bundler tree-shakes away the customElements.define() calls for <auto-scaler> etc., so the web component never upgrades — this was a real, silent regression I hit while testing against the new library build, not a stylistic choice, and it's required for this app to keep working under @screenly/edge-apps@^1.3.0.
  • package.json: bump @screenly/edge-apps to ^1.3.0 (unpublished; ships Tailwind support). Lockfile untouched.
  • screenshots/*: regenerated for all resolutions.

Test plan

Tested locally against the unpublished @screenly/edge-apps 1.3.0 tailwind-support tarball (temporarily installed, then reverted before committing — package.json/lockfile are back to the committed dependency shape plus the version-string bump only):

  • bun run type-check — passes
  • bun test — 8/8 tests pass (including .label-chip / .no-labels selector assertions)
  • bun run build — succeeds
  • bun run screenshots — all 10 resolutions generated successfully
  • Visually inspected landscape (1920x1080) and portrait (1080x1920) screenshots — pixel-equivalent to the previous design, including card layout, icons, label chips, and portrait-mode scaling

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.

Also add the explicit `import '@screenly/edge-apps/components'` side-effect
import to src/main.ts, matching the pattern already used in clock-app and
weather-app: without it, the new library build tree-shakes away the
customElements.define() calls for <auto-scaler> (and friends), so the
web component never upgrades and the whole layout silently collapses.
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