| name | single-file-html-mastery |
| description | Use when shipping a single-page artifact, demo, or marketing page that doesn't need a build process. Single-file HTML = fastest delivery, smallest footprint.
|
Single-File HTML Mastery
Single-file HTML: CSS + JS + content in one file. No build step. Maximum portability. Used for: artifacts, demos, simple landing pages.
Single-file pattern
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<title>...</title>
<style>
</style>
</head>
<body>
<script>
</script>
</body>
</html>
Single-file advantages
- No build process (instant deploy)
- Maximum portability (copy file, host anywhere)
- Small file size (no JS framework)
- Easy to edit (one file)
- Easy to share (email, attachment)
- Survives long-term (no dependency rot)
Single-file limitations
- No code reuse across pages
- CSS class collisions if multiple pages
- Hard to scale beyond ~1000 lines
- No imports (everything inline)
Use for: demos, single-page sites, artifacts, prototypes. Move to multi-file when adding routes.
Where this fits in the X3 empire
Pattern used in CardPrepAI artifacts and demo pages.