AtlatestRenderedmarkdown
Readme

sigil-css

S-expression CSS DSL for Sigil. Write CSS using composable Scheme expressions instead of raw strings.

Usage

(import (sigil css))

;; Generate CSS from S-expressions
(css-render
  (css "body"
    (background-color "#0d0d0d")
    (color "#e8e8e8")
    (font-family "system-ui, sans-serif"))

  (css ".card"
    (background "linear-gradient(180deg, #1a1a1a 0%, #141414 100%)")
    (border "1px solid #2a2a2a")
    (border-radius "8px")
    (padding "1.5rem"))

  (css ".card:hover"
    (border-color "#d4a017")))

Features

  • Composable — CSS rules are values, combine them with standard Scheme functions
  • Themeable — pass color values as variables, swap palettes programmatically
  • Type-safe — malformed CSS caught at generation time, not in the browser
  • No build step — generates CSS strings directly, serve inline or write to file

Dependencies

  • sigil-stdlib

Build

sigil deps install
sigil build
sigil test

License

BSD-3-Clause