Hype Cart

Style the cart drawer with CSS

Updated Nov 9, 20267 min read

On this page (10)

Use CSS to change what the Design panel doesn't cover. For colors and fonts without code, see Templates, colors and fonts.

Add your CSS

  1. Open Advanced in the cart editor.
  2. Add your code to Custom CSS. Set variables on hype-cart-drawer, and style parts with hype-cart-drawer::part(name).
  3. Click Save.
  4. Check the result on your store. The editor preview doesn't show Custom CSS.

Variables

Defaults are for the Bold template. Noir, Atelier and the Design panel change some of them. A variable you set overrides all three, except where the table says otherwise.

Colors

VariableChangesDefault
--hype-cd-bgDrawer background#ffffff
--hype-cd-textMain text#161616
--hype-cd-headingDrawer title, subtotal amount and bold words in the progress bar headlineThe text color
--hype-cd-text-2Close button, quantity buttons and trust badge icons78% of the text color
--hype-cd-mutedVariant names, summary rows, footnotes and trust badge labels68% of the text color
--hype-cd-faintCrossed-out prices and the remove icon56% of the text color
--hype-cd-borderDivider lines and product image borders#ebeae7
--hype-cd-border-strongBorders of the discount field, quantity stepper and Apply16% of the text color
--hype-cd-surface-2Discount chips, Apply and hover backgrounds4.5% of the text color
--hype-cd-surface-3Item count, progress bar track and locked goal icons8% of the text color
--hype-cd-control-bgBackgrounds of the discount field and quantity stepperThe drawer background
--hype-cd-knobShipping protection toggle knob#ffffff
--hype-cd-overlayDimmed page behind the drawerrgba(22, 22, 22, 0.5)
--hype-cd-primaryProgress bar fill, unlocked goal icons, shipping protection icon and gift pricesThe accent color
--hype-cd-on-accentIcons and text on --hype-cd-primary#ffffff
--hype-cd-tintProduct recommendations and Free gifts cards, and the shipping protection icon background5% of the accent color
--hype-cd-tint-strongGlow around the focused discount field and the next goal12% of the accent color
--hype-cd-savingsSavings amounts and the "to go" noteThe accent color
--hype-cd-selectionSelected text30% of the accent color
--hype-cd-focusKeyboard focus outlines and the focused discount fieldThe accent color
--hype-cd-badge-bg, --hype-cd-badge-colorBackground and text of the Save badge on products and the badge on recommended products10% of the accent color, the accent color
--hype-cd-banner-bg, --hype-cd-banner-text, --hype-cd-banner-timerAnnouncement bar background, text and countdown, unless set in the module10% of the accent color, the text color, the title color

Buttons

VariableChangesDefault
--hype-cd-cta-bg, --hype-cd-cta-colorBackground and text of the checkout button, launcher and Add buttonsThe accent color, #ffffff
--hype-cd-cta-radiusCheckout button corners12px
--hype-cd-cta-heightCheckout button height54px, 50px on phones
--hype-cd-cta-sizeCheckout button text size15px
--hype-cd-cta-weightText weight of the checkout and Add buttons600
--hype-cd-cta-transform, --hype-cd-cta-trackingCase and letter spacing of the checkout, Apply, Continue shopping and Add buttonsnone, 0
--hype-cd-cta-shadowShadow of the checkout button and launcherA soft glow in the accent color
--hype-cd-cta-shadow-hoverCheckout button shadow on hoverA soft glow in the accent color
--hype-cd-secondary-bg, --hype-cd-secondary-color, --hype-cd-secondary-borderBackground, text and border of Apply and Continue shopping--hype-cd-surface-2, --hype-cd-text, --hype-cd-border-strong
--hype-cd-pill-radiusCorners of Add buttons, the recommendations carousel arrows and the gift badge999px

Sizes and spacing

