Stylifycss.com - Write CSS faster
Write CSS Faster
Stylify uses CSS-like selectors color:blue, width:640px, margin:0_auto along with variables, components, custom selectors to generate optimized CSS dynamically based on what you write.
- Syntax you already know. Don't waste time studying CSS framework.
- Less switching between HTML/CSS files
- Automagic and Extremely tunned CSS optimization
- Simple CSS Bundles splitting for Layouts/Pages
- Easily Configurable and Extensible
- Prepared components
Why Stylify instead of CSS or inline styles?
They talked about Stylify CSS









































Zero Learning Curve and Faster Coding
Instead of writing CSS and switching between HTML and CSS files use CSS-like selectors. The syntax is similar to CSS. Use _
instead of space and ^
for a quote.
<h1 class="font-size:24px color:blue hover:color:lightblue lg:font-size:32px"> Hello World!🎉 </h1>
Automatic and Extremely Tunned CSS and HTML Optimization
CSS is dynamically generated into CSS files, it is optimized and HTML is mangled. No unused CSS is generated. No CSS purge is needed. No CSS files have to be created. Thanks to inner algorithm for joining selectors, almost no duplicates are generated.
<!-- Production HTML --> <h1 class="a b c d"> Hello World!🎉 </h1>
/* Production CSS */ .a {font-size:24px} .b {color:blue} .c:hover {color:lightblue} @media (min-width: 1024px) { .d{ font-size: 32px } }
Simple CSS Bundles Splitting
CSS bundles can be split into multiple files. It's more efficient than combining CSS manually and it also makes the CSS output smaller.
const bundles = [ // Use Glob syntax to map files { files: [ 'templates/**/*.html' ], outputFile: 'global.css }, // Split CSS for layouts { files: [ 'layout.html' ], outputFile: 'layout.css' }, // And for pages { files: [ 'index.html' ], outputFile: 'index.css' } ];
Intuitive Configuration
Define reusable variables, components and custom selectors to simplify the development. Variables values can be different for each screen. This allows you to change it for dark mode/light mode and desktop/mobile.
const config = { variables: { primary: '#01befe', titleFontSize: '24px', // Variables based on color scheme dark/light dark: { primary: '#fff' }, // Variables based on screen size 'minw640px': { titleFontSize: 38px } }, components: { 'section': 'max-width:1240px margin:0_auto_24px_auto', // Dynamic components 'title(?:--(\\S+))?': ({ matches, variables, helpers, dev }) => { const color = matches[1] ?? '#000'; return `font-size:24px${color ? ` color:${color}` : ''}`; }, }, customSelectors: { '*': 'box-sizing:border-box', 'h1,h2': 'margin-top:0 margin-bottom:12px md:margin-bottom:24px' }, macros: { 'ml:(\S+?)': ({macroMatch, cssProperties}) => { // ml:24px => will create => margin-left: 24px cssProperties.add('margin-left', macroMatch.getCapture(0)); } }, }
Configure Variables, Components and Global Selectors in files, where they are used
Components, Variables and Global Selectors can be defined within a file, where they are used. This encapsulates component CSS and HTML into one file.
<!-- stylify-variables blue: '#01befe' /stylify-variables stylify-components subtitle: 'font-size:24px margin-bottom:12px color:$blue' /stylify-components --> <h2 class="subtitle">Subtitle 1</h2> <h2 class="subtitle">Subtitle 2</h2>
Extend Functionality with Hooks
Hooks can be used extend functionality and modify the output during compilation. There are hooks for Compiler, Bundler and in browser for Runtime.
// This hook example converts px font size // to REM and automatically calculates line height. import {hooks} from '@stylify/stylify'; hooks.addListener('compiler:newMacroMatch', ({selectorProperties}) => { const pixelUnit = selectorProperties.properties['font-size']; if (typeof pixelUnit === 'undefined' || !pixelUnit.endsWith('px')) { return; } const pixelFontSize = Number(pixelUnit.slice(0,-2)); const remFontSize = pixelFontSize / 10; selectorProperties.addMultiple({ 'font-size': `${remFontSize}rem`, 'line-height': `${remFontSize * (pixelFontSize >= 28 ? 1.2 : 1.7)}rem` }); });
Start using Stylify CSS with your favorite tool in a minute.
Use prepared components
Material Theme Builder Integration Guide
Don't study frameworks. Focus on coding!
As a developer you want to code your website easily, quickly and without spending much time in Docs. Frameworks, CSS-in-JS libs, and Preprocessors have a lot of features, that are great, but also makes the development more complex, forces you to study syntax, randomly named selectors and how to use which feature (which you will forget after a week of holiday 🍹).
Stylify focuses on simplicity and uses CSS-like selectors you already know. It's like writing pure CSS directly into the markup without the need of switching between files and figuring out the names for selectors. If you know CSS, you know how to use Stylify.
If you try Stylify, you will find out that preprocessors and short selectors are unnecessary.
Latest Blog Posts

Best practices for utility-first CSS
Learn how to use Utility-First CSS effectively to style your website while avoiding bloated templates and maintenance difficulties.

Using Material Theme from Material Theme Builder in Stylify CSS
Learn how to use generated Material Theme from Material Theme Builder in Stylify CSS and increase your productivity in a minute.

🚀 Code your SvelteKit website faster with Stylify CSS
Style your SvelteKit website faster and intuitively with Stylify. Learn how to define components, variables and get extremely optimized CSS.