Styling guide
The widget is built to look like your site without being told how. This page covers what it does on its own, what you can change, and the rules it keeps so it stays readable.
What it inherits
With no settings at all, the widget takes your page’s font and text colour, has a transparent background, and uses the text colour as its accent. It is plain on purpose: it matches your site rather than ours. Nothing is set in either example below.
The widget works out whether your background is light or dark by looking at the first solid background behind it. A page can still restyle some things by inheritance, so the widget resets the ones that would bend it out of shape: line height, letter spacing, text size, case, alignment and direction. Text sizes are fixed in pixels, so a site that sets a small root font size does not shrink it.
The four settings, and font
Everything else is worked out from these.
- Accent. The selected day, the selected time and the book button. Default: the text colour. Text on the accent switches between near-black and white, whichever is easier to read.
- Text. The main text colour. Muted text and borders are mixed from it and the background.
- Background. A solid colour behind the widget. Default: transparent, so your page shows through.
- Corner radius. From 0 to 20 pixels, default 10. Buttons and times use it as given, the card uses 1.4 times as much, and the floating button is fully round unless you set 0. A number above 20 counts as 20.
- Font. Your page’s own, unless you pick
system-sans,system-seriforjost. In the script version,jostonly shows on a page that already loads the Jost font. In an iframe it is loaded for you.
Colours are six-digit hex only, such as #2F6F5E. Names, short hex and rgb() are ignored. A value the widget does not accept is skipped, and the next layer down is used.
You can save these once in the dashboard under Website widget and they apply everywhere the widget is installed, with no change to your site. A developer can then override them for one placement, with attributes or custom properties.
Which setting wins
From strongest to weakest:
- The
data-*attribute on the element. - The
--whensday-*custom property. - The look saved in the dashboard.
- What the widget inherits from the page.
Take an owner who saved a green accent. Left alone, the widget is green:
A developer sets a custom property that is rust. The property beats the saved look:
<style>
[data-whensday] { --whensday-accent: #B3541E; }
</style>Then one placement gets a data-accent. The attribute beats both:
<style>
[data-whensday] { --whensday-accent: #B3541E; }
</style>
<div data-whensday="your-business" data-accent="#1F4E8C"></div>Each setting is looked at on its own, so an attribute that is wrong for one setting does not change the others.
Custom properties
Set these on the widget’s element or on any element above it, such as a column or :root. They are how you style the widget from a stylesheet. Each one does the same job as the attribute in the last column, and the attribute wins if both are set.
| Property | Values | Default | Same as |
|---|---|---|---|
--whensday-accentGrowing | #rrggbb | the text colour | data-accent |
--whensday-textGrowing | #rrggbb | the host page's text colour | data-text |
--whensday-bgGrowing | #rrggbb | transparent | data-background |
--whensday-radiusGrowing | 0 to 20 (px) | 10 | data-radius |
--whensday-fontGrowing | inherit | system-sans | system-serif | jost | inherit | data-font |
Radius takes a number, with or without px. Font takes one of the four words, not a font stack. Colours must be six-digit hex.
<style>
.booking-column {
--whensday-accent: #2F6F5E;
--whensday-radius: 4px;
--whensday-font: system-serif;
}
</style>
<div class="booking-column">
<div data-whensday="your-business"></div>
</div>Readability rules
A widget on somebody else’s site should never be hard to read, so a few rules are applied whatever you choose. They use the standard contrast ratio, where 1 is no difference and 21 is black on white.
- Text on the accent is near-black or white, whichever has the higher contrast with the accent.
- Muted text (the day names, the note under a service) is darkened or lightened until it reaches 4.5:1 against the background.
- Selection: if the accent against the background is under 3:1, selected days and times also get an outline in the text colour, so you can always tell what is chosen.
The playground tells you when it does this, and why, so a colour is never changed without you seeing it.
An example
Marigold, #C9892C, as the accent on a white page:
- Text on it is dark (6.23:1), not white. White would be about 3:1, under the 4.5:1 floor.
- The accent against white is 2.96:1, under 3:1, so selected items also get the outline.
Light and dark
data-scheme is auto, light or dark. With auto, the widget reads your page: a dark background gets the dark treatment. Pin it with light or dark if detection gets your page wrong. In an iframe, auto follows the visitor’s device setting.
A pinned scheme paints its own text and background, near-black on white for light, and near-white on a very dark grey for dark, unless you have set your own colours.
Light and dark are free on every plan. They are about being able to read the widget, not about branding. A widget that cannot be read on a dark site is broken, and it has our name on it.
What you cannot change, and why
- Custom CSS. The widget lives in a shadow root, so your selectors do not reach inside. That keeps your stylesheet from breaking it by accident. The settings above are the way in.
- Colours of individual parts. There are four colour settings and the rest is worked out, so the contrast rules always have the full picture.
- The “Powered by Whensday” line. It shows on every plan and every layout.
- The words. “Booked”, “waitlist” and “first available” mean the same in the widget as in the booking form it opens, so the copy stays ours.
Which plans
Colours, corners and font need Growing or Enterprise
Accent, text, background, radius and font only apply on the Growing and Enterprise plans. On other plans the widget ignores them, the attributes and custom properties as well as the saved look, and stays neutral. Layout, location, service, staff and light and dark work on every plan. A saved look is kept if a plan changes, and applies again on the plan that has it.
The same markup on a plan without theming, and on one with it:
The playground lets everyone design a look, and its snippet keeps your settings, so it works from the day your plan includes them. See pricing for the plans.