Skip to content

fvrvz/nostyle-css

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

84 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

NoStyle CSS

A lightweight, utility-first CSS framework with zero JavaScript.

Use it like Tailwind β€” ship it lean. Built for developers who want clean defaults without the bloat.

CI Deploy License: MIT

Documentation Β· Report Bug Β· Request Feature


Features

  • Utility-first β€” Tailwind-like class API (.flex, .gap-4, .text-lg, .rounded-lg, …)
  • Zero JavaScript β€” pure CSS, works everywhere
  • Tree-shakeable β€” PurgeCSS integration strips unused classes in production
  • Modular imports β€” import only base, utilities, or components
  • CSS variables β€” easy theming with --ns-* tokens (light + dark mode)
  • Tiny footprint β€” full build ~8 KB gzip, treeshaken even smaller
  • PostCSS pipeline β€” autoprefixer + cssnano included

Quick Start

Install

npm install @fayso/nostyle-css
# or
pnpm add @fayso/nostyle-css

Import

// Full framework (recommended)
import "@fayso/nostyle-css";

// Or selective imports
import "@fayso/nostyle-css/base"; // reset + CSS variables
import "@fayso/nostyle-css/utilities"; // utility classes
import "@fayso/nostyle-css/components"; // btn, card, badge, input, etc.

CDN

<link
  rel="stylesheet"
  href="https://fvrvz.github.io/nostyle-css/static/css/nostyle.css"
/>

Usage

<div class="container flex flex-col gap-4 p-6">
  <h1 class="text-2xl font-bold tracking-tight">Hello NoStyle</h1>
  <p class="text-muted text-sm">Lightweight and clean.</p>
  <button class="btn btn-primary">Get Started</button>
</div>

What's Included

Category Classes
Layout container, flex, grid, gap-*, items-*, justify-*
Spacing p-*, px-*, py-*, m-*, mt-*, mb-*, mx-auto
Typography text-xs β†’ text-4xl, font-bold, tracking-*, uppercase
Colors text-body, text-muted, text-primary, bg-surface, bg-primary
Borders border, rounded, rounded-lg, shadow, shadow-sm
Components btn, btn-primary, card, badge, input, panel, prose
Responsive md:grid-cols-1, md:hidden

Project Structure

nostyle-css/
β”œβ”€β”€ nostyle/               # CSS framework package
β”‚   β”œβ”€β”€ src/               # Source CSS (base, utilities, components)
β”‚   β”œβ”€β”€ dist/              # Built output
β”‚   └── postcss.config.cjs # PostCSS + PurgeCSS pipeline
β”œβ”€β”€ docs-site-nuxt/        # Documentation site (Nuxt 4 + @nuxt/content)
β”œβ”€β”€ .github/workflows/     # CI/CD (build, deploy, publish)
└── Dockerfile             # Multi-stage Docker build (dev/build/production)

Development

Prerequisites

Setup

git clone https://github.com/fvrvz/nostyle-css.git
cd nostyle-css
pnpm install

Scripts

pnpm run build        # Build NoStyle CSS + Nuxt docs
pnpm run dev          # Start Nuxt docs dev server
pnpm run build:css    # Build only the CSS framework
pnpm run preview      # Preview production docs build
pnpm run generate     # Static generate docs for deployment

Docker

docker build --target build -t nostyle-build .
docker build --target production -t nostyle-prod .
docker run --rm -p 8080:80 nostyle-prod

Tree-shaking

NoStyle uses PostCSS + PurgeCSS to strip unused classes:

cd nostyle
NOSTYLE_PURGE=1 postcss src/index.css -o dist/nostyle.treeshake.css

Or use the built-in script:

pnpm run build:css

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feat/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feat/amazing-feature)
  5. Open a Pull Request

Author

Faraaz Khan β€” @FaraazKhhan

Powered by FaySo πŸš€

License

MIT Β© Faraaz Khan

About

NoStyleCSS: My own CSS utility library. πŸ˜‡

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors