# Widgets: the hub's boxes on the business's own website

The hub draws a few things on the business's site: the sign-up form card, the booking box and the
website chat. They have a fixed layout and take one colour from you, the accent. The help centre's
pages and n8n webhook pages are the other places people see the business through us. In each, the
look comes from the brand's tokens (SKILL.md section 1), never a colour picked by eye.

## The accent colour

Every widget draws white text on the accent (buttons, the picked day) and accent text on white
(links, open days). So the accent must read at 4.5:1 against white:

- use `--aw-primary` when `--aw-on-primary` is white (the main colour carries white text);
- otherwise use `--aw-dark` when white reads on it at 4.5:1 too (`read 'look'` gives this as
  `--aw-on-dark`; without it, check the contrast yourself: a mid-grey "dark" fails),
  and tell the owner in one line why their main colour isn't on the buttons ("your yellow is too
  pale for white text, so the buttons use your dark navy");
- when neither reads, or the brand has neither, use a neutral near-black (`#1c1917`). The form card
  and booking box already default to it, so leave their accent out; the website chat defaults to a
  teal that is nobody's brand, so set its accent to the near-black.

Take the value from the brand look (`awesomate_business` `read 'look'` gives `tokens` and `css`
where it is offered), never from a screenshot of the site.

## Where each one takes it

| Widget | Where the accent goes | More in |
| --- | --- | --- |
| Sign-up form card | `accent="#hex"` on the WordPress shortcode, or `data-accent` on the snippet's `<div>` | [forms.md](forms.md), the awesomate-funnels skill |
| Booking box | `data-accent="#hex"` on the `<div data-awesomate-bookings>` | the awesomate-bookings skill |
| Website chat | `data-accent="#hex"` on the script tag; the hub's look editor sets the same value; `data-theme` (`auto`, `light`, `dark`) follows the site's own theme | the awesomate-knowledge skill |

The widgets keep their own system font on purpose (they must read on any site), so don't try to set
the brand font on them. Choose `data-position` and the inline or bubble mode for the page's layout,
not for looks.

## Around the widget

The widget is one box on a page you design. The page itself follows [pages.md](pages.md): give the
box room, put it where the argument says to act, and let the page carry the brand font and
colours. Don't wrap the widget in a second card or restyle it with CSS from the page: it draws in
its own isolated box, and a change from outside either does nothing or breaks it.

## Help centre pages

A business's own help centre takes its colours from the brand look in the hub; there is nothing to
set from here. When the owner builds their own help pages through the SDK, those pages are a page
like any other: [pages.md](pages.md) on the brand's tokens.

## n8n webhook pages

A page served from the business's n8n (the awesomate-n8n skill, references/webhook-pages.md) maps
the business variables onto the same `--aw-*` tokens in a `:root` block at the top, then uses only
the tokens. When a variable is unset, follow `next` like any other design: ask for the look, or use
the plain neutral look and say so, never an invented palette.

## Check it

Before handing the snippet over, run the widget's lines in [critique.md](critique.md): accent
contrast against white, the box on a 375 px phone, and nothing on the page fighting it.
