This article is intended for advanced users and our partners as it requires advanced web development or Salesforce admin or programming knowledge. While the functionality is part of StoreConnect, we do not provide end user assistance to implement it beyond our help documentation. If you need help or are unsure on how to do this, you can hire one of our StoreConnect partners.

Custom Theme CSS

Related help documents

There are a few different ways to customise your StoreConnect store’s CSS. The easiest way to add your custom CSS is to follow the instructions below.

  1. Go to your settings and look for the ‘Content Management (CMS)’ tab. Then find the “Custom Styles” field and click on edit.

  2. Write or paste your CSS classes and rules.

  3. Click on save.

Customizing Content Blocks with CSS

StoreConnect provides multiple content block templates that you can choose and use on the Salesforce UI. These templates already have their own CSS classes and using the content block Identifier value, auto generates a unique ID selector for any given content block created.

You can follow this article “Using CSS with content blocks” to learn how to select them and modify its properties.

Overriding your Branding Colours with CSS

Each StoreConnect theme has a configurable “primary” and “secondary” brand colour; these are used for complementary elements in the UI based on the rules of your chosen theme. This can include call to action buttons, links and notice banners.

The “primary” colour is typically used for the most important or brand-prominent parts of the UI - like the header background, “add to cart” button, and active or hover states of elements like input fields and links. The “secondary” brand colour, as the name suggest, is designated for less prominent but complementary elements in the UI.

You can configure the core colours in Salesforce by setting CSS variables in the “Custom Styles” field under the CMS section of your store, like:

body {
  --sc-brand-primary-h: [hue-value];
  --sc-brand-primary-s: [saturation-value];
  --sc-brand-primary-l: [lightness-value];

  --sc-brand-secondary-h: [hue-value];
  --sc-brand-secondary-s: [saturation-value];
  --sc-brand-secondary-l: [lightness-value];
}

We separate hue, saturation, and lightness values to allow greater flexibility in lightening and darkening. To find the hue, saturation, and lightness values of your desired brands colours you can use the following tool: Converting HEX values to HSL

Once set, these “primary” and “secondary” brand colours will automatically be used on specific UI elements based on the default rules of the theme. But what if you want to change the colour or style of a particular piece of the UI?

Global CSS Variables

We offer a number of other configurable CSS variables that are associated with specific pieces of a theme UI, for example:

  --sc-font-family: [font-here];
  --sc-footer-color [font-here];

Overriding these variables will save you some time and avoid overriding theme classes over and over again. Here’s an example:

  --sc-menu-link-color-hover: green;

Will override the following global class used by all custom menu using the menu builder:

.SC-Menu_link:hover, .SC-Menu_link:focus {
  color: var(--sc-menu-link-color-hover);
}

You can find these global variables inspecting the body tag element with your inspector tool.

In general, where possible, we recommend you leverage our configurable settings over using custom snippets of CSS, as we have written them in a way that takes into consideration the many implications of design for different browsers, states, and devices.

 

 
Back to Documentation