Skip to content
jjba23Public

About

Utility-class vanilla CSS framework inspired by Tailwind syntax, easy to learn and hack, written in Lisp (Guile Scheme)

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Olive CSS 🫒

./badges/scheme-guile.svg CI ./badges/gnu-guix.svg ./badges/maak.svg ./badges/license-mit.svg

logo.svg

Utility-class CSS, written in Lisp. Tailwind-style classes in your HTML, plain CSS out, and no npm, Node or JavaScript bundler anywhere.

What is Olive CSS?

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>

The short version

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.

Quick start

From a checkout, build the complete stylesheet:

guix time-machine --channels=channels.scm -- shell -m manifest.scm -- ./bin/olive-css generate --build full

The 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.css

How a stylesheet is made

A 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:

resources/diagrams/stylesheet-pipeline.svg

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.

Ways to install

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.

RouteCommand
GNU Guixguix install -L ./guix-jointhefreeworld guile-olive-css (see the channel notes)
Nix flakenix build github:jjba23/nix-jointhefreeworld#guile-olive-css
Containerpodman build -t olive-css . then podman run --rm -it olive-css --help
Distribution packagerecipes under packaging/ for Debian, openSUSE and Arch

Getting started explains what each route installs and how to build from a plain checkout.

Documentation

The README stops here on purpose. Each topic lives in docs/, with its own table of contents and a link back to this page:

DocumentWhat it covers
Documentation indexthe map of all of it
Getting startedinstall, first page, build and prune a stylesheet
Command lineolive-css generate, tree-shake, list and every build
Customizing a buildparameters, palettes, variants, your own families
Tree shakinghow production CSS shrinks to the classes a site uses
Utility referenceevery class family and value vocabulary
Compared with Tailwindfeature table and the estimated parity
Fontsthe three libre families and how to self-host them
Development and releasestasks, 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.

Why the name Olive?

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. 🫒

Projects that use Olive CSS

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

Contributing

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 build

Development 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.

License

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

About

Utility-class vanilla CSS framework inspired by Tailwind syntax, easy to learn and hack, written in Lisp (Guile Scheme)

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages