LayX is a modern, CSS-first framework and build tool purpose-built for creating blazing-fast, high-converting landing pages. It combines semantic HTML layouts with a zero-runtime CSS core, an interactive CLI, and automated production bundling.
Core Philosophy: "Build stunning landing pages faster. No framework bloat, no runtime overhead β just pure performance and developer ergonomics."
Warning
LayX (layx-css) is currently in active early development (alpha stage).
- APIs, directory structures, and CLI commands may change before the
1.0.0stable release. - Breaking changes can occur between minor/alpha updates.
- We actively welcome early testers, bug reports, and design discussions! Please submit feedback via GitHub Issues.
- π« Zero Runtime β Pure modern CSS architecture. No bulky client-side JavaScript runtime or Virtual DOM overhead.
- π¦ Landing-Page Focused β Optimized for conversion with hero sections, pricing tables, testimonials, CTAs, and responsive navbars.
- π§© Hybrid Component System β Starter projects ship lean with essential defaults (
button,navbar,footer). Add components on-demand (layx add -c accordion) with automatic CSS imports. - π§± Static Component Baking β Use lightweight
<component>tags for prototyping; the build engine pre-renders them into clean, static HTML and unwrapscomponents-readylisteners for zero runtime cost in production. - β‘ Non-Destructive Bundler β Preserves modern CSS features (
@layer,@starting-style, dynamic viewport units, relative colors) while stripping unused grid classes. - π¦ Clean Build Output β Outputs production bundles directly into
/dist(configurable) without modifying development source files, flatteningpages/to root and copying all root assets. - πΌοΈ Integrated Image Optimizer β Automatically converts images to next-gen AVIF/WebP formats and purges unused SVG symbols.
- π» Interactive CLI β Beautiful, modern interactive terminal interface built with
@clack/prompts.
Scaffold a brand new landing page in seconds:
npx layx-css create my-landing-page
# or
npm create layx my-landing-pageInstall the CLI globally to have the layx command directly available anywhere on your machine:
npm install -g layx-cssOnce installed globally, you can launch the interactive menu by running:
layxScaffolds a new LayX landing page project with all necessary configurations, pre-configured fonts, essential components, and build scripts.
layx create my-landing-pageExtend your project on-demand with components, optional feature modules (others), Google Fonts, wireframes, or landing page templates:
# Add components (offline-first from local package, with remote fallback)
layx add -c accordion modal tabs
# Add optional feature modules (smooth scroll, syntax highlighter, mouse tracker, etc.)
layx add -o smooth_scroll split_text syntax_highlighter
# Download & bundle Google Fonts locally into assets/font/
layx add -f "Red Hat Display" "Inter"
# Add wireframe presets
layx add -w hero features pricing
# Add starter landing page templates
layx add -t saas-landingNote: New projects ship lean with default components (button, navbar, footer) and default others (icon, theme). Adding components or other modules automatically copies assets into layx/ and auto-wires @import statements into layx/layx.css and imports into layx/layx.js.
Compiles and prepares your landing page for high-performance production deployment into /dist:
- Static Component Baking: Pre-renders
<component>tags into semantic HTML, strips prototype imports, and unwrapscomponents-readyevent listeners before bundling. - Pages Flattening: Moves
pages/*.htmldirectly to the output root (e.g.pages/other.html->dist/other.html) and updates links automatically. - Root Asset Copying: Copies all custom root files (
favicon.ico,robots.txt,_headers) and directories (public/,downloads/) todist/, while strictly excluding thelayx/framework folder. - Configurable Copy & Exclude: Customize additional copy targets (
copy: ['docs']) or exclude patterns (exclude: ['drafts', '*.log']) inlayx.config.mjsor via--copyand--excludeflags. - CSS Optimization: Strips unused responsive grid layout classes and minifies CSS without altering modern CSS syntax (
@layer,@starting-style). - JS Bundling: Uses
esbuildfor code-splitting, tree-shaking, and ES module bundling intodist/assets/js/. - HTML Cleanup: Removes development framework references (
/layx/layx.css,/layx/layx.js) completely from HTML. - Image Optimization: Converts images in
assets/image/to AVIF/WebP and purges unused SVG symbols. - Source Protection: Leaves development source files completely untouched.
layx build
# or with custom output directory
layx build --outDir dist
# or with custom exclusions & copy targets
layx build --exclude "drafts,*.log" --copy "docs"Manually compress and optimize images in assets/image/:
layx optimizeInstall LayX HTML, CSS, and JS code snippets for VS Code:
# Install into the current project workspace (.vscode/)
layx snippets
# Install globally into your user VS Code profile
layx snippets --globalLayX uses clean, semantic syntax for common landing page layout needs:
<container>
<div class="content">
<h1>Welcome to LayX</h1>
</div>
</container><layout>
<div class="x-8">Main content column</div>
<div class="x-4">Sidebar column</div>
</layout><navbar>
<div class="brand">MyLogo</div>
<nav class="link-wrapper">
<a class="link" href="#features">Features</a>
<a class="link" href="#pricing">Pricing</a>
</nav>
<button class="btn btn-primary">Get Started</button>
</navbar>my-landing-page/
βββ assets/
β βββ brand/ # Logos and branding assets
β βββ css/
β β βββ base.css # Project-wide custom CSS
β β βββ pages/home.css # Page-specific styles
β βββ font/ # Local web fonts (WOFF2)
β βββ image/ # Project images and SVG sprites
β βββ js/
β βββ base.js # Project-wide custom JS
β βββ pages/home.js # Page-specific JS
βββ layx/ # LayX framework core
β βββ layx.css # Framework CSS entry point
β βββ layx.js # Framework JS entry point
β βββ components/ # Active components (button, navbar, etc.)
β βββ main/ # Base reset, layout grid, variables
β βββ utilities/ # Utility classes (spacing, flex, grid)
βββ pages/ # Additional landing sub-pages
βββ index.html # Main landing page entry point
βββ package.json # Project dependencies and build scripts
βββ layx.config.mjs # (Optional) Custom build & optimizer configuration
For complete guides and architectural references, check out our markdown docs in the /docs folder:
- π Getting Started β Installation, scaffolding, and project structure tour.
- π οΈ CLI Reference β Comprehensive guide to all commands, flags, and interactive menus.
- π§© Components System β Core components, manifest schema, and auto-wiring.
- β‘ Others Modules β Interactive modules (
theme,icon,smooth_scroll, etc.). - ποΈ Build & Bundling Engine β Non-destructive CSS minification and two-way build lifecycle.
LayX is open-source and welcoming contributions, bug reports, and ideas!
- Found a bug or have a suggestion? Open an issue on GitHub Issues.
- Want to contribute code or components? Fork the repository and open a Pull Request.
LayX is open-source software licensed under the MIT License.
