This repository contains the development projects for Sparktype themes built with Tailwind CSS 4 and Vite.
sparktype-themes/
├── sparksite-theme/ # Development project for sparksite theme
└── sparkdocs-theme/ # Development project for sparkdocs theme
Each theme project has this clean structure:
sparksite-theme/
├── src/ # Source (git tracked) - matches built theme layout
│ ├── styles.css # Tailwind source
│ ├── base.hbs
│ ├── theme.json
│ ├── layouts/
│ └── partials/
└── dist/ # Built bundle (gitignored)
├── styles.css # Built by Vite
├── base.hbs # Copied from src
├── theme.json # Copied from src
├── layouts/ # Copied from src
└── partials/ # Copied from src
cd sparksite-theme # or sparkdocs-theme
npm installOption 1: Vite watch (CSS only)
npm run devWatches src/styles.css and src/theme/**/*.hbs, rebuilds CSS to dist/styles.css
Option 2: Full watch (CSS + auto-copy)
npm run watchWatches entire src/ folder, rebuilds CSS and copies everything to Sparktype on any change
# Build CSS only
npm run build
# Build and copy to Sparktype
npm run build:copy
# Copy only (without rebuilding)
npm run copy-
Source:
src/contains theme exactly as it will be builtsrc/styles.css- Tailwind source (replaced by built version)src/*.hbs,src/*.json- Template files (copied as-is)
-
Build: Vite scans
src/**/*.hbsfor Tailwind classes, buildsdist/styles.css -
Bundle: Copy script copies
src/*todist/(except styles.css which is built), then to Sparktype
- Edit
src/only: Thedist/directory is completely generated - Vite watches
src/: No infinite loops - Vite never watches its own output - Simple git tracking: Only
src/,scripts/, andpackage.jsonare tracked - Each theme is independent: Separate dependencies and builds
Define in src/styles.css:
@import "tailwindcss";
@plugin "@tailwindcss/typography";
@theme {
--color-primary: #0d6efd;
--color-background: #f8f9fa;
--font-sans: Inter, system-ui, sans-serif;
}Edit src/**/*.hbs:
<div class="bg-[--color-primary] font-sans p-6 rounded-lg shadow-md">
Content
</div>Or use standard Tailwind utilities:
<div class="flex gap-4 items-center justify-between">
<h1 class="text-3xl font-bold">Title</h1>
<button class="px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600">
Click me
</button>
</div>What's tracked:
src/- All source files (CSS + templates)scripts/- Build scriptspackage.json- Dependenciesvite.config.js- Build configuration
What's ignored:
dist/- Complete generated bundlenode_modules/- Dependencies