Skip to main content

Part 2: Brand it

  • You need: Part 1 finished, with yarn start still running.
  • You get: the Solstice look on every screen of your advisor: pine green, warm sand, serif headlines, soft cards.

You start with the values every screen shares and end with the product card.

The Solstice brand sheet: colour swatches, serif and sans-serif type, corner radii, pill buttons and answer cards

Working with an AI coding assistant. Open your assistant in the solstice-theme folder. It reads AGENTS.md, so it knows the project's rules. Give it one step at a time, and look at the browser after each one. A fresh conversation with a small task beats a long one. When a step ends with a check, run it yourself; don't take the assistant's word.

Step 6: Colours (15 min)​

Goal: give every screen the Solstice palette with two pastes into tokens.css and one line in the advisor view.

Skill: change a token, not a component.

src/css/tokens.css holds the raw colours. Every component gets its colours from there through src/css/variables.css, so you change 21 values there. One component gets two lines: the advisor itself sits on sand.

Open src/css/tokens.css. Paste this block over the palette, from :root { on line 10 down to the Zoe assistant comment. The highlighted lines are the ones that change. The assistant keeps its own colours, so stop at that comment:

src/css/tokens.css
:root {
/* ---------- Brand palette ---------- */
--zv-color-primary: #1f4d3a;
--zv-color-secondary: #2a644b;
--zv-color-brand: #1f4d3a;
--zv-color-brand-hover: #2a644b;
--zv-color-brand-pressed: #173b2c;

/* ---------- Neutrals ---------- */
--zv-color-white: #ffffff;
--zv-color-black: #000000;
--zv-color-surface: #ffffff;
--zv-color-surface-alt: #f6f1e7;
--zv-color-surface-muted: #ebe4d6;
--zv-color-surface-selection: #e6efe9;

/* ---------- Text ---------- */
--zv-color-text: #1c2420;
--zv-color-text-secondary: #4a554f;
--zv-color-text-muted: #5c665f;
--zv-color-text-inverse: #ffffff;

/* ---------- Borders ---------- */
--zv-color-border: #ddd6c8;
--zv-color-border-soft: #ebe4d6;
--zv-color-border-strong: #7d867f;
--zv-color-border-dim: #c4bcad;

/* ---------- Feedback ---------- */
--zv-color-error: #b3261e;
--zv-color-success: #1e7a46;

/* ---------- Zoe assistant ---------- */

A few lines further down, from line 57, the shadows carry the brand colour too. Paste this block over them, from --zv-shadow-color-strong to --zv-shadow-color-zoe-panel:

src/css/tokens.css
  --zv-shadow-color-strong: rgba(0, 0, 0, 0.2);
--zv-shadow-color-brand-soft: rgba(31, 77, 58, 0.08);
--zv-shadow-color-brand-md: rgba(31, 77, 58, 0.15);
--zv-shadow-color-brand-strong: rgba(31, 77, 58, 0.25);
--zv-shadow-color-brand-overlay: rgba(31, 77, 58, 0.05);
--zv-shadow-color-black-overlay: rgba(0, 0, 0, 0.5);
--zv-shadow-color-black-scrim: rgba(0, 0, 0, 0.35);
--zv-shadow-color-white-ring: rgba(255, 255, 255, 0.25);
--zv-shadow-color-white-scrim: rgba(255, 255, 255, 0.7);
--zv-shadow-color-error: rgba(179, 38, 30, 0.15);
--zv-shadow-color-zoe-panel: rgba(0, 0, 0, 0.16);

Open src/advisor-view.component.vue. In the .zv-advisor-view rule on line 169, change the background from transparent to sand and round its corners:

src/advisor-view.component.vue
  margin: 0 auto;
padding: var(--zv-space-lg);
overflow: hidden;
background: var(--zv-bg-surface-alt);
border-radius: var(--zv-radius-lg);
color: var(--zv-text-inverse);

Save both files, then answer your questions through to the results page.

You should now see no navy anywhere. The advisor sits on a rounded sand panel, the current step in the navigation bar is pine, and the text is a warm ink instead of black.

Before:

http://localhost:3000
The results page before the Solstice palette

After:

http://localhost:3000
The results page with the Solstice palette

Now run your first gate. A gate is a check that a change must pass before it is done. The project has four, and this one checks the styles:

yarn lint:css

It ends with:

✔ OK — CSS token lint passed.

This gate can't tell a right colour from a wrong one, so the browser is your check for the values.

Commit:

git commit -am "Solstice colours"

Step 7: Shape and type (10 min)​

Goal: rounder corners, serif headlines, softer shadows and a focus ring you can see.

Skill: rename a token and follow the name through src/css/variables.css.

The raw sizes and font stacks are in src/css/tokens.css. src/css/variables.css decides what each one is for, such as which font is the heading font.

In src/css/tokens.css, change the first three radius values on lines 129 to 131:

src/css/tokens.css
  /* ---------- Radius primitives (5 values) ---------- */
--zv-radius-0: 6px;
--zv-radius-1: 10px;
--zv-radius-2: 16px;
--zv-radius-3: 50%;
--zv-radius-4: 9999px;

In the same file, replace the --zv-font-family-ubuntu line on line 71 with two font stacks. They use fonts that every device already has, so nothing is downloaded:

src/css/tokens.css
  /* ---------- Font families (primitives) ---------- */
--zv-font-family-sans: system-ui, -apple-system, 'Segoe UI', Roboto,
'Helvetica Neue', Arial, sans-serif;
--zv-font-family-serif: Georgia, 'Iowan Old Style', 'Times New Roman', serif;

/* ---------- Font size primitives (8 steps) ---------- */

src/css/variables.css still uses the old name. Point headings at the serif stack and body text at the sans stack, on lines 148 and 149:

src/css/variables.css
  /* ---------- Font families (semantic) ---------- */
--zv-font-heading: var(--zv-font-family-serif);
--zv-font-body: var(--zv-font-family-sans);

Further down in src/css/variables.css, from line 207, give the three middle shadows two layers each: a tight one close to the card and a wide, faint one around it.

src/css/variables.css
  /* ---------- Shadows ---------- */
--zv-shadow-xs: 0 1px 2px var(--zv-shadow-color-weak);
--zv-shadow-sm: 0 1px 2px var(--zv-shadow-color-weak),
0 2px 8px var(--zv-shadow-color-weak);
--zv-shadow-md: 0 1px 2px var(--zv-shadow-color-weak),
0 6px 16px var(--zv-shadow-color-md);
--zv-shadow-lg: 0 2px 4px var(--zv-shadow-color-weak),
0 12px 28px var(--zv-shadow-color-md);
--zv-shadow-xl: 0 8px 32px var(--zv-shadow-color-md);

A few lines further, from line 223, make the focus ring visible. It is a white gap and a pine ring; both had the same width, so the pine never showed. Double the pine one:

src/css/variables.css
  /* ---------- Focus shadows ---------- */
--zv-focus-shadow-ring: 0 0 0 var(--zv-border-width-thick)
var(--zv-color-surface),
0 0 0 calc(2 * var(--zv-border-width-thick)) var(--zv-color-brand);

Save both files.

You should now see the question title and the results headline in a serif font, the rest of the text in your system's sans-serif font, and rounder corners on cards and inputs. Press Tab until Next or Back is focused: it has a white gap and a pine ring.

Before:

http://localhost:3000
A question page before the shape and type changes

After:

http://localhost:3000
A question page with a serif title and rounder cards

Run the gate. It ends with the same ✔ OK line as in Step 6:

yarn lint:css

Commit:

git commit -am "Solstice shape and type"

Step 8: Answer card (10 min)​

Goal: calm white answer cards with a hairline border and a dark label.

Skill: style a component with names from src/css/variables.css only.

From here on you style components. A component's styles are in the <style scoped> block at the end of its .component.vue file, and they use only names from src/css/variables.css. A raw value such as 16px, or a token such as --zv-radius-2, fails yarn lint:css.

yarn lint, the second gate, checks the code of the component. It also limits a file to 300 lines, and this one has 295 after this step. So in this file, change values and don't add new rules.

Open src/components/answer/choice-answer.component.vue and go to the .choice-answer rule on line 148. Add the border, and change the radius from --zv-radius-sm to --zv-radius-lg:

src/components/answer/choice-answer.component.vue
.choice-answer {
position: relative;
display: flex;
flex-direction: column;
width: var(--zv-choice-card-width);
max-width: 100%;
border: var(--zv-border-width-thin) solid var(--zv-border-soft);
border-radius: var(--zv-radius-lg);
overflow: hidden;

Further down, in the .choice-answer__label rule, change the colour from --zv-text-brand to --zv-text-primary:

src/components/answer/choice-answer.component.vue
.choice-answer__label {
font-family: var(--zv-font-body);
font-size: var(--zv-font-size-base);
font-weight: var(--zv-font-weight-semibold);
line-height: var(--zv-line-height-tight);
color: var(--zv-text-primary);
text-align: center;

At the end of the file, the @container zv-advisor (max-width: 640px) rule lays the cards out as rows on a phone. Give those rows a white background, so they don't vanish into the sand:

src/components/answer/choice-answer.component.vue
@container zv-advisor (max-width: 640px) {
.choice-answer {
flex-direction: row;
width: 100%;
max-width: var(--zv-content-narrow);
align-items: center;
padding-right: var(--zv-space-md);
background-color: var(--zv-bg-surface);
}

Save the file and click Back until you are on a question.

You should now see white answer cards with 16px corners, a thin warm border and dark labels. Make the window as narrow as a phone: the answers are white rows on the sand.

Before:

http://localhost:3000
Answer cards with pine labels and no border

After:

http://localhost:3000
Answer cards with rounder corners, a hairline border and dark labels

Run two gates this time:

yarn lint:css && yarn lint

Both pass when they print no error.

Commit:

git commit -am "Answer card, normal state"

Step 9: Selected answer card (10 min)​

Goal: a selected answer that is clear at a glance: a pine tint, a pine outline and a pine label.

Skill: style a state, for narrow screens and for the keyboard too.

The template fills a selected card with the brand colour. Solstice keeps the pine outline and swaps the fill for a light tint. You change four rules in the same file, from top to bottom.

In src/components/answer/choice-answer.component.vue, start with keyboard focus. In the template a focused card and a selected card look the same. Move the focus ring outside the card:

src/components/answer/choice-answer.component.vue
.choice-answer:focus-visible {
outline-color: var(--zv-focus-ring-color);
outline-offset: var(--zv-border-width-thick);
}

Change the selected card's background from --zv-bg-brand to the tint:

src/components/answer/choice-answer.component.vue
.choice-answer--selected .choice-answer__content {
background-color: var(--zv-bg-selection);
}

Change the selected label from --zv-text-inverse to pine:

src/components/answer/choice-answer.component.vue
.choice-answer--selected .choice-answer__label {
color: var(--zv-text-brand);
}

Near the end of the file, the @container zv-advisor (max-width: 640px) block restyles the cards for narrow screens. It fills the selected card a second time. Change that fill to the tint too, so the pine label stays readable on a phone:

src/components/answer/choice-answer.component.vue
  .choice-answer--selected {
background-color: var(--zv-bg-selection);
}

.choice-answer--selected .choice-answer__content {

Save the file. A single-choice question moves on by itself when you pick an answer, so you see the selected card on the way back: pick an answer, wait for the next page, then click Back.

You should now see three things:

  • The answer you picked has a light pine tint, a pine outline and a pine label.
  • Make the browser window as narrow as a phone: the cards turn into rows, and the selected row has the same tint.
  • Press Tab until a card has focus: the focus ring sits outside the card.

Before:

http://localhost:3000
A selected answer card filled with pine next to normal cards

After:

http://localhost:3000
A selected answer card with a pine tint next to normal cards

On a phone:

http://localhost:3000
On a phone the answers are rows, and the selected row has a pine tint and outline

Run the two gates:

yarn lint:css && yarn lint

Commit:

git commit -am "Answer card, selected state"

Step 10: Product card and buttons (10 min)​

Goal: product cards that look like a shop, with pill buttons and more air, on desktop and on a phone.

Skill: carry one look across two components.

The colours, corners and shadows of the card already follow Steps 6 and 7. What is left is in four small files: the card, its image, its features list and its two buttons.

Open src/components/product-card/product-card.component.vue. At the end of the .product-card rule on line 142, make the image area 4 by 3 instead of square:

src/components/product-card/product-card.component.vue
  transition: transform var(--zv-duration-slow) var(--zv-easing-default),
var(--zv-transition-shadow), var(--zv-transition-border-base);
box-shadow: var(--zv-shadow-xs);
--zv-product-card-image-aspect: 4 / 3;
}

In the hover rule, change the border colour from --zv-border-strong to --zv-border-default, so a hovered card lifts without a dark edge:

src/components/product-card/product-card.component.vue
.product-card:hover {
transform: translateY(calc(-1 * var(--zv-translate-sm)));
border-color: var(--zv-border-default);
box-shadow: var(--zv-shadow-lg);
}

In the same file, give the card's text more air: change the padding from --zv-space-lg to --zv-space-xl:

src/components/product-card/product-card.component.vue
.product-card__content {
display: flex;
flex-direction: column;
padding: var(--zv-space-xl);
gap: var(--zv-space-md);

Further down, give the product name a pine focus ring for keyboard users. Add the highlighted rule above .product-card__name:hover:

src/components/product-card/product-card.component.vue
.product-card__name:focus-visible {
outline: var(--zv-focus-ring-width) solid var(--zv-focus-ring-color);
outline-offset: var(--zv-space-2xs);
}

.product-card__name:hover {
text-decoration: underline;
}

Open src/components/product-card/components/product-card-image/product-card-image.component.vue. Put the image on white: change the background from --zv-bg-surface-alt to --zv-bg-surface:

src/components/product-card/components/product-card-image/product-card-image.component.vue
.product-card-image {
position: relative;
aspect-ratio: var(--zv-product-card-image-aspect);
width: 100%;
background: var(--zv-bg-surface);

Open src/components/product-card/components/product-card-features/product-card-features.component.vue. Add the same focus ring to the features toggle:

src/components/product-card/components/product-card-features/product-card-features.component.vue
.product-card-features__toggle:focus-visible {
outline: var(--zv-focus-ring-width) solid var(--zv-focus-ring-color);
outline-offset: var(--zv-space-2xs);
}

.product-card-features__label {
font-weight: var(--zv-font-weight-medium);
}

Open src/components/product-card/components/product-card-footer/product-card-footer.component.vue. It holds the two buttons. Make them pills: change the radius from --zv-radius-md to --zv-radius-pill:

src/components/product-card/components/product-card-footer/product-card-footer.component.vue
.product-card-footer__btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: var(--zv-space-sm);
width: 100%;
height: var(--zv-size-lg);
border-radius: var(--zv-radius-pill);
font-family: var(--zv-font-body);

After the .product-card-footer__btn:hover rule, add the same focus ring for both buttons:

src/components/product-card/components/product-card-footer/product-card-footer.component.vue
.product-card-footer__btn:hover {
transform: translateY(calc(-1 * var(--zv-translate-xs)));
}

.product-card-footer__btn:focus-visible {
outline: var(--zv-focus-ring-width) solid var(--zv-focus-ring-color);
outline-offset: var(--zv-space-2xs);
}

Further down in the same file, add a pressed state for the filled button, and give the outline button a thin pine border:

src/components/product-card/components/product-card-footer/product-card-footer.component.vue
.product-card-footer__btn--filled:hover {
background: var(--zv-bg-brand-hover);
}

.product-card-footer__btn--filled:active {
background: var(--zv-bg-brand-pressed);
}

.product-card-footer__btn--outline {
background: var(--zv-bg-surface);
color: var(--zv-text-brand);
border: var(--zv-border-width-thin) solid var(--zv-border-brand);
}

Save the four files and go to the results page.

You should now see four things:

  • The product cards have white 4 by 3 image areas, more room around the text, a pine Add to cart pill and a Go to product pill with a thin pine outline.
  • Move the mouse over a card: it lifts on a soft shadow. That small movement is part of the brand, as much as the colours.
  • Make the browser window as narrow as a phone: the cards stack, and the page doesn't scroll sideways.
  • Press Tab until a product name or a button is focused: it has a pine ring.

Before:

http://localhost:3000
The results page before the product card changes

After:

http://localhost:3000
The results page with Solstice product cards and pill buttons

On a phone:

http://localhost:3000
A Solstice product card on a phone, with both pill buttons

Run the two gates:

yarn lint:css && yarn lint

Commit:

git commit -am "Product card and buttons"

Step 11: Load More, then all four gates (5 min)​

Goal: the last button in the Solstice look, and all four gates green.

Skill: run every gate before you call a change done.

One button is left: Load More, at the end of the results page.

Open src/components/results-page/results-page.component.vue and make the Load More button match the outline button. Change its border, colour and font weight, and delete the border-color line from its hover rule:

src/components/results-page/results-page.component.vue
.results-page__load-more-btn {
display: inline-grid;
place-items: center;
min-width: var(--zv-load-more-min);
height: var(--zv-size-lg);
min-height: var(--zv-size-lg);
padding: 0 var(--zv-space-md);
border-radius: var(--zv-radius-pill);
border: var(--zv-border-width-thin) solid var(--zv-border-brand);
background: var(--zv-bg-surface);
color: var(--zv-text-brand);
font-family: var(--zv-font-body);
font-weight: var(--zv-font-weight-semibold);
font-size: var(--zv-font-size-base);
line-height: var(--zv-line-height-none);
cursor: pointer;
transition: var(--zv-transition-colors);
}

.results-page__load-more-btn:hover {
background: var(--zv-bg-surface-alt);
}

Save the file and scroll to the end of the results page.

You should now see Load More with a thin pine outline and a pine label, like Go to product. The button shows only while there are more products to load. If your advisor has none, go on to the gates.

Before:

http://localhost:3000
The Load More button before the change

After:

http://localhost:3000
The Load More button with a thin pine outline

You didn't touch the navigation bar, the Next and Back buttons or the product text. They follow the values from Steps 6 and 7.

Run all four gates:

yarn lint:css && yarn lint && yarn typecheck && yarn test

The last gate ends with:

 Test Files  12 passed (12)
Tests 106 passed (106)

Commit:

git commit -am "Load More button"

Checkpoint. The whole flow is Solstice: pine, sand, serif headlines, calm answer cards and pill buttons. You changed about 75 lines in nine files, the four gates pass, and six more commits hold your way back: git log --oneline shows 9 lines. Good moment for a break. Show a colleague.

If something is off​

  • yarn lint:css reports an error in a component. A rule uses a raw value or a token. Use a name from src/css/variables.css, as in Step 8.
  • The assistant goes in circles. Start a new conversation and give it a smaller task.

The Troubleshooting page has more.

Next: Part 3: Make it yours.