Skip to content

Customising the design

Steps for

How it works

SparkLayer's interfaces start with neutral styling. Each colour, font and size in them has a named setting, called a CSS variable, such as --b2b-brand-color. When you set a variable in your theme, your value replaces SparkLayer's default everywhere that variable is used.

You don't need to know CSS to change your brand colours and fonts. You copy a ready-made block of code, change 4 values and paste it into your theme.

Change your brand colours and fonts

  1. Copy the recommended starting CSS below.
  2. Change the 4 brand values at the top of it to your own (see the 4 brand values). Leave the rest as it is.
  3. Paste the code into your theme's <head>, after the SparkLayer Core Script if your theme has it (see where to paste the code).
  4. Save your theme, then sign in to your store as a B2B customer to check the result.
More detail

The starting code lives on this page, not in SparkLayer: there's no custom CSS screen. Design and tips at Storefront,Widgets (opens in your SparkLayer Dashboard in a new tab) links here. The interfaces only appear for signed-in B2B customers, so you won't see your changes while signed out. For more on making code changes to your store, see the frontend integration guide.

The 4 brand values

ValueWhat to enterExample
--b2b-brand-colorYour main brand colour, as a hex code. It's used for buttons, links and highlights.#1A4D8F
--b2b-brand-color-hoverThe colour buttons change to when a customer points at them, usually a slightly darker shade of your brand colour.#133A6B
--b2b-brand-fontThe font for body text. List your font first, then a fallback.Arial, sans-serif
--b2b-brand-font-headingThe font for headings and buttons.Georgia, serif

A hex code is the 6-character code for a colour, starting with #. Your brand guidelines or your theme's colour settings usually show it. Keep the semicolon (;) at the end of each line.

Every CSS variable starts with two hyphens, for example --spark-primary-color or --b2b-brand-color. A variable with one hyphen, or with the hyphens turned into a dash when you copied it, is ignored.

Try your design

See how your brand colour, fonts and corners look in SparkLayer's interfaces, in light and dark, before you change your theme. The code it writes goes in your custom CSS, after the recommended starting CSS.

