Makes CSS nicer to look at in terminal environments.
Works with Clojure, ClojureScript(Node), Babashka, and Jolt
Setup • Usage • Themes • Developing

| Period | Stage | Release |
|---|---|---|
| 2026 Mar-Nov | Experimental | - |
| 2026 Nov-present | Alpha | 0.1.0 |
If using with Babashka, requires v1.13.222 or higher
If using with Jolt, requires v0.8.24 or higher
Add as a dependency to your project:
Deps:
design.kushi/cssyes {:mvn/version "0.1.0"}
Leiningen:
[design.kushi/cssyes "0.1.0"]
Require it:
(require '[cssyes.core :refer [beautify print-css]])
Or import into your namespace:
(ns myns.core
(:require
[cssyes.core :refer [beautify print-css]]))
Using a tool without Maven support? See Consuming cssyes as a git dependency.
cssyes.core/beautify expects a string of valid CSS and returns a formatted string, tagged with ANSI SGR codes. The SGR codes will activate syntax highlighting in terminal/console environments.
(beautify ".btn{color:red;background-color:blue;&:hover{color:gold;}}")
Output (without color):
.btn {
color: red;
background-color: blue;
&:hover {
color: gold;
}
}
print-css prints the formatted string and returns nil.
(print-css ".foo{color:red;}")
(print-css ".foo{color:red;}" {:theme cssyes.themes/neutral})
| Key | Default | Description |
|---|---|---|
:theme | cssyes.themes/monokai | Map of token to color |
:color-variant | nil | Use one variant for every base color in the theme. See Color variants |
:indentation | 2 | Spaces per nesting level |
:align-values? | true | Align (left-justify) values within a block |
:supports-color | nil | A supports-color :context map, for mocking the terminal in tests |
Presets in cssyes.themes:
monokai, the default.neutral, which colors only punctuation and comments, in gray.cssyes colors text with sugar, so each base color adapts to the terminal's background. :red is a lighter red on a dark background, a darker red on a light background, and a medium red when the background is not detected. Colors are downsampled to the color level the terminal supports, and output has no color codes when the terminal supports none.
| Token | Colors |
|---|---|
:selectors | Selectors and at-rule text: .foo, @media |
:ampersands | & |
:pseudo-colons | : and :: in selectors and at-rules |
:curly-brackets | { } |
:round-brackets | ( ) |
:properties | Property names: color |
:colons | : after a property |
:values | Plain values and hex colors: silver, #fff |
:strings | Quoted strings: "cssyes" |
:numbers | Numbers and units: 10px, 1.5, 50% |
:vars | Custom properties: --gap |
:cssfn | Function names: calc, color-mix |
:commas | , |
:semi-colons | ; |
:comments | /* ... */ |
A token's color is any color that sugar's :color option takes.
Base colors, which adapt to the terminal's background:
:red:orange:yellow:olive:green:cyan:blue:purple:magenta:gray
:black, :white, fixed variants such as :dark-blue or :soft-red, hex strings such as "#ff5f00", rgb vectors such as [255 95 0], and 8-bit ids such as 202 do not adapt.
:neutral, or a missing token, prints uncolored.
View sugar's color docs, which list every variant.
:color-variant puts the same variant on every base color in the theme, in place of the one sugar picks for the terminal's background. With :extra-dark, :blue becomes :extra-dark-blue.
(print-css ".foo{color:red;}" {:theme cssyes.themes/monokai
:color-variant :extra-dark})
It takes one of :shadow, :extra-dark, :dark, :medium, :light, :extra-light or :highlight. Any other value leaves the theme unchanged. :black, :white, fixed variants, hex, rgb and 8-bit colors are not changed.
On a terminal with 256 colors, neighboring variants such as :extra-dark and :shadow can round to the same color.
(def my-theme
{:selectors :blue
:ampersands :blue
:pseudo-colons :blue
:properties :green
:strings :green
:curly-brackets :gray
:round-brackets :gray
:colons :gray
:commas :gray
:semi-colons :gray
:comments :gray})
(print-css ".foo{color:red;}" {:theme my-theme})
Available dev tasks via bb.edn:
bb test # Clojure tests
bb test:bb # Babashka tests
bb test:jolt # Jolt tests
bb test:cljs # ClojureScript tests on Node (run npm install first)
bb test:all # all of the above
bb test:visual # print sample CSS in each preset theme and color variant
bb ci # run the tests and build the jar
bb install # install the jar to ~/.m2
bb docs:readme # after tagging a release: update the version numbers in this README
bb docs:git-deps # after tagging a release: regenerate doc/git-deps.md
After tagging a release (for example git tag v0.2.0), run both docs tasks:
bb docs:readme updates the version numbers in the Setup section of this README to match the tag.bb docs:git-deps regenerates doc/git-deps.md from bb/tasks/git-deps.template.md with the tag and its commit SHA.Commit both files and push.
Issues for bugs, improvements, or features are very welcome. Please file an issue for discussion before starting or issuing a PR.
Copyright © 2026 Jeremiah Coyle
Distributed under the Eclipse Public License 2.0
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |