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.

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.

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-highlight: var(--b2b-brand-font-heading); /* Highlight 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 overlay */
  --spark-drawer-max-width-wide: 1000px; /* Width of overlay in maximised view */

  /* 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 */
  --spark-product-stockstatus-align: flex-start; /* Alignment of stock status for single variants */

  /* 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; /* Button padding */
  --spark-button-small-font-size: 16px; /* Small 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 */
  --spark-table-header-font-weight: 500; /* Table header font weight */

  /* 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 */
  --spark-product-card-select-min-height: 0; /* Set a min-height for select menu */
}
</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 and 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.

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-…). For example, a table header's text colour shows as color: var(--spark-table-header-text-color, #555).
  3. Set that variable in your custom CSS. The second value in brackets is the default.

CSS variable reference (for developers)

Each table lists the CSS variables for one area of SparkLayer's interfaces, what they change and their default value. Copy the sample code for an area to see every variable together.

Colours

Sample CSS Code
<style>
:root {
    /* Colours */
    --spark-default-body-color: #555555;
    --spark-primary-color: #000000;
    --spark-primary-color-light: #F5F5F5;
    --spark-primary-color-dark: #999999;
    --spark-secondary-color: #125EF8;
    --spark-tertiary-color: #00AF76;
    --spark-lightest-color: #FFFFFF;
    --spark-success-color: #00AF76;
    --spark-error-color: #EF0000;
    --spark-warn-color: #FF9243;
    --spark-link-color: #125EF8;
    --spark-input-color: #CCCCCC;
}
</style>
VariableWhat it changesDefault
--spark-default-body-colorBody text colour#555555
--spark-primary-colorTitle text colour, for example price information#000000
--spark-primary-color-lightLight shading, for example table shading#F5F5F5
--spark-primary-color-darkDark shading#999999
--spark-secondary-colorSecondary colour, for example a highlight colour#125EF8
--spark-tertiary-colorTertiary colour, for example the large button colour#00AF76
--spark-lightest-colorLightest colour, for example white#FFFFFF
--spark-success-colorSuccess message colour#00AF76
--spark-error-colorError message colour#EF0000
--spark-warn-colorWarning message colour#EDC35C
--spark-link-colorLink colour#125EF8
--spark-input-colorForm field border colour#CCCCCC

Typography

SparkLayer uses 2 typefaces by default: Roboto (opens in a new tab) for body text and Poppins (opens in a new tab) for highlights. You can replace them with the variables below.

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.

Sample CSS Code
<style>
:root {
    /* Typography */
    --spark-font-default: 'Roboto', sans-serif;
    --spark-font-highlight: 'Poppins', sans-serif;
    --spark-font-weight-default: 400;
    --spark-font-weight-light: 300;
    --spark-font-weight-medium: 500;
    --spark-font-weight-heavy: 600;
    --spark-header-font: 'Poppins', sans-serif;
    --spark-header-font-weight: 500;
    --spark-header-text-transform: none;
    --spark-header-letter-spacing: 0em;
    --spark-h1-fontsize: 24px;
    --spark-h2-fontsize: 22px;
    --spark-h3-fontsize: 20px;
    --spark-h4-fontsize: 16px;
    --spark-h5-fontsize: 15px;
    --spark-h6-fontsize: 14px;
    --spark-pricing-fontsize: 16px;
    --spark-pricing-font-weight: 400;
    --spark-pricing-fontsize-small: 14px;
    --spark-packsize-fontsize: 16px;
    --spark-packsize-font-weight: 400;
    --spark-packsize-fontsize-small: 14px;
    --spark-product-code-fontsize: 16px;
    --spark-product-code-font-weight: 400;
    --spark-product-code-fontsize-small: 14px;
    --spark-product-stockstatus-fontsize: 16px;
    --spark-product-stockstatus-fontsize-small: 14px;
    --spark-product-stockstatus-align: flex-start;
    --spark-product-stockstatus-back-order-display: flex;
}
</style>
VariableWhat it changesDefault
--spark-font-defaultMain body font'Roboto', sans-serif
--spark-font-highlightHighlight font'Poppins', sans-serif
--spark-font-weight-defaultDefault font weight400
--spark-font-weight-lightLight font weight300
--spark-font-weight-mediumMedium font weight500
--spark-font-weight-heavyHeavy font weight600
--spark-header-fontHeading font'Poppins', sans-serif
--spark-header-font-weightHeading font weight500
--spark-header-text-transformHeading text transformnone
--spark-header-letter-spacingHeading letter spacing0em
--spark-h1-fontsizeH1 font size24px
--spark-h2-fontsizeH2 font size22px
--spark-h3-fontsizeH3 font size20px
--spark-h4-fontsizeH4 font size16px
--spark-h5-fontsizeH5 font size15px
--spark-h6-fontsizeH6 font size14px
--spark-pricing-fontsizePrice font size16px
--spark-pricing-font-weightPrice font weight500
--spark-pricing-fontsize-smallPrice font size on mobile14px
--spark-packsize-fontsizePack size font size16px
--spark-packsize-font-weightPack size font weight400
--spark-packsize-fontsize-smallPack size font size on mobile14px
--spark-product-code-fontsizeProduct code font size16px
--spark-product-code-font-weightProduct code font weight500
--spark-product-code-fontsize-smallProduct code font size on mobile14px
--spark-product-stockstatus-alignAlignment of the stock status messageflex-start
--spark-product-stockstatus-back-order-displayDisplay of the pre-order messageflex

General

Sample CSS Code
<style>
:root {
    /* General */
    --spark-border-radius-default: 4px;
    --spark-border-radius-large: 8px;
    --spark-drawer-max-width: 700px;
    --spark-drawer-max-width-wide: 1000px;
    --spark-loading-background-color: #DEDEDE;
    --spark-loading-background-overlay-product: 255, 255, 255;
    --spark-container-content-top: 3em;
    --spark-container-content-bottom: 3em;
    --spark-container-content-side: 4.5em;
    --spark-container-content-reduced: 1.5em;
    --spark-spinner-default-color: #125EF8;
}
</style>
VariableWhat it changesDefault
--spark-border-radius-defaultDefault border radius4px
--spark-border-radius-largeOverlay border radius8px
--spark-drawer-max-widthWidth of the overlay700px
--spark-drawer-max-width-wideWidth of the overlay in maximised view1000px
--spark-loading-background-colorLoading skeleton colour#DEDEDE
--spark-loading-background-overlay-productLoading overlay colour on product pages255,255,255
--spark-container-content-topOverlay spacing: top3em
--spark-container-content-bottomOverlay spacing: bottom3em
--spark-container-content-sideOverlay spacing: sides4.5em
--spark-container-content-reducedOverlay spacing: reduced1.5em
--spark-spinner-default-colorLoading spinner colour#125EF8

Buttons

Sample CSS Code
<style>
:root {
    /* Buttons */
    --spark-button-font-family: 'Poppins', sans-serif;
    --spark-button-border: 0;
    --spark-button-font-size: 15px;
    --spark-button-font-weight: 400;
    --spark-button-padding: 0.875em 1.75em;
    --spark-button-radius: 4px;
    --spark-button-text-transform: none;
    --spark-button-text-letter-spacing: 0;
    --spark-button-raised-background: #125EF8;
    --spark-button-raised-background-hover: #508AFF;
    --spark-button-raised-color: #FFFFFF;
}
</style>
VariableWhat it changesDefault
--spark-button-font-familyButton font'Poppins', sans-serif
--spark-button-borderButton border0
--spark-button-font-sizeButton font size15px
--spark-button-font-weightButton font weight400
--spark-button-paddingButton padding0.875em 1.75em
--spark-button-radiusButton border radius4px
--spark-button-text-transformButton text transformnone
--spark-button-text-letter-spacingButton letter spacing0
--spark-button-raised-backgroundButton background#125EF8
--spark-button-raised-background-hoverButton background on hover#508AFF
--spark-button-raised-colorButton text colour#FFFFFF

Disabled buttons

Sample CSS Code
<style>
:root {
   /* Disabled buttons */
   --spark-button-disabled-background: #DFDFDF;
   --spark-button-disabled-color: #9F9F9F;
}
</style>
VariableWhat it changesDefault
--spark-button-disabled-backgroundDisabled button background#DFDFDF
--spark-button-disabled-colorDisabled button text colour#9F9F9F

Large buttons

