Skip to content
Widget Library

Customer Theme Kit

What is sent to a customer to collect their theme, what comes back, and how it is checked and applied.

This page is for the people who onboard a customer. It describes the files a customer receives, what they fill in and how their answer becomes the theme of their account.


Item Where it is Purpose
Theme template themes/template.json in the package The one file to fill in and send back; it becomes theme.json
Example themes themes/examples/neutral.json, fashion.json, electronics.json, grocery.json Show what the tokens can do
Design reference The “Recommendation widgets” design canvas and the “Segmentify Widgets” design system Show every widget in each example theme
Token guide The section “What to Fill In” below Explains each value in plain words

The customer sends back one file: the template with their values.


The template asks for eleven values and the font. Each can be left as it is.

Value Question to answer Example
foreground What colour are your headings? #111111
primary What colour is your main button? #1d4ed8
primaryForeground What colour is the text on that button? #ffffff
secondary What colour should the slider arrows be? #ffffff
secondaryForeground What colour is the arrow icon on it? #111111
muted What colour are quiet, inactive elements? #c4c4c4
mutedForeground What colour is secondary text, such as a crossed-out price? #6b6b6b
card What is the background of a product card? #ffffff
cardForeground What colour is the text on a product card? #111111
sale What colour do you use for discounts? #d62028
radius How round are your corners? 8px (0 for square)
fontFamily Which font does your site use? "Inter", sans-serif, or inherit to follow the page

A filled-in file:

{
"$schema": "https://segmentify.com/schemas/widgets/widget-theme.v1.json",
"schemaVersion": 1,
"name": "Acme Store",
"theme": {
"foreground": "#0f172a",
"primary": "#1d4ed8",
"primaryForeground": "#ffffff",
"secondary": "#0f172a",
"secondaryForeground": "#ffffff",
"muted": "#cbd5e1",
"mutedForeground": "#5b6779",
"card": "#ffffff",
"cardForeground": "#0f172a",
"sale": "#c2410c",
"radius": "16px",
"fontFamily": "inherit"
}
}
  • Colours: hex (#1d4ed8) or rgb(29, 78, 216). Hex is preferred, because contrast can only be checked for hex and rgb().
  • Sizes: a number with px or rem, or 0.
  • Font: the family name as it is used in the site’s CSS. The widget does not load font files; the font must already be on the site.
  • No CSS, no images, no links. A file with anything else is refused.
  • Text on a background should reach a contrast of 4.5 to 1 (primaryForeground on primary, cardForeground and mutedForeground on card).

A customer who wants one part to differ adds a component token to the same file, for example "buttonRadius": "999px" or "priceColor": "#1d4ed8". The full list is on the Theming page. The examples use a few of them.


  1. Import it on the theme form of the account in the panel. Until the form exists (SFY-27911), put the file in the root of the account’s integration repository as theme.json.
  2. Read the validation answer. The schema and reviewTheme run on it: refused tokens come back with the reason, low-contrast pairs with their ratio. A file with a refused token is not saved.
  3. Send refusals and warnings back to the customer in their own words: which value, what is wrong, what would be accepted.
  4. Save. The file is committed to the account’s repository as theme.json and the account’s files are built for QA.
  5. Approve. After a look at QA the change is approved in the panel and built for production. Every widget of the customer uses the theme from then on.

To change the design later, change the values on the same form; each change goes through QA and approval again. A single campaign can still differ: its own theme overrides the account’s theme token by token.


Level Where it is set Scope
Account theme The theme form of the account in the panel; kept as theme.json in the account’s repository Every widget of the customer
Site CSS The customer’s own stylesheet, optionally Every widget on a page or in a section of it
Campaign theme The campaign’s config One campaign

Details and the order between them are on the Theming page.


Piece Status
Token system, theme file format and schema, template, examples, setWidgetTheme, reviewTheme In the library
Validating a saved theme and starting the flow sauron, SFY-27910
The theme form with a live preview, QA result and approval dashboard, SFY-27911
Committing theme.json to the account’s repository and building, QA first, production on approval cdn-manager, SFY-27912
theme.json, check-theme in the build and the setWidgetTheme call in the template integration-template, SFY-27753
A closed grammar for token values, proven with hostile values widget-library, SFY-27908