All you ever need to know about electric Audis
Unofficial website dedicated to comprehensive information about all-electric Audi vehicles.
- Clone the repository
git clone https://github.com/electrichasgoneaudi/electrichasgoneaudi.github.io.git
cd electrichasgoneaudi.github.io- Install dependencies
npm install- Build initial CSS
npm run build-css-prodThis project uses Tailwind CSS with a custom build process for optimal performance and developer experience.
├── src/
│ └── input.css # Source Tailwind CSS file
├── static/css/
│ ├── tailwind.css # Generated CSS (do not edit)
│ └── custom.css # Legacy styles
├── tailwind.config.js # Tailwind configuration
└── package.json # Build scripts
# Watch for changes and rebuild CSS automatically
npm run css-watch
# Run both CSS watcher and Hugo server together
npm run dev# Build minified production CSS
npm run build-css-prod
# Build entire site for production
npm run build-
Start development servers (RECOMMENDED):
# Run both CSS watcher and Hugo server together npm run devThis is the preferred method as it ensures Tailwind CSS rebuilds automatically when you add new classes.
-
Alternative - separate terminals:
# Terminal 1: Start CSS watcher npm run css-watch # Terminal 2: Start Hugo server hugo server
-
Making CSS changes:
- Edit
src/input.cssfor Tailwind utilities and custom components - Use
@applydirectives for component styling - Add/modify Tailwind classes in HTML templates
- CSS will automatically rebuild when files change
- Edit
-
Adding new Tailwind classes:
- Update
tailwind.config.jsfor custom colors, fonts, or extensions - Restart CSS watcher after config changes:
# Stop current watcher (Ctrl+C) npm run css-watch
- Update
Problem: When using arbitrary values like h-[500px], md:h-[720px], or bg-[#ff0000], the styles don't apply.
Cause: Running hugo server alone doesn't trigger Tailwind CSS rebuilds. Tailwind needs to scan your HTML files and detect new classes to include them in the generated CSS.
Solutions:
- Always use
npm run devinstead of justhugo server - Or run
npm run css-watchin a separate terminal before making changes - After adding arbitrary values, manually rebuild CSS with
npm run build-css-prod
Alternative: Use inline styles (style="height: 720px;") for one-off values that don't need to be reusable.
- Never edit
static/css/tailwind.cssdirectly - it's auto-generated - CSS purging is enabled - only used classes are included in final build
- Custom legacy styles remain in
static/css/custom.css - Bootstrap classes removed - all styling now uses Tailwind CSS
- Stop CSS watcher (Ctrl+C)
- Delete
static/css/tailwind.css - Run
npm run build-css-prod - Restart development workflow
- Check
tailwind.config.jscontent paths - Ensure file extensions are included
- Restart CSS watcher after config changes
- Use
npm run build-css-prodfor minified production CSS - Consider removing unused custom CSS from
custom.css
hugo server
# Site available at http://localhost:1313hugo --minify
# Output in ./public/When contributing changes that affect styling:
- Follow the Tailwind CSS workflow above
- Test changes locally with
npm run dev - Build production CSS with
npm run build-css-prod - Commit both source changes and generated CSS
- Include screenshots for visual changes