Sample CSS Code
<style>
:root {
    /* Large buttons */
    --spark-button-large-font-size: 18px;
    --spark-button-large-padding: 0.875em 1.75em;
    --spark-button-large-background: #125EF8;
    --spark-button-large-background: #508AFF;
}
</style>
VariableWhat it changesDefault
--spark-button-large-font-sizeLarge button font size18px
--spark-button-large-paddingLarge button padding0.875em 1.75em
--spark-button-large-backgroundLarge button background#125EF8
--spark-button-large-backgroundLarge button background on hover#508AFF

Messages

Toast notifications

Toast notifications are the short pop-up messages SparkLayer shows customers on screen.

Sample CSS Code
<style>
:root {
    /* Toast notifications */
    --spark-toast-color: #FFFFFF;
    --spark-toast-text-color: #000000;
    --spark-toast-action-color: #125EF8;
    --spark-toast-border-color: #DDDDDD;
    --spark-toast-border-radius: 4px;
}
</style>
VariableWhat it changesDefault
--spark-toast-colorToast notification background colour#FFFFFF
--spark-toast-text-colorToast notification text colour#000000
--spark-toast-action-colorToast notification link colour#125EF8
--spark-toast-border-colorToast notification border colour#DDDDDD
--spark-toast-border-radiusToast notification border radius4px
--spark-toast-animation-displayWhether a progress bar showsblock

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

spark-toast {display: none;}

General messages

Sample CSS Code
<style>
:root {
    /* General messages */
    --spark-message-padding: 0.7em 1.25em;
    --spark-message-success-background: #E5FFF5;
    --spark-message-success-border: 1px solid #1c9665;
    --spark-message-warn-background: #FDF7E3;
    --spark-message-warn-border: 1px solid #EDC35C;
    --spark-message-error-background: #E74148;
    --spark-message-error-border: 1px solid #E74148;
}
</style>
VariableWhat it changesDefault
--spark-message-paddingMessage box padding0.7em 1.25em
--spark-message-success-backgroundSuccess message background#E5FFF5
--spark-message-success-borderSuccess message border1px solid #1c9665
--spark-message-warn-backgroundWarning message background#FDF7E3
--spark-message-warn-borderWarning message border1px solid #EDC35C
--spark-message-error-backgroundError message background#E74148
--spark-message-error-borderError message border1px solid #E74148

Forms

Input fields

Sample CSS Code
<style>
:root {
    /* Input fields */
    --spark-form-field-text-transform: none;
    --spark-placeholder-text-color: #999999;
    --spark-input-border-color: #CCCCCC;
    --spark-input-border: 1px solid #CCCCCC;
    --spark-input-radius: 4px;
    --spark-input-background: #FFFFFF;
    --spark-input-error-color: #EF0000;
    --spark-input-success-color: #00AF76;
    --spark-input-focus-color: #125EF8;
    --spark-input-font-size: 14px;
    --spark-input-margin: 0;
    --spark-input-padding: 0.75em;
    --spark-label-font-size: 0.8em;
    --spark-input-disabled-color: #777777;
    --spark-input-disabled-solid-color: #949494;
}
</style>
VariableWhat it changesDefault
--spark-form-field-text-transformForm text transformnone
--spark-placeholder-text-colorInput field placeholder colour#999999
--spark-input-border-colorInput field border colour#CCCCCC
--spark-input-borderInput field border1px solid #CCCCCC
--spark-input-radiusInput field border radius4px
--spark-input-backgroundInput field background#FFFFFF
--spark-input-error-colorInput field error colour#EF0000
--spark-input-success-colorInput field success colour#00AF76
--spark-input-focus-colorInput field focus colour#125EF8
--spark-input-font-sizeInput field font size14px
--spark-input-marginInput field margin0
--spark-input-paddingInput field padding0.75em
--spark-label-font-sizeLabel font size0.8em
--spark-input-disabled-colorDisabled input field colour#777777
--spark-input-disabled-solid-colorDisabled input border colour#949494

Radio buttons

Sample CSS Code
<style>
:root {
    /* Radio buttons */
    --spark-radio-fill-color: #125EF8;
    --spark-radio-empty-color: #5A5A5A;
    --spark-radio-border: 2px solid #125EF8;
}
</style>
VariableWhat it changesDefault
--spark-radio-fill-colorSelected radio button colour#125EF8
--spark-radio-empty-colorUnselected radio button colour#5A5A5A
--spark-radio-borderRadio button border2px solid #125EF8

Select menus

