π Introduction
Stylify is a library that uses CSS-like selectors to generate optimized utility-first CSS dynamically based on what you write.
Don't study framework. Focus on coding.
β‘ Why Stylify instead of CSS or inline styles?
Because of fewer CSS headaches, faster coding and extremely optimized output.
β¨ Features
- π Define Variables, Components, Custom selectors
- π Add custom macros like ml:2
- π Variables can be injected into css as CSS variables
- π CSS variables can differ for each screen
- π Simplify coding with helpers like
color:lighten(#000,10)
- π Style any device with dynamic screens
- π You can mark areas for which CSS should not be
- π Split bundles for page/layout/component
- π Selectors are minified from long
.color:blue
to short .a
- π No purge needed. CSS is generated only when something is matched
- π Components & Custom selectors are attached to utilities. No duplicated
property:value
- π Hooks can modify CSS or output for example wrap it in CSS layers
- π Mangled (hidden/unreadable) HTML classes in production (if mangled)
- π Try it with frameworks like, Next.js, Astro. SolidJS, Qwik Symfony, Nette, Laravel
- π Works with bundlers like Webpack, Rollup, Vite.js
- π Generated CSS can be used within SCSS, Less, Stylus
- π CSS variables can be exported into external file and reused
![](https://user-images.githubusercontent.com/14016808/132552680-ae877b45-5796-42df-b507-c0f6b9cf4706.png)
π Integrations
Start using Stylify with your favorite tool in a minute.
JavaScript
![](https://stylifycss.com//images/brands/nodejs.svg)
PHP
![](https://stylifycss.com//images/brands/cakephp.png)
π₯ Prepared Copy&Paste Headless Components
![](https://stylifycss.com/images/snippets/components/og-image.jpg)
π¦ Packages
Project |
Status |
Description |
bundler |
![bundler-status](https://img.shields.io/npm/v/@stylify/bundler?color=%2301befe&label=Version&style=for-the-badge) |
A flexible CSS bundler. |
stylify |
![stylify-status](https://img.shields.io/npm/v/@stylify/stylify?color=%2301befe&label=Version&style=for-the-badge) |
Core package. Generates CSS and minifies selectors. |
Compatibility
Environment |
Version |
Note |
Browser |
ES5-compliant browsers, Intersection Observer support is required. |
Stylify doesn't need to be included in the browser. All CSS can be pregenerated on server or during a build. |
Node |
>= 18 |
In case Stylify will be used during an application build or in an SSR application. |
π‘ Examples, Changelog, Issues
- Live examples and tutorials: documentation
- Changelog and release changes: releases
- Have an idea? Found a bug? Feel free to create an issue
π€ Stay In Touch
π· Contributing
Please make sure to read the Contributing Guide before making a pull request.
π License
MIT
Copyright (c) 2021-present, VladimΓr MachΓ‘Δek