En samling af sikre, responsive HTML/CSS skabeloner til e-Boks webview beskeder, med en moderne React-baseret demo landing page.
Dette repository indeholder:
- Produktionsklare HTML/CSS skabeloner til e-Boks digital post (kun HTML/CSS, ingen JavaScript)
- Moderne demo landing page bygget med React, TypeScript, CSS Modules og Style Dictionary
Se live site: https://rgehrkedk.github.io/html-templates/
Siden opdateres automatisk fra main branch ved hver push.
- Årsbrev - Forsikring (Classic) - Professionelt årsbrev med CSS-only accordions
- Årsbrev - Forsikring (Editorial) - Editorial design med serif typografi og illustrationer
- Årsbrev - Forsikring (Swiss Style) - International Typographic Style med grid-baseret layout
- Årsbrev - Forsikring (Utility) - Funktionel design med klar hierarki
- Fripolice Notifikation - Pension - Soft Illustrated stil med dekorative marginer
- ✅ Ren, valideret HTML uden eksterne afhængigheder
- ✅ Responsivt design der virker på alle enheder
- ✅ Kun HTML og CSS (ingen JavaScript)
- ✅ Sikkerhedsfokuseret (ingen scripts, ingen eksterne ressourcer)
- ✅ CSS-only accordions
- ✅ React 18 med TypeScript
- ✅ CSS Modules for scoped styling
- ✅ Style Dictionary for design tokens (primitives + themes)
- ✅ Dark/Light mode support
- ✅ Component-based architecture (primitive + composed components)
- ✅ Vite for fast development and optimized builds
html-templates/
├── src/ # React application source
│ ├── components/
│ │ ├── primitives/ # Primitive components
│ │ │ ├── Button/
│ │ │ │ ├── Button.tsx # Component implementation
│ │ │ │ ├── Button.types.ts # TypeScript types
│ │ │ │ ├── Button.module.css # CSS modules
│ │ │ │ └── index.ts # Barrel export
│ │ │ ├── Tag/
│ │ │ └── Card/
│ │ └── composed/ # Composed components
│ │ ├── Header/
│ │ ├── FilterSection/
│ │ ├── TemplateCard/
│ │ └── TemplateGrid/
│ ├── data/
│ │ └── templates.ts # Template data
│ ├── styles/
│ │ ├── tokens/ # Generated design tokens (auto-generated)
│ │ │ ├── variables.css # CSS custom properties
│ │ │ └── tokens.js # JS tokens
│ │ └── global.css # Global styles
│ ├── types/
│ │ ├── template.ts # Template types
│ │ └── css-modules.d.ts # CSS module types
│ ├── App.tsx # Main app component
│ ├── main.tsx # Entry point
│ └── vite-env.d.ts # Vite types
├── tokens/ # Design token definitions
│ ├── primitives/ # Design primitives
│ │ ├── colors.json
│ │ ├── spacing.json
│ │ ├── typography.json
│ │ ├── radius.json
│ │ └── shadow.json
│ └── themes/ # Theme layers
│ ├── light.json # Light theme
│ └── dark.json # Dark theme
├── templates/ # HTML/CSS templates (untouched)
│ ├── insurance-annual-letter.html
│ ├── insurance-annual-letter-editorial.html
│ ├── insurance-annual-letter-swiss.html
│ ├── insurance-annual-letter-utility.html
│ └── pension-fripolice-notice.html
├── dist/ # Build output (git-ignored)
├── build-index.js # Post-build script
├── style-dictionary.config.cjs # Style Dictionary config
├── vite.config.ts # Vite configuration
├── tsconfig.json # TypeScript config
└── package.json # Dependencies and scripts
- Node.js 18+
- npm
git clone https://github.com/rgehrkedk/html-templates.git
cd html-templates
npm install# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
# Generate design tokens only
npm run tokens:buildnpm run devThe app will be available at http://localhost:5173/
The project uses Style Dictionary to manage design tokens in a two-layer system:
Raw design values that are platform-agnostic:
- colors.json - Color palette (blue, slate, green scales)
- spacing.json - Spacing scale (0-24)
- typography.json - Font families, sizes, weights, line heights
- radius.json - Border radius values
- shadow.json - Box shadow definitions
Semantic tokens that reference primitives:
- light.json - Light theme colors, shadows
- dark.json - Dark theme colors, shadows
Design tokens are automatically compiled to:
src/styles/tokens/variables.css- CSS custom propertiessrc/styles/tokens/tokens.js- JavaScript tokens
Self-contained, reusable UI elements:
- Button - Primary/Secondary variants with active states
- Tag - Industry/Style tags with themed colors
- Card - Content cards with hover effects
Each primitive component has:
ComponentName.tsx- Component logicComponentName.types.ts- TypeScript interfacesComponentName.module.css- Scoped styles using design tokensindex.ts- Barrel export
Higher-level components built from primitives:
- Header - Site header with theme toggle
- FilterSection - Filter controls for industry/style
- TemplateCard - Template display card with actions
- TemplateGrid - Grid layout for templates with empty state
All components use CSS Modules for scoped styling:
- Class names are automatically scoped to prevent conflicts
- Design tokens (CSS custom properties) are used for all design values
- Dark mode support via
[data-theme="dark"]attribute - Responsive design with mobile-first approach
The app supports light/dark modes:
- Theme state managed in
App.tsx data-themeattribute set on<html>element- CSS custom properties switch based on theme
- User preference persists via React state
npm run buildBuild steps:
- Generate design tokens - Style Dictionary compiles tokens to CSS/JS
- Build React app - Vite bundles the application
- Copy templates - HTML templates copied to
dist/templates/ - Output - Production-ready files in
dist/
Build output:
dist/
├── index.html # Entry HTML
├── assets/
│ ├── index-[hash].css # Bundled CSS
│ └── index-[hash].js # Bundled JS
└── templates/ # HTML templates
└── *.html
The project uses GitHub Actions for automated deployment:
- Push to
claude/*branch - Runs
npm run build - Auto-commits build changes
- Merges to
mainbranch - GitHub Pages deploys from
main
- Build the project:
npm run build - Deploy the
dist/folder to your hosting service
- Create your
.htmlfile intemplates/directory - Add metadata to
src/data/templates.ts:{ id: 'template-id', title: 'Template Title', description: 'Description...', industry: 'forsikring' | 'pension', style: 'editorial' | 'swiss' | 'utility' | 'soft-illustrated' | 'classic', filename: 'template-file.html' }
- Commit and push - deployment happens automatically
- Add primitive values to
tokens/primitives/*.json - Reference in theme in
tokens/themes/*.json - Rebuild tokens:
npm run tokens:build - Use in CSS Modules:
var(--token-name)
Example:
// tokens/primitives/colors.json
{
"color": {
"purple": {
"500": { "value": "#a855f7" }
}
}
}
// tokens/themes/light.json
{
"theme": {
"light": {
"color": {
"accent": { "value": "{color.purple.500.value}" }
}
}
}
}- Create component folder in
src/components/primitives/orsrc/components/composed/ - Add files:
ComponentName.tsxComponentName.types.tsComponentName.module.cssindex.ts
- Use design tokens in CSS:
var(--theme-light-color-primary) - Export from parent
index.ts
- Modern browsers (Chrome, Firefox, Safari, Edge)
- CSS Grid and Flexbox support required
- CSS custom properties (CSS variables) required
MIT License - Use freely in your projects.