Customising the design
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
- Copy the recommended starting CSS below.
- Change the 4 brand values at the top of it to your own (see the 4 brand values). Leave the rest as it is.
- Paste the code into your theme's
<head>, after the SparkLayer Core Script if your theme has it (see where to paste the code). - 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
| Value | What to enter | Example |
|---|---|---|
--b2b-brand-color | Your main brand colour, as a hex code. It's used for buttons, links and highlights. | #1A4D8F |
--b2b-brand-color-hover | The colour buttons change to when a customer points at them, usually a slightly darker shade of your brand colour. | #133A6B |
--b2b-brand-font | The font for body text. List your font first, then a fallback. | Arial, sans-serif |
--b2b-brand-font-heading | The 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.
--spark-border-radius-default--spark-border-radius-buttonBrass cabinet hinge
My Cart
Harbour HardwareWhere to paste the code
- In your Shopify admin, go to Online Store,Themes (opens in your Shopify admin in a new tab).
- On your current theme, open the … menu and click Edit code.
- 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.
Add the code to the header template of your site, alongside the SparkLayer Core Script. Your platform's install guide shows where: BigCommerce, Wix, WooCommerce or Magento.
Recommended starting CSS
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.
<!-- 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:
- Go to Storefront,Options (opens in your SparkLayer Dashboard in a new tab).
- Open Pricing and display and turn on Dark theme.
- 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:
display: {
darkTheme: true,
},<!-- SparkLayer Core Script: in your theme, just before </head>.
Already have window.sparkOptions? Add just the setting to it. -->
<script>
window.sparkOptions = {
display: {
darkTheme: true,
},
};
</script>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:
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:
- 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.
- In the Styles panel, look for values written as
var(--spark-…). Some show a private value first, such ascolor: var(--_spark-table-header-text). Click it to see the--spark-variable it reads, here--spark-table-header-text-color. - 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-paddingand the--spark-message-…-backgroundand--spark-message-…-bordervariables - 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.
| Variable | What it changes | Default |
|---|---|---|
| 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.
| Variable | What it changes | Default |
|---|---|---|
| Body font | Arial, sans-serif | |
| Heading font | ||
| Base text size on screens 1024px wide and over | 13px | |
| Base text size on smaller screens | 13px | |
| Body text weight | 400 | |
| Medium weight, such as labels | 500 | |
| Bold weight | 600 | |
| Heading weight | 600 | |
Heading text transform, such as uppercase | none | |
| Heading letter spacing | normal | |
| H1 size | 21px | |
| H2 size | 21px | |
| H3 size | 18px | |
| H4 size | 13px | |
| H5 size | 13px | |
| H6 size | 13px | |
| Price size | 22px | |
| Price size on phones | 14px | |
| Price weight | 500 | |
| Product code (SKU) size | 16px | |
| Product code size on phones | 14px | |
| 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.
| Variable | What it changes | Default |
|---|---|---|
| Corners of cards, fields, menus and tooltips | 6px | |
| Corners of status pills | 999px | |
| Width of the drawer | 700px | |
| Width of the drawer in Full screen view | 100% | |
| 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 square | 6px | |
| Background of the drawer | ||
| Loading placeholders | #EEEDF2 | |
| The shimmer across loading placeholders | #F7F6FA | |
| Height of the search results list before it scrolls | 70vh | |
| How product images fill their box in the cart | cover | |
Space kept for the product detail interface while it loads, for returning signed-in customers. Set 0 to keep none | 160px | |
| Space kept for the product card interface while it loads | 110px | |
| Space kept for the product matrix interface while it loads | 230px |
Buttons
Without a hover colour, buttons darken by 10% when a customer points at them.
| Variable | What it changes | Default |
|---|---|---|
| Button font | Arial, sans-serif | |
| Button text weight | 600 | |
Button text transform, such as uppercase | none | |
| Button letter spacing | 0 | |
| Corners of the main buttons | 6px | |
| Background of the main buttons, such as the product page's add to cart button | , else #5B36F5 | |
| Their background on hover | None | |
| Background of raised buttons | ||
| Text on buttons | ||
| Padding of the product page buttons | 1em 2.75em | |
| Text size of the product page and product card buttons | 16px | |
| Background of large buttons, such as the checkout buttons in My Cart | , else #00AF76 | |
| Their background on hover | None | |
| Text size of large buttons | 16px | |
| 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 Catalog | 34px |
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.
| Variable | What it changes | Default |
|---|---|---|
| Toast notification background, for every kind of message | White for success, the warning or error background otherwise |
To hide toast notifications completely, add this CSS to your website:
spark-toast {display: none;}Forms
| Variable | What it changes | Default |
|---|---|---|
| Background of fields | ||
| Borders of fields, radio buttons and outlined buttons | #D7D5DD | |
| Padding inside fields | 0.8125em | |
| Minimum width of the variant drop-downs on product pages | auto |
Tables
| Variable | What it changes | Default |
|---|---|---|
| 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.
| Variable | What it changes | Default |
|---|---|---|
| Alignment of the price | start | |
| RRP colour | ||
RRP text decoration, such as line-through | none | |
| Price summary colour | ||
| Display of the SKU | block | |
| Display of the pack size in the variants table | block | |
| Display of the images in the variants table, on screens over 640px wide | table-cell | |
| Size of the images in the variants table | 40px | |
| Size of the larger image shown when a customer points at one | 120px | |
| 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 it | none |
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.
| Variable | What it changes | Default |
|---|---|---|
| Button corners | ||
| Button padding | 0.75em 1em | |
| Price size | 15px | |
| Price size on phones | 14px | |
Display of the price. Use none to hide it | inline |
Catalog and Quick Order
These style the Catalog and Quick Order tabs.
| Variable | What it changes | Default |
|---|---|---|
How product images fit their boxes. Use contain to show the whole image, with space around it, instead of cropping it | The 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.
| Variable | What it changes | Default |
|---|---|---|
| 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.
| Variable | What it changes | Default |
|---|---|---|
| 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
No. Colours and fonts are set with CSS in your theme, but you only need to change the 4 brand values in the recommended starting CSS. If you'd rather not edit your theme, ask your developer or agency, or contact us. Dark mode is the one design setting you can turn on without code, at Storefront,Options (opens in your SparkLayer Dashboard in a new tab).
Check that the code is inside :root { … } in a <style> tag, that every variable starts with 2 hyphens (--spark-…), that each line ends with a semicolon, and that it's added to the theme your store is actually using. Then sign in as a B2B customer and refresh the page: SparkLayer's interfaces only load for signed-in B2B customers.
Check SparkLayer isn't loaded twice. On Shopify, this happens when the theme has the SparkLayer app embed turned on and also a SparkLayer script hard-coded in its code, for example in theme.liquid. Keep only the app embed, and remove the hard-coded script. See Theme setup.
If there's no variable for what you need, contact us and we'll advise on the best approach. Some things can't be changed with CSS at all, such as the layout and button order of the product page widget, or a button's width. See What you can and can't change.
Yes, for some elements. For example, you can hide the product image, SKU or pack price on product pages. See How products are shown and Quantity rules for the variables.
Last updated