From 2de1134dc4d1cfe112934611ae5803ae17a1bd7e Mon Sep 17 00:00:00 2001 From: vaibhav375 <144893207+vaibhav375@users.noreply.github.com> Date: Thu, 19 Nov 2026 06:34:54 +0530 Subject: [PATCH] fix(projects): precompile sample styles so they render offline (#584) The three sample projects compiled Tailwind in the browser via the Play CDN (cdn.tailwindcss.com), so without network they rendered unstyled, and the CDN logged a "should not be used in production" warning on every load. healthcare-dashboard also loaded chart.js unversioned from jsDelivr, so its charts silently disappeared offline. - Move each inline tailwind.config into tailwind.config.js and ship a precompiled, minified styles.css (Tailwind 3.4.19, matching the v3 Play CDN). projects/build-styles.sh regenerates them. - Vendor Chart.js 4.6.1 (MIT) as vendor/chart.umd.min.js. Verified in Chromium at 1440px and 375px: every element's computed style and bounding box matches the CDN build. Google Fonts are still loaded remotely; offline they fall back to the declared system fonts. Refs #573 (item A) Co-authored-by: Claude Opus 5.5 --- projects/build-styles.sh | 10 +++++++ projects/healthcare-dashboard/index.html | 27 ++----------------- projects/healthcare-dashboard/styles.css | 1 + .../healthcare-dashboard/tailwind.config.js | 23 ++++++++++++++++ .../vendor/chart.umd.min.js | 13 +++++++++ projects/portfolio-dark/index.html | 23 +--------------- projects/portfolio-dark/styles.css | 1 + projects/portfolio-dark/tailwind.config.js | 21 +++++++++++++++ projects/saas-landing/index.html | 21 +-------------- projects/saas-landing/styles.css | 1 + projects/saas-landing/tailwind.config.js | 19 +++++++++++++ 11 files changed, 93 insertions(+), 67 deletions(-) create mode 100755 projects/build-styles.sh create mode 100644 projects/healthcare-dashboard/styles.css create mode 100644 projects/healthcare-dashboard/tailwind.config.js create mode 100644 projects/healthcare-dashboard/vendor/chart.umd.min.js create mode 100644 projects/portfolio-dark/styles.css create mode 100644 projects/portfolio-dark/tailwind.config.js create mode 100644 projects/saas-landing/styles.css create mode 100644 projects/saas-landing/tailwind.config.js diff --git a/projects/build-styles.sh b/projects/build-styles.sh new file mode 100755 index 0000000..1c17dc3 --- /dev/null +++ b/projects/build-styles.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env sh +# Regenerates each sample's precompiled styles.css so the pages render offline. +# Run after editing a sample's index.html or tailwind.config.js. +set -e +cd "$(dirname "$0")" +for dir in */; do + [ -f "$dir/tailwind.config.js" ] || continue + # Pinned to Tailwind v3, the version the original Play CDN builds used. + (cd "$dir" && npx --yes tailwindcss@3.4.19 -c tailwind.config.js -o styles.css --minify) +done diff --git a/projects/healthcare-dashboard/index.html b/projects/healthcare-dashboard/index.html index d5733fb..9303415 100644 --- a/projects/healthcare-dashboard/index.html +++ b/projects/healthcare-dashboard/index.html @@ -4,34 +4,11 @@ HealthView - Analytics Dashboard - - + + -