Emma.css Utility Classes

0.16.1 · active · verified Sun Apr 19

Emma.css provides a comprehensive set of Emmet-like utility classes, designed for accelerating front-end development by integrating directly into Sass projects. This library is not a standalone CSS framework but rather a collection of SCSS partials that compile into highly configurable utility classes. Currently at version 0.16.1, it maintains an active release cadence with regular updates and dependency management. Its key differentiators include its tight integration with Sass, allowing for custom prefixes and the toggling of `!important` declarations, and its commitment to modern Sass practices, having recently migrated to `@use`/`@forward` syntax. It focuses on providing atomic CSS classes that map closely to common CSS declarations, similar to how Emmet abbreviations work.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to include Emma.css in a Sass project, configure a custom prefix, and disable `!important` flags in the generated utility classes using modern `@use` syntax.

/* your-project.scss */

// 1. Configure Emma.css variables BEFORE the @use statement
$emma-prefix: "u-"; // Add a 'u-' prefix to all utility classes (e.g., .u-d-b)
$emma-important: false; // Remove !important from generated utility classes

// 2. Import Emma.css using the modern @use syntax
// This will compile all utility classes into your CSS output
@use 'emma.css/scss/all';

// You can then use the generated classes in your HTML, e.g.:
// <div class="u-d-fx u-m-a u-p-md">Hello Emma!</div>

view raw JSON →