Skip to content
arif891Public

About

An extensible CSS framework for modern web development. Combines modular CSS, customizable components, and a powerful CLI for seamless frontend and backend integration.

Topics

Resources

Stars

6 stars

Watchers

1 watching

Forks

Latest commit

Β 

History

921 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

LayX

npm version npm license node version

Layx Social Preview

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

🚧 Active Development Stage (Alpha)

LayX (layx-css) is currently in active early development (alpha stage).

  • APIs, directory structures, and CLI commands may change before the 1.0.0 stable 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.

✨ Highlights

  • 🚫 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 unwraps components-ready listeners 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, flattening pages/ 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.

πŸš€ Quick Start

Option 1: Run with npx (No Global Install Required)

Scaffold a brand new landing page in seconds:

npx layx-css create my-landing-page
# or
npm create layx my-landing-page

Option 2: Install Globally via npm

Install the CLI globally to have the layx command directly available anywhere on your machine:

npm install -g layx-css

Once installed globally, you can launch the interactive menu by running:

layx

πŸ› οΈ CLI Commands Guide

1. layx create [name]

Scaffolds a new LayX landing page project with all necessary configurations, pre-configured fonts, essential components, and build scripts.

layx create my-landing-page

2. layx add

Extend 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-landing

Note: 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.

3. layx build

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 unwraps components-ready event listeners before bundling.
  • Pages Flattening: Moves pages/*.html directly 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/) to dist/, while strictly excluding the layx/ framework folder.
  • Configurable Copy & Exclude: Customize additional copy targets (copy: ['docs']) or exclude patterns (exclude: ['drafts', '*.log']) in layx.config.mjs or via --copy and --exclude flags.
  • CSS Optimization: Strips unused responsive grid layout classes and minifies CSS without altering modern CSS syntax (@layer, @starting-style).
  • JS Bundling: Uses esbuild for code-splitting, tree-shaking, and ES module bundling into dist/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"

4. layx optimize

Manually compress and optimize images in assets/image/:

layx optimize

6. layx snippets [--global]

Install 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 --global

🎨 Syntax & Design Patterns

LayX uses clean, semantic syntax for common landing page layout needs:

Responsive Container

<container>
  <div class="content">
    <h1>Welcome to LayX</h1>
  </div>
</container>

12-Column Responsive Layout Grid

<layout>
  <div class="x-8">Main content column</div>
  <div class="x-4">Sidebar column</div>
</layout>

Semantic Components

<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>

πŸ“ Project Directory Structure

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

πŸ“š Documentation

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.

🀝 Contributing & Feedback

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.

πŸ“„ License

LayX is open-source software licensed under the MIT License.

About

An extensible CSS framework for modern web development. Combines modular CSS, customizable components, and a powerful CLI for seamless frontend and backend integration.

Topics

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages