- 📖 API reference: Olive CSS API reference
Utility-class CSS, written in Lisp. Tailwind-style classes in your HTML, plain CSS out, and no npm, Node or JavaScript bundler anywhere.
Olive CSS is a utility-class CSS framework: you style a page by putting classes
such as px-4, bg-jeans-blue-500 or md:flex on your elements, the way you
would with Tailwind CSS. What makes it different is where those classes come
from. The whole framework is written in Guile Scheme: every utility family,
value scale, state variant and colour is generated by Lisp code you can read,
override or extend, and the result is one plain .css file that any browser
understands.
In one sentence: Tailwind’s syntax, a Lisp engine, and a stylesheet you own.
<div class="group m-2 px-4 py-6 bg-jeans-blue-500 md:bg-asparagus-300 hover:bg-tawny-700">
<span class="text-white font-bold font-serif group-hover:text-tawny-700">
Hello Olive CSS!
</span>
</div>- Familiar
- If you know Tailwind, you already know the class names. The
reference lists every family Olive CSS emits, variants included:
group-hover,peer-checked,has-*,not-*,aria-*,data-*,print:,motion-safe=/=motion-reduce,rtl:=/=ltr:and container queries. - Hackable
- A build is a Scheme program. Choose the colours, breakpoints, states, variants and scales you need, or add a utility family of your own.
- Self-contained
- One command generates a stylesheet. No package manager, no watcher, no JavaScript runtime is needed to serve it.
- Small in production
- The complete stylesheet is deliberately generous; the tree-shaker keeps only the classes your pages use, usually a few KiB.
- Free software
- MIT licensed, code and documentation alike.
From a checkout, build the complete stylesheet:
guix time-machine --channels=channels.scm -- shell -m manifest.scm -- ./bin/olive-css generate --build fullThe channels file is named because the manifest takes guile-dokgen from the
jointhefreeworld channel; inside that shell, maak build does the same thing.
Load it, and point the tree-shaker at your built site for production:
<link rel="stylesheet" href="/css/olive.min.css">./bin/olive-css tree-shake --directory public --output app.min.cssA build is a Scheme value, not a configuration file. The declaration modules emit the CSS lines of one area each, a build spec names the file it is written to and the palette and feature set it uses, and the tree-shaker keeps only the classes your pages actually use:
The diagram is generated from
resources/diagrams/stylesheet-pipeline.mmd
by maak diagrams. It is drawn light and dark from one source, so it reads on
whichever background you keep your editor in. The same diagram sits in the
;;; Commentary: block of (olive-css builds), so it also reaches the API
reference.
Getting started has the four install routes, a first page and the troubleshooting list. Every command is in the CLI reference.
Olive CSS is packaged for the systems this project is developed and distributed
with. Pick the route that matches the rest of your machine. Every route
installs the Scheme library; the Nix package and the recipes in this repository
also install the olive-css command.
| Route | Command |
|---|---|
| GNU Guix | guix install -L ./guix-jointhefreeworld guile-olive-css (see the channel notes) |
| Nix flake | nix build github:jjba23/nix-jointhefreeworld#guile-olive-css |
| Container | podman build -t olive-css . then podman run --rm -it olive-css --help |
| Distribution package | recipes under packaging/ for Debian, openSUSE and Arch |
Getting started explains what each route installs and how to build from a plain checkout.
The README stops here on purpose. Each topic lives in docs/, with its own
table of contents and a link back to this page:
| Document | What it covers |
|---|---|
| Documentation index | the map of all of it |
| Getting started | install, first page, build and prune a stylesheet |
| Command line | olive-css generate, tree-shake, list and every build |
| Customizing a build | parameters, palettes, variants, your own families |
| Tree shaking | how production CSS shrinks to the classes a site uses |
| Utility reference | every class family and value vocabulary |
| Compared with Tailwind | feature table and the estimated parity |
| Fonts | the three libre families and how to self-host them |
| Development and releases | tasks, tests, packaging, CI and maak release |
The Guile Scheme API - signatures, exports, docstrings - is published at https://jointhefreeworld.org/api-docs/olive-css/index.html. Notable changes live in the changelog.
The author is Spanish, and Spain is the world’s largest producer of olive oil, so naming a libre, hackable, home-grown CSS framework after the olive tree felt only natural. It is a small taste of Spain in your stylesheets - and yes, you may call it olive, oliva or aceituna, it compiles either way. 🫒
- Hygguile
- https://codeberg.org/jjba23/hygguile
- LucidPlan
- https://codeberg.org/jjba23/lucidplan
- WikiMusic
- https://codeberg.org/jjba23/wikimusic
- Iter Vitae
- https://codeberg.org/jjba23/iter-vitae
- Byggsteg
- https://codeberg.org/jjba23/byggsteg
Bug reports, class families and new palettes are all welcome. The quickest loop is:
guix time-machine --channels=channels.scm -- shell -m manifest.scm -- maak test
guix time-machine --channels=channels.scm -- shell -m manifest.scm -- maak buildDevelopment and releases covers the tasks, the test suite and the release process. Small, focused commits with a test for every behaviour, please.
This project follows the jointhefreeworld AI policy. See AI_POLICY.md for the short version. It also follows the jointhefreeworld code of conduct.
Find the backlog and Kanban board at https://lucidplan.jointhefreeworld.org/tickets/olive-css.
MIT License. The source code, the generated stylesheets, the documentation and the examples are all under the same terms; see LICENSE.
If you like my work, please support me by buying me a cup of coffee ☕ so I can continue with a lot of motivation.
___ _ _ ___ ___ ___ / _ \| (_) _____ / __|/ __/ __| | (_) | | \ V / -_) | (__ \__ \__ \ \___/|_|_|\_/\___| \___||___/___/ λ Utility-class CSS for the Free World