HN Herald uses Tailwind CSS for styling. Before running the application, you need to build the CSS.
make install-nodeOr directly with npm:
npm installmake cssOr directly with npm:
npm run build:cssThis will generate src/hn_herald/static/css/styles.css from src/hn_herald/static/css/input.css.
For development, run Tailwind in watch mode in a separate terminal:
make dev-cssThis will automatically rebuild CSS when you modify templates or input.css.
Phase 5 implementation created the following files:
-
tailwind.config.js- Tailwind CSS configuration- Content paths for template scanning
- Custom colors (primary, success, warning, error)
- Mobile-first breakpoints
- Custom utilities for touch targets
- Dark mode support (system preference)
-
package.json- Node.js dependencies and scriptstailwindcss@^3.4.0as dev dependency- Build and watch scripts
-
src/hn_herald/static/css/input.css- Source CSS file (EDIT THIS)- Tailwind directives (@tailwind base, components, utilities)
- Custom component classes:
.btn-primary- Primary button styling.btn-secondary- Secondary button styling.form-input- Form input styling.article-card- Article card layout.tag-chip-*- Tag styling with hover/focus states.htmx-indicator- Loading indicator (hidden by default)
- Accessibility utilities:
- Focus visible styles
- Screen reader only class (
.sr-only) - Reduced motion support
- Dark mode support (prefers-color-scheme)
- Print styles
-
src/hn_herald/static/css/styles.css- Generated CSS (DO NOT EDIT)- This file is created by running
npm run build:css - It's the compiled output used by the application
- This file is created by running
Makefile- Added CSS build targets:make install-node- Install npm dependenciesmake css- Build CSS for production (minified)make css-watch- Watch CSS for developmentmake dev-css- Alias for css-watchmake clean- Now also removes node_modules and styles.css
docs/setup/tailwind-css-setup.md- Comprehensive setup guide- Installation instructions
- Build process explanation
- Configuration details
- Development workflow
- Troubleshooting guide
- Best practices
- Base styles for 320px+ screens
- Progressive enhancement with breakpoints
- Touch-friendly interactions (48px minimum touch targets)
- Readable font sizes (16px+ body text)
- Primary (Blue): Main theme color for buttons, links, highlights
- Success (Green): Success states and positive feedback
- Warning (Yellow): Warnings and cautions
- Error (Red): Errors and validation messages
Each color has 11 shades (50-950) for flexibility.
- WCAG 2.1 AA compliant color contrasts
- Keyboard navigation support (focus rings)
- Screen reader utilities
- Reduced motion preferences respected
- Touch-friendly target sizes
.htmx-indicatorclass for loading states- Auto-shows during HTMX requests
- Hidden by default
- System preference detection (
prefers-color-scheme: dark) - Automatic theme switching
- All components support dark variants
- Minified CSS for production
- PurgeCSS automatically removes unused styles
- Optimized for fast page loads
After building the CSS, proceed with:
-
Phase 6: Template Creation
- Create Jinja2 templates using the CSS classes
- Implement HTMX integration
- Build interactive components
-
Phase 7: JavaScript Functionality
- Tag selector logic
- Profile management (localStorage)
- Form validation
-
Phase 8: Testing
- E2E tests with Playwright
- Accessibility compliance tests
- Mobile viewport tests
- Performance benchmarks
Install Node.js from https://nodejs.org/ (LTS version recommended)
- Clear browser cache (Ctrl+F5 or Cmd+Shift+R)
- Check if watch mode is running (
make dev-css) - Rebuild manually:
make css
- Check Node.js version:
node --version(need v18+) - Delete and reinstall:
rm -rf node_modules && npm install - Check for syntax errors in
input.css