§27 / DEVELOPERS
REF: TG–DOC–27 · REV. 1.7
CSS tokens
snippets/css-variables.liquid, which is rendered in the <head> of layout/theme.liquid before assets/base.css. Their values come from the theme settings. base.css and the section and snippet stylesheets read them with var().TANGENT 1.7 / SHOPIFY OS 2.0 / UPDATED 2026-10-19
The defaults listed below are the schema defaults in config/settings_schema.json. Each preset sets its own values in config/settings_data.json.
Color tokens
Each color scheme in Theme settings > Colors becomes a class, .color-<scheme id>. The first scheme is also applied to :root. Sections apply a scheme with that class.
| Token | Scheme setting |
|---|---|
--color-background | Background |
--color-background-rgb | Background, as space-separated R G B channels |
--gradient-background | Background gradient, or Background when no gradient is set |
--color-foreground | Text |
--color-foreground-rgb | Text, as space-separated R G B channels |
--color-muted | Secondary text |
--color-surface | Panel background |
--color-border | Borders |
--color-button | Primary button background |
--color-button-label | Primary button label |
--color-secondary-label | Secondary button label |
--color-accent | Badge background |
--color-on-accent | Badge text |
Each scheme also sets color-scheme: dark when its background lightness is below 45, and light otherwise.
The -rgb tokens work with the space-separated rgb() syntax:
1.my-overlay {2 background: rgb(var(--color-foreground-rgb) / 0.08);3}Dark mode
Dark mode uses the Dark mode setting (dark_mode: off, auto, toggle) and the Dark scheme setting (dark_scheme). When dark mode is not off, the dark scheme's values are applied to :root and to every light scheme (background lightness 80 or above) in two cases:
:root[data-theme='dark']is set.- The device prefers dark (
@media (prefers-color-scheme: dark)) and:rootdoes not havedata-theme='light'.
Dark mode also sets --media-bg to the dark scheme's panel background and color-scheme: dark. Darker or colored schemes keep their own colors.
With toggle, a [data-theme-toggle] button in the header sets data-theme on <html> and stores the choice in localStorage under tangent:theme. An inline script in layout/theme.liquid restores it before the page renders.
Typography tokens
| Token | Source | Schema default |
|---|---|---|
--font-heading | Heading font family and fallbacks (type_heading_font) | Archivo Narrow |
--font-heading-weight | Heading font weight | 700 |
--font-heading-style | Heading font style | normal |
--font-body | Body font family and fallbacks (type_body_font) | Archivo Narrow |
--font-body-weight | Body font weight | 400 |
--font-body-weight-medium | Body font weight + 100 | from the font |
--font-body-weight-bold | Bolder body weight | from the font |
--font-body-style | Body font style | normal |
--heading-scale | heading_scale / 100 (range 70–140 %) | 1 |
--heading-case | heading_case (none, uppercase) | uppercase |
--heading-tracking | heading_tracking / 100, in em (range −5 to 10 %) | 0em |
--heading-line-height | heading_line_height / 100 (range 80–130 %) | 1 |
--body-size | body_scale, in px (range 13–18) | 15px |
--label-case | label_case (none, uppercase) | uppercase |
--button-case | button_case (none, uppercase) | uppercase |
Layout tokens
| Token | Source | Schema default |
|---|---|---|
--page-width | page_width (1200px, 1440px, 1600px, or full = 100vw) | 1600px |
--gutter | clamp(16px, 3vw, <page_margin>px); page_margin range 8–64 | clamp(16px, 3vw, 48px) |
--section-space | section_spacing / 100 (range 50–150 %) | 1 |
--grid-gap | grid_gap, in px (range 0–32) | 12px |
--card-info-gap | card_info_spacing, in px (range 8–32) | 16px |
--header-height | 60px in CSS; replaced at runtime (see below) | 60px |
--section-space scales section padding in base.css: calc(96px var(--section-space)) on desktop and calc(64px var(--section-space)) below 750 px.
Shape and media tokens
| Token | Source | Schema default |
|---|---|---|
--radius-button | button_radius, in px (range 0–40) | 2px |
--radius-input | input_radius, in px (range 0–20) | 2px |
--swatch-radius | swatch_shape: square = 2px, circle = 50% | 50% |
--media-bg | media_background (Product image background) | #F2F2F2 |
--card-ratio | card_ratio (adapt = auto, 1, 0.8, 0.667) | 0.8 |
--card-fit | card_image_fit (cover, contain) | cover |
--card-ratio and --card-fit are emitted but not read by any stylesheet on this branch. Product cards set their own --ratio and the media--contain class in snippets/product-card.liquid.
Motion tokens
1:root {2 --ease: cubic-bezier(0.2, 0.7, 0.1, 1);3 --duration: 0.34s;4}These are the only global motion tokens. base.css uses var(--ease) and var(--duration) for transitions, for example the scroll reveal (opacity and transform over 0.8 s with var(--ease)).
The Motion settings control which effects are on:
| Setting | Effect |
|---|---|
Reveal sections on scroll (animations_reveal) | Adds reveal-on to <body> |
Slow zoom on banners (animations_zoom) | Adds zoom-on to <body>; hero images use the hero-drift animation |
Smooth page transitions (page_transitions) | Enables cross-document view transitions in layout/theme.liquid |
Reduced motion
Motion effects in base.css sit inside @media (prefers-reduced-motion: no-preference). For shoppers who prefer reduced motion, base.css shortens all animations and transitions:
1/* assets/base.css */2@media (prefers-reduced-motion: reduce) {3 *:not(.marquee__track),4 *::before,5 *::after {6 animation-duration: 0.01ms !important;7 animation-iteration-count: 1 !important;8 transition-duration: 0.01ms !important;9 scroll-behavior: auto !important;10 }11}The JavaScript checks the same preference through window.Tangent.prefersReducedMotion(): smooth scrolling becomes instant, view transitions are skipped, slider autoplay does not start, and <video-media> does not autoplay.
Tokens set at runtime
| Token | Set by | Value |
|---|---|---|
--header-height | <site-header> (theme.js) on :root | Height of .header in px, updated on resize |
--above-header | <site-header> on :root | Offset of the header section from the top (the announcement bar) |
--announcement-height | sections/announcement-bar.liquid on :root | 36px; used before --above-header is set |
--sticky-buy-height | <sticky-buy> (product.js) on :root | Height of the sticky add-to-cart bar |
Component-level properties such as --overlay (hero, slideshow, collage), --pos (<compare-slider>) and --from / --to (<price-range>) are set inline on their elements.
Overriding tokens
Override a token on :root or on a scheme class in your own stylesheet, loaded after base.css:
1:root {2 --ease: cubic-bezier(0.4, 0, 0.2, 1);3}4.color-scheme-2 {5 --color-border: #d6d6d6;6}Values set in theme settings are regenerated on every page load, so change them in the theme editor where a setting exists.
Last updated for Tangent 1.7