Sample CSS Code
<style>
:root {
    /* Select menus */
    --spark-select-border: 1px solid #CCCCCC;
    --spark-select-background: #FFFFFF;
    --spark-select-focus: 1px solid #125EF8;
    --spark-select-font-size: 14px;
    --spark-select-padding: 0.75em;
    --spark-select-radius: 4px;
    --spark-select-disabled-color: #999999;
}
</style>
VariableWhat it changesDefault
--spark-select-borderSelect menu border1px solid #CCCCCC
--spark-select-backgroundSelect menu background#FFFFFF
--spark-select-focusSelect menu border when focused#125EF8
--spark-select-font-sizeSelect menu font size14px
--spark-select-paddingSelect menu padding0.75em
--spark-select-radiusSelect menu border radius4px
--spark-select-disabled-colorDisabled select menu colour#999999

Tables

Sample CSS Code
<style>
:root {
    /* Tables */
    --spark-table-border-color: #CCCCCC;
    --spark-table-striped-color: #F5F5F5;
    --spark-table-header-background-color: #FFFFFF;
    --spark-table-header-text-color: #555555;
    --spark-table-header-font-weight: 500;
    --spark-table-header-font-size: 14px;
    --spark-table-header-text-transform: none;
    --spark-table-variants-border-color: #CCCCCC;
}
</style>
VariableWhat it changesDefault
--spark-table-border-colorTable border colour#CCCCCC
--spark-table-striped-colorBackground of striped table rows#F5F5F5
--spark-table-header-background-colorTable header background#FFFFFF
--spark-table-header-text-colorTable header text colour#555555
--spark-table-header-font-weightTable header font weight500
--spark-table-header-font-sizeTable header font size14px
--spark-table-header-text-transformTable header text transformnone
--spark-table-variants-border-colorBorder colour of the variants table on product pages#CCCCCC

Product card

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

Sample CSS Code
<style>
:root {
    /* Product Card */
    --spark-product-card-button-radius: 4px;
    --spark-product-card-button-padding: 0.75em 1em;
    --spark-product-card-pricing-font-size: 15px;
    --spark-product-card-pricing-font-size-small: 14px;
    --spark-product-card-select-min-height: 50px;

    --spark-product-card-stockstatus-fontsize: 16px;
    --spark-product-card-stockstatus-fontsize-small: 14px;
    --spark-product-card-stockstatus-align: center;
    --spark-product-stockstatus-back-order-display: none;

    --spark-product-card-tiered-pricing-display: flex;
    --spark-product-card-tiered-pricing-font-size: 12px;

}
</style>
VariableWhat it changesDefault
--spark-product-card-button-radiusButton radius4px
--spark-product-card-button-paddingButton padding0.75em 1em
--spark-product-card-pricing-font-sizePrice font size15px
--spark-product-card-pricing-font-size-smallPrice font size on mobile14px
--spark-product-card-select-min-heightMinimum height of the select menu wrapper50px
--spark-product-card-stockstatus-fontsizeStock status font size16px
--spark-product-card-stockstatus-fontsize-smallStock status font size on mobile14px
--spark-product-card-stockstatus-alignStock status alignmentcenter
--spark-product-card-tiered-pricing-displayDisplay of the tiered (quantity) pricing information. Use none to hide it.flex
--spark-product-card-tiered-pricing-font-sizeTiered pricing font size12px

Dark mode

When dark mode is on, these variables control its colours.

VariableWhat it changesDefault
--spark-pdp-price-summary-colorDefault price colour#ffffff
--spark-dark-mode-lightest-colorDefault text colour#ffffff
--spark-dark-mode-status-in-stockIn stock colour#5ecfad
--spark-dark-mode-status-back-orderBack-order colour#96b1ef
--spark-dark-mode-status-out-of-stockOut of stock colour#ff9a9a
--spark-dark-mode-table-border-colorTable border colour#555
--spark-dark-mode-table-header-backgroundTable header colour#000
--spark-dark-mode-table-row-backgroundTable row colour#333
--spark-dark-mode-table-row-alt-backgroundAlternate table row colour#222
--spark-dark-mode-qty-backgroundQuantity box colour#000
--spark-dark-mode-qty-background-hoverQuantity box colour on hover#222
--spark-dark-mode-qty-border-colorQuantity box border colour#555

FAQs

Was this page helpful?

Last updated