Loading...

Getting started

Cssville is a utility-first CSS framework with zero dependencies. It is a single stylesheet, cssville.css, made of small classes that each set one CSS property, so you style elements by adding classes to your HTML instead of writing CSS.

Install

Install the package from npm:

npm install cssville

Then import the stylesheet once, in your app's entry file:

import "cssville/cssville.css";

To try it without a build step, link the stylesheet from the jsDelivr CDN instead:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/cssville/cssville.css" />

Add classes

A class name is a CSS property followed by its value. The property part uses the first three letters of each word, so display becomes dis and flex-direction becomes fle-dir:

.dis-flex { display: flex; }
.fle-dir-column { flex-direction: column; }
.pad-y-4 { padding-top: 8px; padding-bottom: 8px; }

Combine classes on an element to style it:

<div class="dis-flex fle-dir-column gap-4 pad-6 bor-rad-4 box-sha-lg">
  <span class="fon-siz-xl fon-wei-bold">Cssville</span>
  <span class="col-blue-grey-600">Styled with utility classes only.</span>
</div>
CssvilleStyled with utility classes only.

The CSS classes pages in the menu list every class and value, for example display and padding.

Responsive prefixes

Put a breakpoint name in front of a class to apply it only on screens up to that width. The prefixes and their widths are:

xl: 1280pxlg: 1012pxmd: 768pxsm: 544pxxs: 320px

This row becomes a column on screens 768px wide or narrower:

<div class="dis-flex fle-dir-row md-fle-dir-column gap-4">
  <div>Menu</div>
  <div>Content</div>
</div>

Color, background color and border color classes have no prefixed versions.

Hover styles

Add -hover to the end of a class to apply it only while the pointer is over the element:

<a href="/docs" class="col-blue-700 tex-dec-none tex-dec-underline-hover">Read the docs</a>

Hover classes work with prefixes too: md-dis-flex-hover applies on hover on screens up to 768px wide.

Production builds

cssville.css contains every class and is about 3.2 MB. For production, remove the classes you don't use at build time with a tool such as PurgeCSS, as this site does.

© Cssville 2026
Hosted by Vercel.Protected by Cloudback.