palette
Two palettes, named for the bounds of a lattice: join, the light one, and meet, the dark one. Each carries a five-step monochrome scale from background to foreground, and seven hues in spectral order.
import { join, meet, palettes, polarityOf } from "@mariovagomarzal/lattice";
meet.colors.orange; // "#cf8542"
palettes[polarityOf.dark] === meet; // truejoin
Join (∨), the upper bound.
base
#f2ede0surface
#e9e2cfborder
#cfcdc1muted
#6a7268text
#17271fred
#a53c2corange
#b96f28yellow
#85630egreen
#4f7340teal
#2f7565blue
#3d6485purple
#7c4f79meet
Meet (∧), the lower bound.
base
#151b17surface
#1e2620border
#3b3f38muted
#949285text
#e8e1cfred
#d0654eorange
#cf8542yellow
#cba55agreen
#8cab72teal
#72ad9cblue
#7fa8c9purple
#b391b8Syntax roles
A role names a color of the palette, and each port resolves it to whichever polarity it is asked for. The code on this page is highlighted with these.
comment
mutedpunctuation
mutedoperator
mutedvariable
textkeyword
purplefunction
bluestring
greenconstant
orangetype
yellowproperty
tealtag
redPorts
| subpath | export | what it is |
|---|---|---|
| lattice.css | @import | The stylesheet, ready to use. 12 custom properties per polarity, with color-scheme alongside them, and the dark one behind data-theme="dark". |
| palette/css | latticeCss(options?) | The generator behind it, for any other property prefix, scheme attribute, and gate. Gating on media takes prefers-color-scheme instead of the attribute. |
| palette/shiki | shikiThemes | The syntax roles as two Shiki registrations, keyed by scheme for a dual theme setup. |