Try your design Change a value to see SparkLayer's interfaces update.
Corners --spark-border-radius-default
Button corners --spark-border-radius-button
Preview
Paste into your custom CSS
:root { --b2b-brand-color: #5b36f5; }

Where to paste the code

  1. In your Shopify admin, go to Online Store,Themes (opens in your Shopify admin in a new tab).
  2. On your current theme, open the … menu and click Edit code.
  3. Open layout/theme.liquid, paste the code just before the closing </head> tag and click Save.

Your developer can put it in a separate CSS file in your theme instead.

To set variables without editing theme code, enter them in CSS variable overrides on the SparkLayer app embed instead, one per line. See App block settings.

This sample sets your brand colours and fonts and applies them throughout SparkLayer. Change the 4 values under "Set the brand styling" first. The rest are optional fine-tuning.

Sample CSS Code
<!-- SparkLayer Sample CSS Code -->

<style type="text/css">

:root {
  /* Set the brand styling */
  --b2b-brand-color: #000; /* Main brand colour */
  --b2b-brand-color-hover: #333; /* Main brand colour hover */
  --b2b-brand-font: Arial, sans-serif; /* Main brand font */
  --b2b-brand-font-heading: Arial, sans-serif; /* Main brand heading font */

  /* Update colours */
  --spark-default-body-color: #555555; /* Main body colour */
  --spark-primary-color: #000000; /* Main title colour */
  --spark-secondary-color: var(--b2b-brand-color); /* Main highlight colour */
  --spark-link-color: var(--b2b-brand-color); /* Link colour */

  /* Typefaces */
  --spark-font-default: var(--b2b-brand-font); /* Body typeface */
  --spark-font-weight-default: 400; /* Default font weight */
  --spark-font-weight-medium: 500; /* Medium font weight */
  --spark-font-weight-heavy: 600; /* Bold font weight */

  /* General */
  --spark-border-radius-default: 0; /* Default border radius */
  --spark-drawer-max-width: 700px; /* Width of the drawer */
  --spark-drawer-max-width-wide: 1000px; /* Width of the drawer in Full screen view */
  --spark-drawer-border-radius: 6px; /* Corner radius of the drawer */

  /* Font sizes */
  --spark-font-default-size: 14px; /* Default font size */
  --spark-font-default-size-small: 14px; /* Default font size - small screens */
  --spark-header-font: var(--b2b-brand-font-heading); /* Header typeface */
  --spark-header-font-weight: 500; /* Header font weight */
  --spark-h1-fontsize: 24px; /* Header 1 font size */
  --spark-h2-fontsize: 22px; /* Header 2 font size */
  --spark-h3-fontsize: 20px; /* Header 3 font size */
  --spark-h4-fontsize: 16px; /* Header 4 font size */
  --spark-h5-fontsize: 15px; /* Header 5 font size */
  --spark-h6-fontsize: 14px; /* Header 6 font size */

  --spark-pricing-fontsize: 20px; /* Font size of pricing */
  --spark-pricing-font-weight: 500; /* Font weight of pricing */
  --spark-pricing-fontsize-small: 14px; /* Font size of pricing on mobile */

  --spark-product-code-fontsize: 16px; /* Font size of product code */
  --spark-product-code-font-weight: 500; /* Font weight of product code */
  --spark-product-code-fontsize-small: 14px; /* Font size of product code on mobile */

  /* Buttons */
  --spark-button-font-family: var(--b2b-brand-font-heading); /* Button typeface */
  --spark-button-color: var(--b2b-brand-color); /* Default button colour */
  --spark-button-color-highlight: var(--b2b-brand-color-hover); /* Default button colour hover */
  --spark-button-large-color: var(--b2b-brand-color); /* Large button colour */
  --spark-button-large-color-highlight: var(--b2b-brand-color-hover); /* Large button colour hover */
  --spark-border-radius-button: 0; /* Button border radius */
  --spark-button-font-weight: 600; /* Button font weight */
  --spark-button-text-transform: none; /* Button text transform */
  --spark-button-text-letter-spacing: 0; /* Button letter spacing */
  --spark-button-padding: 1em 2.75em; /* Product page button padding */
  --spark-button-small-font-size: 16px; /* Product page and product card button font size */

  /* Tables */
  --spark-table-border-color: #CCCCCC; /* Table border colour */
  --spark-table-header-background-color: #F1F1F1; /* Table header background */
  --spark-table-header-text-color: #222222; /* Table header font colour */

  /* Product Card */
  --spark-product-card-button-radius: 0; /* Button radius */
  --spark-product-card-button-padding: 0.75em 1em; /* Button padding */
  --spark-product-card-pricing-font-size: 15px; /* Pricing font size */
  --spark-product-card-pricing-font-size-small: 14px; /* Pricing font size on mobile */
}
</style>

<!-- End SparkLayer Sample CSS Code -->

Turn on dark mode

With dark mode, customers see SparkLayer's interfaces with light text on dark backgrounds. Turn it on if your store uses a dark theme. You don't need code:

  1. Go to Storefront,Options (opens in your SparkLayer Dashboard in a new tab).
  2. Open Pricing and display and turn on Dark theme.
  3. Click Save & publish. See Storefront options.
Turn on dark mode in the Core Script (for developers)

Instead of the toggle, your developer can add darkTheme: true to the display settings of your Core Script:

Core Script
display: {
  darkTheme: true,
},

You can fine-tune dark mode's colours with the dark mode variables.

Change the status colours

SparkLayer gives each kind of message and badge its own colour: success, warning, error and information, the sales rep accent and company users. Each colour has a pale fill behind it, which SparkLayer mixes from the colour, so you set one variable per colour. Dark mode has its own set.

The sales rep accent shows only when a sales rep is signed in, so they can tell at a glance that they're ordering for someone else: on the Ordering for button in My Cart and Catalog, and in Pulse. Customers never see it.

Try a colour here, then copy the code into your custom CSS:

Try the status colours Pick a colour to see its messages and badges change.
Preview
Paste into your custom CSS
:root { --spark-success-color: #047857; }

The colour, sales rep and dark mode variables list them all, with their defaults.

Add your own content with custom slots

Custom slots (also called targets) let you show customers your own content, such as a message or a banner, in set places in the frontend interfaces. See Custom slots (targets).

Find the variable for an element

This section and the reference below are for your developer or agency. To change one element, such as a table header, find the CSS variable it uses:

  1. On your store, signed in as a B2B customer, right-click the element you want to change and choose Inspect to open your browser's developer tools.
  2. In the Styles panel, look for values written as var(--spark-…). Some show a private value first, such as color: var(--_spark-table-header-text). Click it to see the --spark- variable it reads, here --spark-table-header-text-color.
  3. Set that --spark- variable in your custom CSS. Variables that start --_spark- are internal and can change without notice, so don't set them.

CSS variable reference (for developers)

Each table lists the CSS variables for one area of SparkLayer's interfaces, what they change and their default. Click a variable's name to copy it. These are the variables SparkLayer 5 reads. To check your store's version, go to Storefront,Widgets,SparkLayer version (opens in your SparkLayer Dashboard in a new tab).

Where a default names another variable, such as --b2b-brand-color, the variable follows that one until you set it.

Variables SparkLayer 5 no longer reads

If your custom CSS sets any of these, they have no effect on SparkLayer 5. Where there's a replacement, it's in brackets.

  • Colours and type: --spark-tertiary-color, --spark-font-highlight (--spark-header-font), --spark-font-weight-light, --spark-packsize-fontsize, --spark-packsize-fontsize-small, --spark-packsize-font-weight, --spark-product-code-font-weight
  • Stock status: --spark-product-stockstatus-fontsize, --spark-product-stockstatus-fontsize-small, --spark-product-stockstatus-align, --spark-product-stockstatus-back-order-display, --spark-product-card-stockstatus-fontsize, --spark-product-card-stockstatus-fontsize-small, --spark-product-card-stockstatus-align
  • Layout: --spark-border-radius-large, --spark-loading-background-overlay-product, --spark-container-content-top, --spark-container-content-bottom, --spark-container-content-side, --spark-container-content-reduced
  • Buttons: --spark-button-border, --spark-button-font-size, --spark-button-radius (--spark-border-radius-button), --spark-button-raised-background-hover, --spark-button-large-padding, --spark-button-large-background (--spark-button-large-color)
  • Messages: --spark-toast-color (--spark-toast-background), --spark-toast-text-color, --spark-toast-action-color, --spark-toast-border-color, --spark-toast-border-radius, --spark-toast-animation-display, --spark-message-padding and the --spark-message-…-background and --spark-message-…-border variables
  • Forms: --spark-form-field-text-transform, --spark-placeholder-text-color, --spark-input-border, --spark-input-radius, --spark-input-error-color, --spark-input-success-color, --spark-input-focus-color, --spark-input-font-size, --spark-input-margin, --spark-label-font-size, --spark-input-disabled-color, --spark-input-disabled-solid-color, and the --spark-radio-… and --spark-select-… variables
  • Tables and product card: --spark-table-header-font-weight, --spark-table-header-font-size, --spark-table-header-text-transform, --spark-table-variants-border-color, --spark-product-card-select-min-height, --spark-product-card-tiered-pricing-display, --spark-product-card-tiered-pricing-font-size

Colours

The status colours (success, warning, error, information) also make the pale backgrounds behind their messages and badges: SparkLayer mixes 14% of the colour into white. So you usually only need to set the main colour. To try them, see Change the status colours.

VariableWhat it changesDefault
Body text#4A4557
Headings and prices#26232F
Light fills, such as row and menu hovers, tab backgrounds and the drawer's header#F6F5F9
Muted text and icons. Also the tooltip background, which is #14141C until you set this#6B6577
Highlights: focus rings, secondary buttons and the borders of controls on hover, else #5B36F5
Links, and highlighted text and icons, else #5B36F5
Backgrounds of the drawer, cards and menus, and text on buttons#FFFFFF
Borders of cards and menus, and the lines between rows#D7D5DD
Loading spinners
Success messages and badges, and In stock#047857
Warning messages and badges#92400E
Error messages and badges, and Out of stock#B91C1C
Information messages and badges#4338CA
Background of success messages, in browsers that can't mix colours#D1FAE5
Background of warning messages, in browsers that can't mix colours#FEF3C7
Background of error messages, in browsers that can't mix colours#FEE2E2
Background of information messages, in browsers that can't mix colours#E0E7FF
Low stock#E0A400
Last stock#F05A0A
Pre-order#4F2FF0
Messages and badges about company users#0369A1
Their background, in browsers that can't mix colours#D9F7FF

Typography

SparkLayer uses Arial unless you set a font. If you use custom fonts (for example from Google Fonts), include them in your website's main CSS file, and in your site header if needed. They then load before SparkLayer uses them.

Most text sizes scale with the base size, --spark-font-default-size. On phones, headings use the next size down: H1 and H2 take the H3 size, H3 the H4 size, and so on.

VariableWhat it changesDefault
Body fontArial, sans-serif
Heading font
Base text size on screens 1024px wide and over13px
Base text size on smaller screens13px
Body text weight400
Medium weight, such as labels500
Bold weight600
Heading weight600
Heading text transform, such as uppercasenone
Heading letter spacingnormal
H1 size21px
H2 size21px
H3 size18px
H4 size13px
H5 size13px
H6 size13px
Price size22px
Price size on phones14px
Price weight500
Product code (SKU) size16px
Product code size on phones14px
Variant code size in the variants table
Variant code size on phones

General

The drawer is the panel that slides in for My Cart, My Account and Catalog.

VariableWhat it changesDefault
Corners of cards, fields, menus and tooltips6px
Corners of status pills999px
Width of the drawer700px
Width of the drawer in Full screen view100%
Width of the drawer for Pulse and Catalog, on screens over 900px wide, else min(84vw, 1500px)
Corners of the drawer's frame. Buttons, fields and cards inside it keep . On phones the drawer fills the screen and stays square6px
Background of the drawer
Loading placeholders#EEEDF2
The shimmer across loading placeholders#F7F6FA
Height of the search results list before it scrolls70vh
How product images fill their box in the cartcover
Space kept for the product detail interface while it loads, for returning signed-in customers. Set 0 to keep none160px
Space kept for the product card interface while it loads110px
Space kept for the product matrix interface while it loads230px

Buttons

Without a hover colour, buttons darken by 10% when a customer points at them.

VariableWhat it changesDefault
Button fontArial, sans-serif
Button text weight600
Button text transform, such as uppercasenone
Button letter spacing0
Corners of the main buttons6px
Background of the main buttons, such as the product page's add to cart button, else #5B36F5
Their background on hoverNone
Background of raised buttons
Text on buttons
Padding of the product page buttons1em 2.75em
Text size of the product page and product card buttons16px
Background of large buttons, such as the checkout buttons in My Cart, else #00AF76
Their background on hoverNone
Text size of large buttons16px
Background of disabled buttons#DFDFDF
Text on disabled buttons#9F9F9F
Background of quote buttons, such as requesting a quote from My Cart#5B36F5
Height of the Add buttons in Catalog34px

Messages

Toast notifications

Toast notifications are the short pop-up messages SparkLayer shows customers on screen. They take their colours from the status colours and their corners from --spark-border-radius-default.

VariableWhat it changesDefault
Toast notification background, for every kind of messageWhite for success, the warning or error background otherwise

To hide toast notifications completely, add this CSS to your website:

spark-toast {display: none;}

Forms

VariableWhat it changesDefault
Background of fields
Borders of fields, radio buttons and outlined buttons#D7D5DD
Padding inside fields0.8125em
Minimum width of the variant drop-downs on product pagesauto

Tables

VariableWhat it changesDefault
Table borders#E4E2E8
Background of table rows, and of a row on hover#FFFFFF
Table header background#F9F8FB
Table header text#6B6577

Prices and product pages

These style the product detail interface and prices wherever they show. Use the display variables to hide a part: set them to none.

VariableWhat it changesDefault
Alignment of the pricestart
RRP colour
RRP text decoration, such as line-throughnone
Price summary colour
Display of the SKUblock
Display of the pack size in the variants tableblock
Display of the images in the variants table, on screens over 640px widetable-cell
Size of the images in the variants table40px
Size of the larger image shown when a customer points at one120px
How far to the side of the thumbnail the larger image shows-130px
Display of the stock key under the variants table, on screens over 640px wide. Set flex to show itnone

Product card

These style the product card interface: the product image, name, price, variant drop-downs, quantity selector and Add button shown on collection pages.

VariableWhat it changesDefault
Button corners
Button padding0.75em 1em
Price size15px
Price size on phones14px
Display of the price. Use none to hide itinline

Catalog and Quick Order

These style the Catalog and Quick Order tabs.

VariableWhat it changesDefault
How product images fit their boxes. Use contain to show the whole image, with space around it, instead of cropping itThe value of , or cover if that isn't set

Sales rep

These apply only when a sales rep is signed in: the Ordering for button in My Cart and Catalog, and the accents in Pulse. See Change the status colours to try them.

VariableWhat it changesDefault
The sales rep accent: the text and border of the Ordering for button, and the agent accents in Pulse#6D28D9
Its light tint, behind the Ordering for button. Current browsers mix it from , so set this only for browsers that can't mix colours#EDE9FE
Text on fills in the agent colour
The sales rep accent in dark mode#C4B5FD
Its tint in dark mode, for browsers that can't mix colours#1A1434
Text on fills in the agent colour, in dark mode#1A1434

Dark mode

When dark mode is on, these variables control its colours. The brand, button and font variables above apply in both modes.

VariableWhat it changesDefault
Background of the drawer, cards and menus#241F2E
Text and headings#F2F0F7
Muted text#9791A6
Links, and highlighted text and icons#A78BFA
Links on hover#C4B5FD
Success messages and badges#6EE7B7
Warning messages and badges#FCD34D
Error messages and badges#FCA5A5
Information messages and badges#A5B4FC
Background of success messages, in browsers that can't mix colours#143427
Background of warning messages, in browsers that can't mix colours#342C14
Background of error messages, in browsers that can't mix colours#341414
Background of information messages, in browsers that can't mix colours#282345
Messages and badges about company users#7DD3FC
Their background, in browsers that can't mix colours#142D34
In stock#5ECFAD
Low stock#FDE047
Last stock#FB923C
Out of stock#FF9A9A
Pre-order#96B1EF
Table borders and dividers#322D3F
Table header background#1C1824
Table row background#241F2E
Alternate table row background#241F2E
Background of fields and quantity boxes#241F2E
Raised and hover fills, such as menu hovers#2E2938
Borders of fields, quantity boxes and outlined buttons#494253
Background of disabled buttons#333333
Text on disabled buttons#777777
Loading placeholders#333333
The shimmer across loading placeholders#454545

FAQs

Was this page helpful?

Last updated