Hype Cart

Cart drawer CSS variables

Updated Sep 10, 20265 min read

Every visual decision in the Hype Cart Drawer drawer is a --hype-cd-* custom property on the drawer's host. Set them on hype-cart-drawer (or an ancestor) from theme CSS, or in the editor's Advanced panel, Custom CSS. Values set in the Design panel land inline on the host and beat inherited values; override those with ::part().

Templates

template is one of three permanent ids, carried on the host as an attribute:

idNameWhat it is
baseBoldThe built-in look: white paper, near-black ink, the shop's accent, the theme's font
noirNoirDark paper, bone ink and buttons, modern sans, inverted knob, brighter tints, deep shadows
atelierAtelierBone paper, green ink, serif faces, 2px geometry, tracked small caps, hairline header rule, a paper grain
hype-cart-drawer[template='atelier'] { --hype-cd-panel-texture-opacity: 0; }

Switching template replaces the merchant's colors and fonts. Discard undoes it.

Panel style

Panel style (General panel) is Flush — against the viewport edge, square corners — or Floating, which leaves --hype-cd-float-gap on the right, top and bottom and rounds every corner with --hype-cd-panel-radius. Phones are always flush and full screen. The host carries the value as a panel attribute: hype-cart-drawer[panel='floating'].

Typefaces

Two selects in the Design panel:

SettingValuesSets
FontTheme font, Modern sans, Geometric sans, Humanist sans, Editorial serif, Classic serif, Monospace, Custom, Google Font--hype-font (body)
Heading fontSame as body, or any of the above--hype-cd-font-heading

Theme font and Same as body set nothing, leaving the body on the storefront's own font and the headings on the body face. The named stacks are system fonts and download nothing. Google Font takes a family name as it appears on fonts.google.com; the drawer adds one Google Fonts link per family, weights 400–700, display: swap, plus preconnects — the one setting that makes the storefront fetch a font. Custom (loaded by your theme) takes a family list exactly as your theme declares it, "Brand Sans", sans-serif, capped at 200 characters, and your theme must already load that face.

The heading face draws the drawer title and the upsell heading.

Design panel tokens to variables

The Design panel's tokens become --hype-* properties on the host, which the drawer maps onto its own contract:

Panel control--hype-*Drawer variables it feeds
Theme (color)--hype-ac + tint scale-primary, -tint, -tint-strong, -savings, -badge-bg, -badge-color, -banner-bg, -selection, -focus, CTA default
Card background--hype-card-bg-bg, the base every neutral mixes toward
Border--hype-card-border-border
Text--hype-text-text, and -text-2, -muted, -faint, -surface-2, -surface-3, -border-strong derived from it
Title--hype-heading-heading
Button background--hype-cta-bg-cta-bg
Button text--hype-cta-color-cta-color
Corner radius--hype-card-radius, --hype-cta-radius-card-radius, -cta-radius, -control-radius / -thumb-radius at 0.7×
Spacing--hype-card-padding-pad-x
Title size--hype-title-size-title-size

Accent tints mix toward the card background, not white, so a tinted upsell card stays part of a dark drawer.

Paper and ink

VariableBaseControls
--hype-cd-bg#ffffffPanel background
--hype-cd-text#161616Body text
--hype-cd-headingvar(--hype-cd-text)Title, subtotal value
--hype-cd-text-2text 78%Icons, close button, secondary copy
--hype-cd-mutedtext 68% (74% Atelier)Variant lines, row labels, footnotes
--hype-cd-fainttext 56% (64% Atelier)Struck prices, text marks, remove icon
--hype-cd-border#ebeae7Hairlines, dividers, thumbnail border
--hype-cd-border-strongtext 16%Inputs, stepper, secondary buttons
--hype-cd-surface-2text 4.5%Count badge, discount chip, hover fills
--hype-cd-surface-3text 8%Goal track, locked goal icons
--hype-cd-control-bgvar(--hype-cd-bg)Input, stepper, select backgrounds
--hype-cd-knob#ffffffToggle knob
--hype-cd-overlayrgba(22, 22, 22, 0.5)Overlay behind the panel

Percentages are a color-mix() toward --hype-cd-bg; browsers without it get fixed greys.

Accent-driven

VariableBaseControls
--hype-cd-primaryvar(--hype-ac)Goal fill and marker, unlocked icons, shield icon
--hype-cd-on-accent#ffffffText on --hype-cd-primary
--hype-cd-tintvar(--hype-ac-05)Upsell card, protection shield tile
--hype-cd-tint-strongvar(--hype-ac-12)Focus halo, next-goal halo
--hype-cd-savingsvar(--hype-ac)Savings amounts, "to go" note
--hype-cd-selectionvar(--hype-ac-30)Text selection
--hype-cd-focusvar(--hype-ac)Focus outlines, field border, caret
--hype-cd-badge-bgvar(--hype-ac-10)SAVE and offer badges
--hype-cd-badge-colorvar(--hype-ac)Badge text
--hype-cd-banner-bgvar(--hype-ac-10)Announcement bar, if its colors are empty
--hype-cd-banner-textvar(--hype-cd-text)Its text
--hype-cd-banner-timervar(--hype-cd-heading)Its countdown

