classmap

command
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2026 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Command classmap renames classes through a mapping, the way a CSS-modules build does.

classmap -map classes.json < page.html > out.html

The mapping is JSON, original name to generated name. A class with no entry is left alone and reported, because a page referring to a class the stylesheet no longer defines is a bug worth seeing rather than a silent no-op.

One pass is enough, and the reason is worth naming: selectors are matched against the document as it arrived, so renaming a class cannot trigger a rule keyed on the new name. There is no cascade to worry about, and no chance of a rename renaming itself.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL