Skip to content

Replace Tailwind CDN with a local build process#13

Merged
jamesmoore merged 2 commits intomainfrom
copilot/create-tailwindcss-build-process
Mar 6, 2026
Merged

Replace Tailwind CDN with a local build process#13
jamesmoore merged 2 commits intomainfrom
copilot/create-tailwindcss-build-process

Conversation

Copy link
Contributor

Copilot AI commented Mar 6, 2026

index.html loaded Tailwind via https://cdn.tailwindcss.com (the play CDN, not intended for production) and used the CDN-only <style type="text/tailwindcss"> block for custom CSS. This replaces that with a proper offline build that ships only the CSS classes actually used.

Changes

  • package.json + tailwind.config.js — Adds tailwindcss@^3.4.19 with a build script (tailwindcss -i src/input.css -o src/tailwind.css --minify); content scanning covers src/**/*.html and src/**/*.js

  • src/input.css — New CSS source file consolidating the Tailwind directives and the two inline style blocks extracted from index.html:

    @tailwind base;
    @tailwind components;
    @tailwind utilities;
    
    :root {
      --wake-on: theme(colors.emerald.600);
      --wake-off: theme(colors.red.600);
    }
    
    .wake-on { transition: color 0.3s ease-in-out; color: var(--wake-on); }
    .wake-off { transition: color 0.3s ease-in-out; color: var(--wake-off); }
  • src/index.html — Removes the CDN <script> and both <style> blocks; adds <link rel="stylesheet" href="tailwind.css">

  • Dockerfile — Multi-stage build: Node Alpine stage runs npm ci && npm run build to emit src/tailwind.css, BusyBox stage copies the finished src/ directory

  • .gitignore — Excludes node_modules/ and the generated src/tailwind.css


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: jamesmoore <6506748+jamesmoore@users.noreply.github.com>
Copilot AI changed the title [WIP] Create Tailwind CSS build process and workflow changes Replace Tailwind CDN with a local build process Mar 6, 2026
@jamesmoore jamesmoore marked this pull request as ready for review March 6, 2026 09:53
@jamesmoore jamesmoore merged commit 22f6e8d into main Mar 6, 2026
4 checks passed
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.

2 participants