Buttons

VariableBaseControls
--hype-cd-cta-bgvar(--hype-cta-bg, var(--hype-ac))Checkout, launcher, upsell Add pill
--hype-cd-cta-colorvar(--hype-cta-color, #ffffff)Their text
--hype-cd-cta-radiusvar(--hype-cta-radius, 12px)Checkout corners
--hype-cd-cta-height54pxCheckout height
--hype-cd-cta-size15pxCheckout, Apply and Add size
--hype-cd-cta-weight600Their weight
--hype-cd-cta-transformnoneTheir text-transform
--hype-cd-cta-tracking0Their letter-spacing
--hype-cd-cta-shadow0 12px 24px -14px var(--hype-ac-glow)Checkout and launcher shadow
--hype-cd-cta-shadow-hover0 16px 30px -14px var(--hype-ac-glow)On hover
--hype-cd-secondary-bgvar(--hype-cd-surface-2)The Apply button
--hype-cd-secondary-colorvar(--hype-cd-text)Its text
--hype-cd-secondary-bordervar(--hype-cd-border-strong)Its border
--hype-cd-pill-radius999pxAdd pill, carousel pager

Geometry

VariableBaseControls
--hype-cd-width420px (a setting)Panel width, desktop
--hype-cd-pad-xvar(--hype-card-padding, 24px)The horizontal gutter
--hype-cd-section-pad-xvar(--hype-cd-pad-x)Gutter of one section
--hype-cd-panel-radius16px (Atelier 4px)Panel corners, floating only
--hype-cd-float-gap12pxGap from the edges when floating
--hype-cd-panel-shadowSoft outward shadowThe panel's shadow
--hype-cd-card-radiusvar(--hype-card-radius, 14px)Upsell card
--hype-cd-control-radiusradius × 0.7Inputs, stepper, Apply, shield
--hype-cd-badge-radius999pxBadges, chips, count badge
--hype-cd-thumb-size68pxLine-item thumbnail
--hype-cd-thumb-radiusradius × 0.7Thumbnail corners
--hype-cd-thumb-fitcoverThumbnail object-fit; contain on white
--hype-cd-thumb-padding0pxThumbnail inner padding
--hype-cd-thumb-bgvar(--hype-cd-surface-2)Thumbnail frame
--hype-cd-thumb-bordervar(--hype-cd-border)Thumbnail frame border
--hype-cd-row-gap18pxVertical padding of a line item
--hype-cd-divider1px solid var(--hype-cd-border)Every hairline; none removes all
--hype-cd-header-rulenone (Atelier: the divider)Rule under the header
--hype-cd-stepper-height32pxQuantity stepper
--hype-cd-control-height44pxDiscount field, Apply, Continue
--hype-cd-trust-icon-size15pxTrust strip icons
--hype-cd-trust-iconvar(--hype-cd-text-2)Trust strip icon color
--hype-cd-mark-height22pxPayment-mark height
--hype-cd-mark-radius0pxPayment-mark corners
--hype-cd-mark-bordertransparentPayment-mark frame
--hype-cd-mark-gap6pxSpace between payment marks
--hype-cd-marks-aligncenterjustify-content of the mark row

Type

VariableBaseControls
--hype-fontinherit (a setting)Body face
--hype-cd-font-headinginherit (a setting)Title and section headings
--hype-cd-title-sizevar(--hype-title-size, 16px)Drawer title
--hype-cd-heading-weight600Title and section headings
--hype-cd-heading-transformnoneTheir case
--hype-cd-heading-tracking-0.01emTheir tracking
--hype-cd-body-size14pxItem titles, prices, subtotal label
--hype-cd-small-size12.5pxVariants, summary rows, footnotes
--hype-cd-label-size10.5pxMicro-caps: trust badges, marks
--hype-cd-label-weight600Their weight
--hype-cd-label-transformuppercaseTheir case
--hype-cd-label-tracking0.07emTheir tracking
--hype-cd-item-title-weight500Product names
--hype-cd-price-weight600Prices and subtotal
--hype-cd-badge-tracking0.04emBadges and chips
--hype-cd-numerals"tnum" 1, "lnum" 1Every amount

Paper texture

VariableBaseControls
--hype-cd-panel-texturenoneA url() tiled over the panel
--hype-cd-panel-texture-opacity0 (Atelier 0.16)Strength of that layer
--hype-cd-panel-texture-blendmultiplyIts mix-blend-mode; screen on dark paper

Related articles

Still need help?

Start a chat and we'll pick it up right here.