VariableChangesDefault
--hype-cd-widthDrawer width on desktop. Drawer width overrides CSS, so set it there420px
--hype-cd-pad-xLeft and right padding of the drawer24px
--hype-cd-section-pad-xLeft and right padding of modules in the Top bar--hype-cd-pad-x
--hype-cd-panel-radiusDrawer corners with Floating16px
--hype-cd-float-gapGap from the screen edges with Floating12px
--hype-cd-panel-shadowDrawer shadow, on Bold onlyA soft shadow
--hype-cd-card-radiusCorners of Product recommendations and Free gifts cards14px
--hype-cd-control-radiusCorners of the discount field, Apply, quantity stepper and shipping protection icon70% of the corner radius
--hype-cd-badge-radiusCorners of badges, discount chips and the item count999px
--hype-cd-thumb-sizeProduct image size in Products in cart68px
--hype-cd-thumb-radiusProduct image corners70% of the corner radius
--hype-cd-thumb-fitHow product images fit: cover crops, contain shows the whole imagecover
--hype-cd-thumb-paddingSpace inside the product image0px
--hype-cd-thumb-bg, --hype-cd-thumb-borderProduct image background and border--hype-cd-surface-2, --hype-cd-border
--hype-cd-row-gapSpace above and below each product18px, 16px on phones
--hype-cd-dividerEvery divider line. none removes them1px solid in the border color
--hype-cd-header-ruleLine under the headernone
--hype-cd-stepper-heightQuantity stepper height32px
--hype-cd-control-heightHeight of the discount field, Apply and Continue shopping44px
--hype-cd-trust-icon-size, --hype-cd-trust-iconTrust badge icon size and color15px, --hype-cd-text-2
--hype-cd-mark-height, --hype-cd-mark-radius, --hype-cd-mark-borderPayment logo height, corners and border color22px, 0px, transparent
--hype-cd-mark-gap, --hype-cd-marks-alignSpace between payment logos, and their alignment6px, center

Text

VariableChangesDefault
--hype-fontBody font. Applies only while Font is Theme fontYour store's font
--hype-cd-font-headingFont of the title and module headings. Applies only while Heading font is Same as bodyThe body font
--hype-cd-title-sizeDrawer title size16px
--hype-cd-heading-weight, --hype-cd-heading-transform, --hype-cd-heading-trackingWeight, case and letter spacing of the title and module headings600, none, -0.01em
--hype-cd-body-sizeProduct names, prices and the subtotal label14px
--hype-cd-small-sizeVariant names, summary rows and footnotes12.5px
--hype-cd-label-size, --hype-cd-label-weight, --hype-cd-label-transform, --hype-cd-label-trackingTrust badge labels10.5px, 600, uppercase, 0.07em
--hype-cd-item-title-weightProduct name weight500
--hype-cd-price-weightPrice and subtotal weight600
--hype-cd-badge-trackingLetter spacing of badges and chips0.04em
--hype-cd-numeralsNumber style of amounts"tnum" 1, "lnum" 1

Background texture

VariableChangesDefault
--hype-cd-panel-textureAn image tiled over the drawer backgroundnone
--hype-cd-panel-texture-opacityHow strong the image is0
--hype-cd-panel-texture-blendHow the image blends with the backgroundmultiply

Parts

A part styles one element directly.

PartWhat it is
launcher, overlayThe floating cart button and the dimmed page behind the drawer
drawer, header, title, count, closeThe drawer, its header, the title, the item count and the close button
announcement, timerAnnouncement bar and its countdown
goals, goal-headline, goal-track, goal-fill, goal-node, goal-iconProgress bar: the module, headline, track, filled part, each goal and its icon
trust, trust-badgeTrust badges: the row and one badge
item, item-thumb, item-title, item-variant, item-price, item-removeProducts in cart: one product, its image, name, variant, price and remove button
stepper, stepper-decrement, stepper-count, stepper-incrementQuantity stepper: the whole control, minus button, number and plus button
gift-badgeThe badge on a free gift in Products in cart
upsell, upsell-heading, upsell-card, upsell-addProduct recommendations: the module, heading, one product and its Add button
gifts, gifts-heading, gift-card, gift-image, gift-title, gift-price, gift-variant, gift-addFree gifts: the module, heading, one gift, its image, name, price, variant menu and Add button
protection, toggle-track, toggle-knobShipping protection: the module and its toggle
field, apply, chipDiscount code: the field, Apply and one applied code
summary-row, subtotal, subtotal-value, summary-noteSummary: one row, the subtotal line, its amount and Note under the subtotal
checkoutCheckout button
marks, markPayment logos: the row and one logo
footnoteThe footnote under Checkout button or Payment logos
custom-text, custom-htmlCustom text and Custom HTML

Example

This makes the checkout button taller and rounder, and shows whole product images:

hype-cart-drawer {  --hype-cd-cta-height: 60px;  --hype-cd-thumb-fit: contain;}hype-cart-drawer::part(checkout) {  border-radius: 999px;}

Good to know

  • Regular CSS selectors can't reach inside the drawer. Use the variables and parts above.
  • The empty cart message, Continue shopping, the total inside the checkout button and trust badge icons have no part. Style them with variables.
  • Custom JavaScript is in the same panel. It runs once per page load, on pages where the drawer appears.
  • If your CSS doesn't show on your store yet, see Changes aren't showing yet.
  • If you can't make this change yourself, message us and our team will help.

Related articles

Still stuck?

Ask a follow-up and we'll see it came from “Style the cart drawer with CSS”.

Opens chat with your question and a link to this article.