CSS custom properties
Definition
CSS custom properties are variables declared in a stylesheet or inline on an element and read back with var(). They inherit through the cascade and can be reassigned at any depth, so one selector can retheme everything beneath it. Shopify themes generate a set from theme settings, and markup is free to add more per section, per block or per element.
Documented at MDN, using CSS custom properties.
How We've Used It
Custom properties are how a section stays one section. A block carries its own type scale, spacing and colors as properties on its own wrapper, so a merchandiser typesetting an editorial row doesn't need a new section and we don't need a class for every combination of choices. At storefront scale it's the same move: one Liquid flag puts a class and a palette on the body element, and a sub-brand retheme becomes a stylesheet concern instead of a branch inside every section. The token layer is also the seam we use on a purchased theme, where brand faces and a per-product button color are appended to the theme's own generated variables in the one snippet every layout renders.
Builds Using It
- Audience-targeted announcement bar with sticky-height measurement — LUS Brands
- Arched-label icon grid PDP block — LUS Brands
- Adults/Kids audience-switching header with automatic menu swap — LUS Brands
- DE Hero: art-directed image/video hero with layout controls — LUS Brands
- Shop-by-category carousel with collection-aware card fallbacks — LUS Brands
- Size-pill variant picker and quick add-to-cart inside product grids — Three Ships
- Hero slide content renderer with per-breakpoint typography controls — Nudestix
- Kids featured collection: a custom element that builds its Swiper on approach and wraps the theme's own product cards — LUS Brands
- Press / trust logo strip with scroll-snap carousel and no JavaScript — LUS Brands
- Mega-menu header with separate mobile menu and image blocks — Three Ships
- Mobile sticky add-to-cart bar mirrored from the real product form — LUS Brands
- PDP content accordion that borrows the premium theme's collapsible contract — Three Ships
- Homepage exclusive-offers rail with caption heights equalized in idle time — Nudestix
- Themed host section for Shopify Forms app blocks — Three Ships
4 further gated builds use it; their pages follow.
Related Entities
- Liquid section schema and settings — where the values a merchandiser picks come from.
- Liquid snippets — the shared renderers these properties scope.
- Theme app extension blocks — styling app UI through the properties it exposes.
- Custom elements — the components reading them at runtime.