# Build a brand pack

This page is for a developer or an agent with a source checkout of Lolly. A brand pack is a folder that holds an organisation's design system and files for every tool, the CLI, the MCP server and a Lolly Work instance. To set up a design system in the app instead, see [From brand guidelines to a design system](/info/create/onboard-a-brand.html). [Configuration](/info/manage/profiles-and-brands.html#brand-packs) covers how packs and profiles fit together.

Run the commands from the root of a checkout ([Clone and set up](/info/build/contributing-setup.html#clone-and-set-up)). In a checkout, `lolly` is `pnpm run cli`. The examples build `harbour`, a pack for Harbour Shire Water, an invented water utility.

<!--i:eti-box-->
## What a pack holds

| Part | Where | What it is |
| --- | --- | --- |
| The token document | `catalog/assets/<ns>/tokens/brand.json` | The design system in DTCG JSON: colours, type, logo slots, colourways and rules |
| Marks and other files | `catalog/assets/<ns>/…` | The logos and the other files the brand keeps |
| The index | `catalog/assets/index.json` | One entry per file, with its id, tags, checksum and licence |
| A profile | `profiles.json` | Which tools and which catalog a run uses |

`<ns>` is the pack's name with its hyphens removed, because an asset id cannot have a hyphen in its first part.

<!--i:eti-code-->
## Write the token document

Three sets and two themes: `base` holds the named values, and `light` and `dark` point the seven colour roles at them. This document uses Lolly Demo's values, trimmed:

```json
{
  "$metadata": { "tokenSetOrder": ["base", "light", "dark"] },
  "$themes": [
    { "name": "light", "selectedTokenSets": { "base": "enabled", "light": "enabled" },
      "$extensions": { "com.suse.lolly": { "axis": { "kind": "mode" } } } },
    { "name": "dark", "selectedTokenSets": { "base": "enabled", "dark": "enabled" },
      "$extensions": { "com.suse.lolly": { "axis": { "kind": "mode" } } } }
  ],
  "base": {
    "color": { "$type": "color", "brand": {
      "spearmint": { "$value": "#033633", "$description": "Spearmint",
        "$extensions": { "com.suse.lolly": { "cmyk": [100, 31, 59, 79],
          "spot": { "name": "H190_L020_C020", "book": "freieFarbe HLC Colour Atlas XL" } } } },
      "green-apple": { "$value": "#50c369", "$description": "Green Apple" },
      "bunyapine":   { "$value": "#008657", "$description": "Bunyapine" },
      "liquorice":   { "$value": "#09141a", "$description": "Liquorice" },
      "sugar":       { "$value": "#ffffff", "$description": "Sugar" },
      "basalt":      { "$value": "#373e44", "$description": "Basalt" },
      "pebble":      { "$value": "#99a0a4", "$description": "Pebble" } } },
    "font": { "$type": "fontFamily",
      "brand":   { "$value": ["SUSE", "Arial"] },
      "display": { "$value": "Outfit" },
      "mono":    { "$value": "SUSE Mono" } },
    "asset": { "logo": {
      "horizontal-primary":         { "$type": "asset", "$value": "harbour/logo/horizontal" },
      "horizontal-primary-reverse": { "$type": "asset", "$value": "harbour/logo/horizontal-reverse" } } }
  },
  "light": { "color": { "$type": "color", "semantic": {
    "primary":    { "$value": "{color.brand.spearmint}" },
    "on-primary": { "$value": "{color.brand.sugar}" },
    "secondary":  { "$value": "{color.brand.bunyapine}" },
    "surface":    { "$value": "{color.brand.sugar}" },
    "text":       { "$value": "{color.brand.liquorice}" },
    "muted":      { "$value": "{color.brand.basalt}" },
    "edge":       { "$value": "{color.brand.pebble}" } } } },
  "dark": { "color": { "$type": "color", "semantic": {
    "primary":    { "$value": "{color.brand.green-apple}" },
    "on-primary": { "$value": "{color.brand.liquorice}" },
    "secondary":  { "$value": "{color.brand.bunyapine}" },
    "surface":    { "$value": "{color.brand.liquorice}" },
    "text":       { "$value": "{color.brand.sugar}" },
    "muted":      { "$value": "{color.brand.pebble}" },
    "edge":       { "$value": "{color.brand.basalt}" } } } }
}
```

Tools read the seven roles under `color.semantic`: `primary`, `on-primary`, `secondary`, `surface`, `text`, `muted` and `edge`. `$description` is the name Lolly shows for a colour, so keep the organisation's own name there and an ink reference in `spot`. [Design Tokens](/info/build/design-tokens.html#the-format-a-dtcg-profile) covers the format.

<!--i:eti-tag-->
## What the tokens can say

| To say | Write | Read more |
| --- | --- | --- |
| A colour's print values | `cmyk` and `spot` under the colour's `$extensions["com.suse.lolly"]` | [The format](/info/build/design-tokens.html#the-format-a-dtcg-profile) |
| A fallback face | A `fontFamily` array, in order of preference | [The format](/info/build/design-tokens.html#the-format-a-dtcg-profile) |
| A logo for each ground | `asset.logo.<slot>` pointing at an asset id: `horizontal-primary` for a light ground, `horizontal-primary-reverse` for a dark one | [Logos](/info/create/brand-studio.html#logos) |
| Colourways | A theme group of kind `colourway`, with each option's colours for each look | [In the token file](/info/create/colourways.html#in-the-token-file) |
| A campaign with dates | A theme group of kind `campaign`, with a `window` on each option | [What a theme group means](/info/build/design-tokens.html#what-a-theme-group-means) |
| Colour roles in the brand's own words | `roles` and `bindings` in the `brandSystem` record | [Colour roles in each colourway](/info/create/colourways.html#colour-roles-in-each-colourway) |
| House rules | `rules` in the `brandSystem` record | [Rules](/info/create/brand-studio.html#rules) |
| The app's own room | A `color.chrome` group in `light` and in `dark` | [App chrome from a design pack](/info/build/design-tokens.html#app-chrome-from-a-design-pack) |

Lolly checks seven kinds of house rule in Lolly Design: `text-weight`, `text-align`, `text-case`, `color-pairing`, `stroke-on-rounded`, `dash-reserved` and `logo-surface`. The record sits at the document root, under `$extensions["com.suse.lolly"].brandSystem`. One rule, in the shape Lolly Demo uses:

```json
{ "$extensions": { "com.suse.lolly": { "brandSystem": {
  "schemaVersion": 1, "id": "harbour", "label": "Harbour Shire Water",
  "roles": [], "bindings": [],
  "rules": [
    { "id": "headline-case", "label": "Headlines are never set in capitals", "kind": "text-case",
      "roleIds": [], "parameters": { "target": "headline", "forbid": "upper" },
      "scope": { "tools": ["design"] }, "requirement": "required",
      "origin": { "kind": "source", "reference": "Harbour Shire Water brand standards", "locator": "Typography" },
      "review": { "state": "approved", "authority": "Harbour Shire Water brand team" } }
  ] } } } }
```

Lolly gives behaviour to the `mode` and `colourway` kinds. A `campaign` group is kept and offered as a plain theme choice, and nothing applies its window to new work yet.

<!--i:eti-folder-move-->
## Tokens from another product

`ingest:brand` and **Add from…** keep a Tokens Studio, Penpot or other DTCG file whole. What Lolly reads from the file:

| In the file | What Lolly does |
| --- | --- |
| Colours, links, sets and themes | Reads them |
| Values under `color.semantic.*` and `font.*` | Tools draw with them |
| The product's own colour names, with no `color.semantic` | Keeps them. No tool draws with them until the seven roles point at them |
| Token maths, such as `{scale.base}*1.5` | Keeps the text and does not work out the value |
| A theme group with no stated `kind` | Offers the group as a plain theme choice. A light and dark pair needs `"kind": "mode"`, as in the sample above |

In the app, the review on import maps a file's own colour words to roles ([A file with its own colour words](/info/create/brand-studio.html#a-file-with-its-own-colour-words)).

<!--i:eti-shapes-->
## Marks and fonts

Put each mark under `catalog/assets/<ns>/logo/` and give it an index entry:

```json
{
  "id": "harbour/logo/horizontal",
  "name": "Harbour Shire Water - Horizontal",
  "type": "vector",
  "version": "1.0.0",
  "tier": "core",
  "tags": ["logo", "horizontal", "primary", "on-light"],
  "formats": [{ "format": "svg", "url": "/catalog/assets/harbour/logo/horizontal.svg",
                "checksum": "sha256-PLACEHOLDER", "size": 0 }],
  "license": "LicenseRef-Harbour-Shire-Water-Marks"
}
```

- **Tags.** Give each mark its orientation (`horizontal` or `vertical`), its treatment (`primary` or `reverse`) and its ground (`on-light` or `on-dark`). The brief picks a mark for each ground from these tags.
- **Checksum.** Leave `sha256-PLACEHOLDER` and `0`. `build:catalog` fills both in.
- **Terms.** A mark is its owner's. When your organisation owns the mark, record the owner and your terms as in [Publish your own marks](/info/create/brand-page.html#publish-your-own-marks). For someone else's mark, record the terms its owner states. Never record an open licence or an `own-work` grant for a mark that is not yours.
- **Fonts.** The platform faces (SUSE, SUSE Mono and Outfit) and the fonts a person installs in the **Type** room draw in the app and in every export. A face the pack lists as a `font` row in the asset index draws in the app as well, and the terminal reads the same rows ([Fonts](/info/build/authoring-assets.html#fonts)). `pnpm run ingest:brand --name harbour --out brands/harbour --font <file>` adds a face and writes its row.

<!--i:eti-package-->
## Build, validate and serve

```bash
pnpm run ingest:brand ./tokens.json --name harbour --label "Harbour Shire Water" --register
# add the marks and their index entries under brands/harbour/catalog/assets/
LOLLY_PROFILE=harbour pnpm run build:catalog
LOLLY_PROFILE=harbour pnpm run validate:catalog
LOLLY_PROFILE=harbour pnpm run dev:web
```

`ingest:brand` writes the pack to `brands/harbour/`, and `--register` adds the profile to `profiles.json`. `build:catalog` writes the tool index and the checksums. `validate:catalog` checks every file against its entry.

To keep the pack out of the checkout, move it into a folder of its own with a `profiles.json` and a link to the checkout's `community` folder:

```text
harbour-root/
├── profiles.json
├── community -> /path/to/lolly/community
└── brands/
    └── harbour/
```

```json
{
  "default": "harbour",
  "profiles": {
    "harbour": {
      "label": "Harbour Shire Water",
      "tools": ["community"],
      "assets": ["community/emoji-packs", "community/fallback-fonts"],
      "catalog": "brands/harbour/catalog"
    }
  }
}
```

Then set `LOLLY_ROOT` to that folder, and every command above reads the pack from there:

```bash
export LOLLY_ROOT=/path/to/harbour-root LOLLY_PROFILE=harbour
pnpm run build:catalog
pnpm run validate:catalog
```

`ingest:brand` writes only inside the checkout, so run it there and move `brands/harbour/` afterwards.

<!--i:eti-search-->
## Check from a terminal

1. **Read the brief.** `lolly system context --json` lists the colours by name, the type roles, the logo for each ground and the house rules. Its `origin` says which design system answered. Check each count against what you wrote.
2. **Read a tool's inputs.** `lolly describe quote-card` lists each input, its type and its default.
3. **Render one piece in three shapes.**

   ```bash
   lolly run quote-card --quote="Water is everyone's" --width=1080 --height=1350 --output=portrait.png
   lolly run quote-card --quote="Water is everyone's" --width=1920 --height=1080 --output=landscape.png
   lolly run quote-card --quote="Water is everyone's" --width=1080 --height=1080 --output=square.png
   ```

   Open each picture and look at the mark, the colours and the type. A PNG of a page-layout tool needs the browser tier: run `pnpm run dev:web` under the same `LOLLY_ROOT` and `LOLLY_PROFILE`, and set `LOLLY_WEB_BASE` to its address ([What the CLI can render](/info/build/cli-rendering.html#what-the-cli-can-render)).
4. **Set an input whose id is also a flag** with `--input.<id>=`: `lolly run wordmark --input.text=Harbour`. The sample command `lolly describe wordmark` prints uses `--text=`, which the CLI refuses, because `--text` takes `outline` or `live`.

<!--i:eti-users-->
## Give the pack to a Lolly Work instance

Lolly Work mounts a pack as its instance pack: a folder with `profiles.json`, such as the one you set as `LOLLY_ROOT`, a built `tools/` and `catalog/` tree, or a `brands/<name>/catalog` folder. An operator mounts the folder and redeploys every replica after a change. An administrator then selects the pack's design system ([Review and apply](/info/manage/design-system-administration.html#review-and-apply)). [Sources and storage](/info/manage/design-system-administration.html#sources-and-storage) and [Build a verified instance pack](/info/operate/instance-pack-production.html) have the details.

<!--i:eti-hammer-->
## Not yet

- A new pack fails `validate:catalog` with three errors about the Asset Export tool's examples, which use `lolly/demo/lolly-spin`, an asset only Lolly's own packs have. Any other error is yours to fix.
- `ingest:brand` takes tokens only. Add the marks and their index entries by hand.
- `validate:catalog` does not check that a logo slot points at an asset in the index. Check the logos in the brief.
- One rule with a field Lolly cannot read refuses the whole `brandSystem` record. The brief, `lolly check` and `validate:catalog` name the field and what the field takes.
- The brief does not list a colour's print values.
- Lolly does not work out token maths, and nothing applies a campaign's dates to new work.

---

Code ([MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/)) · Content ([CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)) · [lolly.tools](https://lolly.tools)
