Skip to content

Theme and colours

alireza-selldone edited this page Nov 19, 2026 · 1 revision

Theme and colours

Denimo runs the shared theme switcher (components/theme-switcher/), the same code as the other custom Layouts. Denimo's palettes are in components/ly/ly-theme.ts, the colour family that paints every ground from the palette in components/ly/ly-family.ts, and the brand palette's values for the first paint (with the type and the shape scale) in style/ly-skin.gen.scss, all from the palettes of skins/denimo/skin.json; the one file a merchant edits is components/ly/ly-theme.settings.ts.

One colour family

Denimo is drawn in one colour family: every colour on the page comes from the palette's hue, plus white and the family's near-black. Switching the palette, or picking a custom colour, re-tints the bands, the plates, the lines, the words, the dark top bar and footer, the chips, the map pin and the buttons at once; the browser's own theme colour follows the top bar.

ly-family.ts builds the family from the palette's colour in OKLCH, keeping its hue and capping its chroma, at fixed lightnesses:

Part Light mode Dark mode
Page white L .17
Bands, soft tint L .985 L .195
Cards L .985, or white L .225
Plates under the products L .966 L .26
Deeper tint (drawings, lines) L .925 and .86 L .31
The dark top bar and footer L .24 L .15

Ink, muted words and field edges are then walked until they reach their contrast: ink 7:1 on the deeper tint, muted words 4.6:1, a field's edge 3:1; words on the dark bars use the hue at 7:1. The theme switcher writes only the action colour (--ly-act, --ly-act-deep, --ly-act-on, --ly-act-text) and Vuetify's primary on top, and ly-family.ts also repaints Vuetify's own dialogs, menus and fields from the same family.

Denimo's colours

Denimo paints every action with one colour, Denim #2a4a78 (white words 8.94:1) on every button, chosen state and link; on the dark top bar and footer the family's light shade (--ly-act-dk, #87ace0) marks the hover. The Denim family is built from the seed #2a4a78.

Around it, in the light mode: a white page #ffffff with soft tint bands and cards #f7faff, plates #edf4ff, a deeper tint #d7e8ff, near-black ink #1c222b, muted words #575e69, lines #d6e1f1; a dark top bar and footer in the family's darkest shade #152030 with words #f2f7ff. These are the Denim values: with another palette or a custom colour every one of them takes that colour's hue. In the dark mode, the family's night: the page and header #0c1015, bands and fields #11151b, cards #161c24, plates #1b2533, words #eaf1fa, muted words #b6becb, lines #282e38, the top bar and footer #040b18, the action colour #4c6e9e with white words and links #8eb3e8. Every colour is a token (--ly-…): style/ly-skin.gen.scss holds the brand palette's values (:root is light, html.ly-dark is dark) and ly-family.ts rewrites them for the palette on the page.

The mode from the settings file (light by default) is painted before the first paint on every shop, so the other mode never flashes.

On Denimo's showcase shop

The footer's Theme row

The Theme row sits in the footer, in a band of its own above the legal row, on the family's dark in both modes. It is never in the header. It holds:

  • Colour: Denim, Rust, Olive, Charcoal, Berry (Denim is the default), and Custom colour (any colour from the browser's colour picker; the whole family is built from it and its action colour is made readable in light and dark against Denimo's own surfaces, with a note "Adjusted for readability" when it had to change).
  • Mode: Light or Dark.

One click changes the whole site at once, with no reload: Denimo's colour family, the Kalio base, Vuetify's theme and Selldone's own parts (the buy button, prices, the bag drawer, the checkout sheets, dialogs). The choice is kept in the browser (key denimo-theme; dark mode is the class pr-dark on <html>) and painted before the first paint, so the default never flashes. The arrow keys (and Home / End) move between the swatches.

Light (the default) Dark
Denimo in light mode Denimo in dark mode
Light on a phone Dark on a phone

On your own shop

The visitor switcher is a showcase feature. With themeSwitcher: "showcase" it shows only on the Layout's own showcase shops (listed in showcaseShops in components/ly/ly-theme.ts; Denimo's is Fashioni, 15552). On any other shop it is not shown, nothing is read from or written to the browser's storage, and Denimo shows the theme from the settings file:

