PHPackages                             brushcss/brushcss - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. brushcss/brushcss

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

brushcss/brushcss
=================

A PHP-native utility-first CSS engine with JIT compilation, plugin marketplace support, and deep framework integration (Hurricane-ready).

v1(3mo ago)21MITPHPPHP ^8.4CI passing

Since Apr 25Pushed 4w ago1 watchersCompare

[ Source](https://github.com/CodeWithSushil/brushcss)[ Packagist](https://packagist.org/packages/brushcss/brushcss)[ Fund](https://buymeacoffee.com/CodeWithSushil)[ GitHub Sponsors](https://github.com/sponsors/CodeWithSushil)[ RSS](/packages/brushcss-brushcss/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (5)Versions (8)Used By (0)

🎨🖌️ BrushCSS
------------

[](#️-brushcss)

[![Tests](https://github.com/CodeWithSushil/brushcss/actions/workflows/tests.yml/badge.svg)](https://github.com/CodeWithSushil/brushcss/actions/workflows/tests.yml)[![Packagist Version](https://camo.githubusercontent.com/67d3d3325afca8a0d405d7306d1d4c739e5c8eb33653821a824bbec2031a0664/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62727573686373732f62727573686373733f7374796c653d666c6174266c6f676f3d636f6d706f736572266c6f676f436f6c6f723d253233666666)](https://camo.githubusercontent.com/67d3d3325afca8a0d405d7306d1d4c739e5c8eb33653821a824bbec2031a0664/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62727573686373732f62727573686373733f7374796c653d666c6174266c6f676f3d636f6d706f736572266c6f676f436f6c6f723d253233666666)[![Packagist Dependency Version](https://camo.githubusercontent.com/8ae134bbb1fb30206fd28995190240a95620bd81ab166af2a09238edc841be35/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f62727573686373732f62727573686373732f7068703f7374796c653d666c6174266c6f676f3d706870266c6f676f436f6c6f723d626c7565266c6162656c3d50485026636f6c6f723d626c7565)](https://camo.githubusercontent.com/8ae134bbb1fb30206fd28995190240a95620bd81ab166af2a09238edc841be35/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f62727573686373732f62727573686373732f7068703f7374796c653d666c6174266c6f676f3d706870266c6f676f436f6c6f723d626c7565266c6162656c3d50485026636f6c6f723d626c7565)[![Packagist License](https://camo.githubusercontent.com/00fa130b9cd4aa776e940f55234624f17c3e6737fbe73d02a27f48f801727d3b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f62727573686373732f62727573686373733f7374796c653d666c6174266c6162656c3d4c6963656e736526636f6c6f723d626c7565)](https://camo.githubusercontent.com/00fa130b9cd4aa776e940f55234624f17c3e6737fbe73d02a27f48f801727d3b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f62727573686373732f62727573686373733f7374796c653d666c6174266c6162656c3d4c6963656e736526636f6c6f723d626c7565)[![Packagist Downloads](https://camo.githubusercontent.com/f8f29fc6535154e3a423bb5f210ed0621ddf10ba1493bd2bb23316c8c706730a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f62727573686373732f62727573686373733f7374796c653d666c6174266c6f676f3d7061636b6167697374266c6162656c3d446f776e6c6f61647326636f6c6f723d626c7565)](https://camo.githubusercontent.com/f8f29fc6535154e3a423bb5f210ed0621ddf10ba1493bd2bb23316c8c706730a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f62727573686373732f62727573686373733f7374796c653d666c6174266c6f676f3d7061636b6167697374266c6162656c3d446f776e6c6f61647326636f6c6f723d626c7565)[![Packagist Stars](https://camo.githubusercontent.com/db953aa9d54bccef5aaf13eaa226482aa22bee2a48400a02ecadef0fa3a8639c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f73746172732f62727573686373732f62727573686373733f7374796c653d666c6174266c6f676f3d676974687562266c6f676f436f6c6f723d253233666666666666266c6162656c3d2546302539462538432539462532305374617273)](https://camo.githubusercontent.com/db953aa9d54bccef5aaf13eaa226482aa22bee2a48400a02ecadef0fa3a8639c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f73746172732f62727573686373732f62727573686373733f7374796c653d666c6174266c6f676f3d676974687562266c6f676f436f6c6f723d253233666666666666266c6162656c3d2546302539462538432539462532305374617273)

A PHP-native utility-first CSS engine with JIT compilation, plugin marketplace support, and deep framework integration (Hurricane-ready).

---

### 🚀 What is BrushCSS?

[](#-what-is-brushcss)

BrushCSS is a backend-driven CSS compiler that scans your PHP/HTML views and generates only the CSS you actually use.

Instead of shipping large static stylesheets, BrushCSS builds CSS on demand (JIT) and integrates directly into your PHP application lifecycle.

---

### ⚡ Key Features

[](#-key-features)

- 🔍 JIT Compilation — Generates CSS only from used classes
- 🧠 View Scanner — Extracts classes from ".php" / ".html" views
- 🔌 Plugin System — Extend utilities and variants easily
- 📦 Composer Ready — Install via Packagist
- 🌪️ Hurricane Integration — Middleware + DI ready
- 🔁 HMR Support — Live CSS reload during development
- 🧱 Grid System (12-column) — Built-in layout engine
- 🎨 Utility-first design system
- 🌐 Remote Plugin Marketplace (CLI "add")

---

### 📦 Installation

[](#-installation)

```
composer require brushcss/brushcss
```

---

### ⚙️ Initialization

[](#️-initialization)

`php vendor/bin/brushcss init`

This creates:

- config/brushcss.php
- public/style.css

---

### 🧪 Build CSS

[](#-build-css)

```
php vendor/bin/brushcss build
```

---

### 👀 Watch Mode (HMR)

[](#-watch-mode-hmr)

```
php vendor/bin/brushcss watch
```

---

### 🔥 Example Usage

[](#-example-usage)

View file ("views/login.php").

```

  Hello BrushCSS

```

**Generated CSS:**

```
.bg-blue-500 { background-color: #3b82f6; }
.p-4 { padding: 16px; }
.mt-5 { margin-top: 20px; }
```

---

### 🧱 Grid System

[](#-grid-system)

```

  Left
  Right

```

---

### 🎨 Utility Classes

[](#-utility-classes)

`Spacing:`

`p-4`, `p-6`, `mt-5`, `mb-2`

`Colors:`

`bg-blue-500`, `text-red-100`

`Layout:`

- `flex`
- `grid`
- `hidden`
- `block`

`Effects:`

`transition`, `duration-300`, `hover:bg-blue-500`

---

### 🔌 Plugin System

[](#-plugin-system)

BrushCSS supports extensible plugins.

**Install plugin:**

```
brushcss add grid
```

**Example plugins:**

- grid system
- typography system
- forms system
- animation system

---

### 🌐 Plugin Marketplace

[](#-plugin-marketplace)

BrushCSS supports a remote registry:

brushcss add typography

*Internally:*

CLI → Registry API → Composer → Activation → Config injection

---

### 🌪️ Hurricane Integration

[](#️-hurricane-integration)

BrushCSS can be used inside the Hurricane PHP framework:

**Middleware compilation**

- Auto-scans views per request
- Generates scoped CSS
- Injects into response pipeline

*BrushCSSMiddleware::class*

---

### ⚡ Architecture

[](#-architecture)

View Files
↓ Class Extractor
↓ JIT Engine
↓ Variant Compiler
↓ Plugin System
↓ CSS Output
↓ `public/css/style.css`

---

🧠 Advanced Features (Roadmap)

### 🔥 JIT Engine Enhancements

[](#-jit-engine-enhancements)

- Incremental builds
- File hashing cache
- Dependency graph tracking

#### ⚡ Variant System

[](#-variant-system)

`hover:`, `md:`, `lg:`, `dark:`

### 🧱 Grid &amp; Layout Engine

[](#-grid--layout-engine)

- 12-column grid
- flex utilities
- responsive breakpoints

### 🌐 Plugin Marketplace

[](#-plugin-marketplace-1)

- versioning
- remote registry
- CLI install/remove/update

### 🔁 HMR WebSocket Server

[](#-hmr-websocket-server)

- instant CSS injection
- no page reload

#### 🧩 Component System (future)

[](#-component-system-future)

- "", "" style UI engine

---

### 🛠️ CLI Commands

[](#️-cli-commands)

brushcss init brushcss build brushcss watch brushcss add brushcss remove brushcss list

---

### 📁 Project Structure

[](#-project-structure)

src/ bin/ config/ plugins/ public/ storage/ tests/

---

### ⚠️ Philosophy

[](#️-philosophy)

BrushCSS is built on one principle:

> “Generate only what you use — nothing more.”

No heavy bundles. No unused CSS. No frontend build dependency.

---

### 🚀 Future Vision

[](#-future-vision)

BrushCSS is evolving into:

> A PHP-native styling compiler ecosystem with plugin marketplace and framework-level integration.

Comparable in concept to modern frontend tooling, but fully backend-driven.

---

### 📜 License

[](#-license)

MIT License

---

### ✨ Author

[](#-author)

Built for modern PHP ecosystems and deep framework integration (Hurricane-ready architecture).

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance89

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 70.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

90d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/14ee8bc204856d2c784a628778d5ae25e5ef14052cce198ca3a7943574832260?d=identicon)[CodeWithSushil](/maintainers/CodeWithSushil)

---

Top Contributors

[![CodeWithSushil](https://avatars.githubusercontent.com/u/94827178?v=4)](https://github.com/CodeWithSushil "CodeWithSushil (53 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (22 commits)")

---

Tags

brushcsscolumnscssflexboxgrid-layoututilitiesutilities-cssdevcssjitutility-firstbrushcss

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/brushcss-brushcss/health.svg)

```
[![Health](https://phpackages.com/badges/brushcss-brushcss/health.svg)](https://phpackages.com/packages/brushcss-brushcss)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

15.0k132.8M916](/packages/barryvdh-laravel-ide-helper)[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k118.7M739](/packages/symfony-maker-bundle)[matthiasmullie/minify

CSS &amp; JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.

2.0k33.1M470](/packages/matthiasmullie-minify)[deptrac/deptrac

Deptrac is a static code analysis tool that helps to enforce rules for dependencies between software layers.

3.0k8.8M207](/packages/deptrac-deptrac)[phing/phing

PHing Is Not GNU make; it's a PHP project build system or build tool based on Apache Ant.

1.2k22.5M915](/packages/phing-phing)[phpstan/extension-installer

Composer plugin for automatic installation of PHPStan extensions

507109.3M11.9k](/packages/phpstan-extension-installer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