export const THEME_SETTINGS: ThemeSettings = {
  palette: "denim",            // one of `denim`, `rust`, `olive`, `charcoal`, `berry`
  // brandColor: "#F5C400",  // any colour; replaces palette (the whole page takes its family)
  mode: "light",             // "light" | "dark"
  themeSwitcher: "showcase", // "showcase" | "on" (your visitors get it) | "off"
  textOnBrand: "auto",       // with brandColor: "auto" (a light brand keeps dark words) | "white"
};
Setting Allowed values
palette denim, rust, olive, charcoal, berry (denim is the brand and the default)
brandColor any "#RRGGBB"; when set it replaces palette, and the whole page (bands, plates, lines, words, the dark bars) takes this colour's family
mode "light" (white and the soft tint; the default) or "dark" (the family's night)
themeSwitcher "showcase" (the visitor switcher shows only on the Layout's own showcase shops; the default), "on" (your visitors get the Theme row in the footer), "off"
textOnBrand only with brandColor: "auto" (a light brand such as yellow keeps its colour, with dark words on it) or "white" (white words; a light colour is darkened)

Every colour is made readable automatically: buttons, links, chosen states and dark mode.

Examples

Change only these lines; leave the rest of the file as it is.

You want Set
"Use the rose theme" palette: "rose"
"Use the yellow theme" No palette is yellow, so use a brand colour: brandColor: "#F5C400", textOnBrand: "auto"
"My brand colour is #F5C400" brandColor: "#F5C400", textOnBrand: "auto"; use textOnBrand: "white" for white words (the colour is then darkened)
"Make it dark" mode: "dark"
"Let visitors switch themes" themeSwitcher: "on"
"Remove the switcher" themeSwitcher: "off" (on your own shop it is already hidden with "showcase")
"Go back to the original colours" remove brandColor, set palette: "denim", mode: "light"

Then build and upload a new version and put it live:

LAYOUT_ID=<your Layout id> PW=<path>/node_modules/playwright/index.js SELLDONE_CLI_SRC=<cli clone> \
  bash scripts/release.sh <new version> desk

See Build and Upload and Go Live.

Contrast

Palette Seed of the family Light: action colour, white words on it Light: link colour on the tint band / the plate Dark: action colour, white words on it Dark: link colour on the card
Denim #2a4a78 #2a4a78 8.94:1 8.54:1 / 8.08:1 #4c6e9e 5.21:1 #8eb3e8 on #161c24 7.97:1
Rust #a4502c #a4502c 5.58:1 5.35:1 / 5.03:1 #a4502c 5.58:1 #f49973 on #231915 7.90:1
Olive #5d6b34 #5d6b34 5.80:1 5.56:1 / 5.29:1 #5d6b34 5.80:1 #a7b87e on #1a1d14 7.97:1
Charcoal #3d4248 #3d4248 10.14:1 9.69:1 / 9.16:1 #676c73 5.29:1 #abb0b8 on #181c21 7.85:1
Berry #8c2f4c #8c2f4c 8.00:1 7.63:1 / 7.19:1 #ad4c67 5.24:1 #f991aa on #23181b 7.93:1

Each figure is worked out from the colours scripts/skin-apply.mjs gives each palette (the same maths as ly-family-core.ts). A custom or brand colour goes through paletteFromColor(), which moves only its lightness until each role reads against the Layout's surfaces; its family is built from the same colour. The contrast audit must pass with TOTAL 0 for every palette and for the custom colours #ffff00, #00ffff and #111111, in light and dark.

Checks

Run these from the repository root after a theme change. They need Playwright; set PW to your install (PW=<path>/node_modules/playwright), because the default path in the scripts is not yours. ".ly .ftr" is Denimo's footer, which every page shows once it is ready. Run one at a time: Selldone limits how many requests one address may send in a minute.

  1. Contrast on the live shop, at desktop and phone width. It must print TOTAL 0:
    PAGES="home=/,category=/<a category>,product=/product/<id>" \
      node components/theme-switcher/tools/contrast-audit.cjs https://<your shop> ".ly .ftr"
    To test one palette and mode, add STORAGE='{"denimo-theme":"{\"palette\":\"denim\",\"mode\":\"dark\"}"}' (this works where the switcher is shown).
  2. Bag drawer, bag page and address sheet. It must print TOTAL 0. It fills a bag in the browser only and blocks every order request. The palette argument is a palette id, or custom:#rrggbb for a custom colour:
    SHOP=<your shop's xapi name> STORAGE_KEY=denimo-theme WAIT=".ly .ftr" CART=".bag-btn" \
      node components/theme-switcher/tools/cart-audit.cjs https://<your shop> denim light
  3. Underlines, boxes and shapes. No line under any word or icon (a post's own links aside), at rest or on hover; photos never on words, icon rows aligned; every edge round (a circle or a capsule), 14 px or 8 px, focus keeping its shape, nothing past the window. Each must print TOTAL 0:
    PAGES="home=/,category=/<a category>,product=/product/<id>" node scripts/underline-check.cjs https://<your shop> ".ly .ftr"
    SHOP=<your shop's xapi name> PAGES="home=/,category=/<a category>,product=/product/<id>" \
      node scripts/box-check.cjs https://<your shop> ".ly .ftr"
    PAGES="home=/,category=/<a category>,product=/product/<id>" node scripts/shape-check.cjs https://<your shop> ".ly .ftr"
    All three default to the showcase shop's pages, so always pass PAGES (and SHOP for the box check, which also opens the menus and the bag).
  4. Colour maths: node components/theme-switcher/theme-color.test.mjs (Node 22.6 or newer).

On Denimo's showcase shop the same checks run with https://denimo.selldone.shop (or the dev server, http://localhost:9170), SHOP=fashioni, PAGES="home=/,category=/activewear-category,product=/product/710122", for each palette in light and dark. scripts/run-checks.sh <base> <log folder> is the full set that produced 1.0.0's test table, one browser at a time; a few of its checks (the ring, corner and circle checks and one card-edge check) come from a shared check kit that is not part of this repository, so on your own copy run the checks above.

Clone this wiki locally