Styling
Your site’s stylesheet can change the colours, corners, fonts, text size and spacing of every booking component with CSS variables. A variable you leave out changes nothing.
:root { --pms-primary: #1d3b36; /* Search, Select, Pay; the chosen dates */ --pms-primary-foreground: #ffffff; /* the words on them */ --pms-background: #faf7f0; /* the ground; the fill of a field */ --pms-foreground: #1f2523; /* the main text */ --pms-card: #ffffff; /* cards, the calendar, dropdowns */ --pms-muted: #efe8d8; /* chips, a hovered row, a closed day */ --pms-muted-foreground: #6b6f6a; /* secondary text, placeholders */ --pms-border: #d9cfb8; /* the line around a card */ --pms-input: #c9b88a; /* the line around a field */ --pms-ring: #8a6d1f; /* the focus outline */ --pms-error: #b3261e; /* error messages, an invalid field */ --pms-radius: 4px; /* corners of fields, buttons and cards */ --pms-font: "Inter", sans-serif; /* all text */ --pms-heading-font: "Lora", serif; /* h1–h3, the month names */ --pms-card-foreground: #1f2523; /* text on cards and panels */ --pms-heading-color: #1d3b36; /* h1–h3, the month names */ --pms-price-color: #1d3b36; /* a room's price, the total */ --pms-button-bg: #1d3b36; /* the fill of Search, Select, Continue, Pay, Done */ --pms-button-fg: #ffffff; /* their text */ --pms-input-bg: #ffffff; /* the fill of a field */ --pms-input-fg: #1f2523; /* what is typed in it */ --pms-badge-bg: #8a6d1f; /* "Only 3 left" and similar chips */ --pms-badge-fg: #ffffff; /* their text */ --pms-shadow-color: rgb(29 59 54 / 0.16); /* every drop shadow, transparency included */ --pms-overlay: rgb(20 36 32 / 0.72); /* the dim behind dialogs and the calendar */ --pms-button-radius: 4px; /* corners of buttons */ --pms-input-radius: 4px; /* corners of fields */ --pms-card-radius: 8px; /* corners of cards, panels, the calendar */ --pms-button-font: "Inter", sans-serif; /* the buttons' typeface */ --pms-heading-weight: 600; /* weight of headings */ --pms-button-weight: 600; /* weight of button text */ --pms-heading-transform: none; /* case of headings */ --pms-button-transform: uppercase; /* case of button text */ --pms-heading-letter-spacing: -0.01em; /* tracking of headings */ --pms-button-letter-spacing: 0.08em; /* tracking of button text */ --pms-text-scale: 1; /* every text size, multiplied */ --pms-density: 1; /* every padding and gap, multiplied */ --pms-button-border: #1d3b36; /* a line around every button */ --pms-border-width: 1px; /* the line of buttons, fields and cards */ --pms-button-hover-bg: #16302c; /* the fill of the filled buttons while hovered */}Paste it into your site’s stylesheet and keep only the lines you need. On your site your values win over the branding.
Variables
Each variable changes one thing a visitor sees. One you leave out falls back as its row says. Every variable in these tables also arrives in our two frames — the step with the guest’s details and the card, and the guest area — within the limits under Values. The tables use these words:
| Word | What it covers |
|---|---|
| A heading | h1, h2 and h3 — the title of a step, room names, section titles — and the month names in the calendar. The title on a card is not a heading. |
| A button | Every button with words on it: Search, Select, Continue, Pay, Done, and the quieter ones such as “Add a special request” and “Price breakdown”. Not the icon-only controls — ✕, the arrows, − and + — and not the days of the calendar: no button variable reaches those. The calendar’s two arrows and its ✕ are not buttons in this sense either, but their corners do follow --pms-radius and --pms-cal-radius. |
| A filled button | The buttons drawn on your main colour: Search, Select, Continue, Book now / Pay, and Done in the guests panel and in the calendar. |
| A field | Text fields, text areas, dropdowns, and the dates and guests fields of the search form. Not the card number, expiry and CVC fields. |
| A card | Room and rate cards, the blocks of the details step and of the guest area, dropdown lists, the guests panel, dialogs and the calendar. |
| A price | A room’s “from” price, a rate plan’s total, an extra’s total and the total in the summary. Not the rows of the price breakdown, and not the amount on the Pay button. |
| A badge | The two chips drawn on your main colour: “Only 3 left” on a room, and “In house” in the guest area. “Sold out” and the other states keep their own tones. |
| The dim | The dark veil behind the room dialog, the rate dialog, the dialogs of the guest area and the calendar. The photo viewer stays black. |
Colours
The palette every component draws from, the prices, the badges, the shadows and the dim.
| Variable | What it changes | Example | Value | Falls back to |
|---|---|---|---|---|
--pms-primary | The filled buttons, the chosen dates in the calendar, a ticked box, the current step, the badges and links. | #1d3b36 | A colour | The property's branding |
--pms-primary-foreground | The words and icons on those buttons and dates. | #ffffff | A colour | The property's branding |
--pms-background | The ground under the components, and the fill of a field or an outline button. | #faf7f0 | A colour | The property's branding |
--pms-foreground | The main text everywhere, on cards and in dropdowns too. | #1f2523 | A colour | The property's branding |
--pms-muted | Chips, the ground under a hovered row, a closed day in the calendar. | #efe8d8 | A colour | The property's branding |
--pms-muted-foreground | Secondary text, the placeholder in a field, the price under a date. | #6b6f6a | A colour | The property's branding |
--pms-border | The line around a card and between rows. It does not reach fields: those take --pms-input. | #d9cfb8 | A colour | The property's branding |
--pms-ring | The outline around the field or button that has keyboard focus. | #8a6d1f | A colour | The property's branding |
--pms-error | Error messages and the line around an invalid field. | #b3261e | A colour | The property's branding |
--pms-price-color | The colour of prices. | #1d3b36 | A colour | As it is without it |
--pms-badge-bg | The fill of a badge. | #8a6d1f | A colour | --pms-primary, then the property's branding |
--pms-badge-fg | The words on a badge. | #ffffff | A colour | --pms-primary-foreground, then the property's branding |
--pms-shadow-color | Every drop shadow. It is the whole colour, transparency included — write rgb(0 0 0 / 0.1), not a solid colour. transparent removes the shadows. | rgb(29 59 54 / 0.16) | A colour | As it is without it |
--pms-overlay | The dim. | rgb(20 36 32 / 0.72) | A colour | As it is without it |
Buttons
Colours for the filled buttons; corners, typeface, weight, case and letter-spacing for every button.
| Variable | What it changes | Example | Value | Falls back to |
|---|---|---|---|---|
--pms-button-bg | The fill of the filled buttons. Their hover — unless --pms-button-hover-bg sets it — and their disabled look follow it. transparent leaves the words alone, or an outline with --pms-button-border. | #1d3b36 | A colour | --pms-primary, then the property's branding |
--pms-button-fg | The words on the filled buttons. | #ffffff | A colour | --pms-primary-foreground, then the property's branding |
--pms-button-radius | The corners of every button — exactly this value. | 4px | A length. Our frames take 0 to 32px; a larger one is 32px there | --pms-radius, then the property's branding |
--pms-button-font | The typeface of every button. | "Inter", sans-serif | A font-family list | --pms-font, then the property's branding |
--pms-button-weight | The weight of the words on every button. | 600 | A font weight. Our frames take 100 to 900, in hundreds; one outside is the nearer of the two there | As it is without it |
--pms-button-transform | The case of the words on every button. | uppercase | One of: none, uppercase, lowercase, capitalize | As it is without it |
--pms-button-letter-spacing | The letter-spacing of the words on every button. | 0.08em | A length. Our frames take -0.05 to 0.3em, or -2 to 8px; one outside is the nearer end there | As it is without it |
--pms-button-border | A line around every button, the filled ones too — 1px wide unless --pms-border-width says otherwise. With --pms-button-bg: transparent it makes outline buttons; with a transparent line as well, the words alone. | #1d3b36 | A colour | As it is without it |
--pms-button-hover-bg | The fill of the filled buttons while the pointer is over them — exactly this colour. Left out, the fill at nine tenths. | #16302c | A colour | As it is without it |
Fields
The line, the fill, the text and the corners of a field.
| Variable | What it changes | Example | Value | Falls back to |
|---|---|---|---|---|
--pms-input | The line around a field or a dropdown. It does not follow --pms-border: to change every line, set both. | #c9b88a | A colour | The property's branding |
--pms-input-bg | The fill of a field. | #ffffff | A colour | As it is without it |
--pms-input-fg | What is typed or chosen in a field. A dropdown that still shows its placeholder keeps the muted colour. | #1f2523 | A colour | As it is without it |
--pms-input-radius | The corners of a field — exactly this value. | 4px | A length. Our frames take 0 to 32px; a larger one is 32px there | --pms-radius, then the property's branding |
Cards
The ground, the text and the corners of a card.
| Variable | What it changes | Example | Value | Falls back to |
|---|---|---|---|---|
--pms-card | Room and rate cards, the summary, dialogs, the calendar, dropdowns, and the cards of the details-and-payment step and the guest account area. | #ffffff | A colour | The property's branding |
--pms-card-foreground | The text on cards. | #1f2523 | A colour | --pms-foreground, then the property's branding |
--pms-card-radius | The corners of a card — exactly this value. | 8px | A length. Our frames take 0 to 32px; a larger one is 32px there | --pms-radius, then the property's branding |
Text
Typefaces, headings and the size of all text.
| Variable | What it changes | Example | Value | Falls back to |
|---|---|---|---|---|
--pms-font | All text. | "Inter", sans-serif | A font-family list | The property's branding |
--pms-heading-font | Headings — h1, h2 and h3: the step's title, room names, section titles — and the month names in the calendar. Left out, they take --pms-font. | "Lora", serif | A font-family list | --pms-font, then the property's branding |
--pms-heading-color | The colour of headings. | #1d3b36 | A colour | As it is without it |
--pms-heading-weight | The weight of headings. | 600 | A font weight. Our frames take 100 to 900, in hundreds; one outside is the nearer of the two there | As it is without it |
--pms-heading-transform | The case of headings. | none | One of: none, uppercase, lowercase, capitalize | As it is without it |
--pms-heading-letter-spacing | The letter-spacing of headings. | -0.01em | A length. Our frames take -0.05 to 0.3em, or -2 to 8px; one outside is the nearer end there | As it is without it |
--pms-text-scale | Every text size, multiplied. | 1 | A number. Our frames take 0.85 to 1.3; one outside is the nearer of the two there | 1 |
Spacing
Corners, and how much room everything takes.
| Variable | What it changes | Example | Value | Falls back to |
|---|---|---|---|---|
--pms-radius | The corners of fields, buttons, cards and dialogs, each derived from it. | 4px | A length. Our frames take 0 to 32px; a larger one is 32px there | The property's branding |
--pms-density | Every padding and gap, multiplied — and with them the heights of fields and buttons, so a field keeps its proportions. | 1 | A number. Our frames take 0.75 to 1.4; one outside is the nearer of the two there | 1 |
--pms-border-width | The width of the line around a field, a card and a button that has a line. It adds no line where there is none. | 1px | A length. Our frames take 0 to 4px; a wider one is 4px there | As it is without it |
The calendar
The calendar follows the general variables. These change the calendar alone; one you leave out falls back as its row says. Where one of them and a general variable meet — the corners and the typeface of its button, the corners of its sheet — the calendar’s wins. The calendar never opens in our frames, so none of them is sent there.
:root { --pms-cal-selected-bg: #1d3b36; /* the chosen dates */ --pms-cal-selected-fg: #ffffff; --pms-cal-range-bg: #c9b88a; /* the nights between them */ --pms-cal-range-fg: #1d3b36; --pms-cal-closed-bg: #efe8d8; /* a day that cannot be booked */ --pms-cal-border: #c9b88a; /* the lines of the grid */ --pms-cal-price-color: #8a6d1f; /* the price under a date */ --pms-cal-button-bg: #8a6d1f; /* the button at the bottom */ --pms-cal-button-fg: #ffffff; --pms-cal-radius: 0px; /* corners */ --pms-cal-font: Georgia, serif; --pms-cal-title-font: Georgia, serif; /* the month names */ --pms-cal-bg: #fffdf8; /* the sheet */ --pms-cal-day-bg: #fbf8f1; /* a bookable day */ --pms-cal-day-fg: #14302b; /* its number */ --pms-cal-weekend-color: #9b2c1f; /* the weekend day names */ --pms-cal-footer-bg: #ebe3d1; /* the bar with the summary and the button */ --pms-cal-overlay: rgb(29 59 54 / 0.8); /* the dim behind it */}| Variable | What it changes | Example | Value | Falls back to |
|---|---|---|---|---|
--pms-cal-selected-bg | The chosen check-in and check-out dates. | #1d3b36 | A colour | --pms-primary |
--pms-cal-selected-fg | The numbers on the chosen dates. | #ffffff | A colour | --pms-primary-foreground |
--pms-cal-range-bg | The nights between the two dates. | #c9b88a | A colour | --pms-cal-selected-bg, then --pms-primary |
--pms-cal-range-fg | The numbers on those nights. | #1d3b36 | A colour | --pms-cal-selected-fg, then --pms-primary-foreground |
--pms-cal-closed-bg | A day that cannot be booked. | #efe8d8 | A colour | --pms-muted |
--pms-cal-border | The lines of the grid. | #c9b88a | A colour | --pms-border |
--pms-cal-price-color | The price under a date. | #8a6d1f | A colour | --pms-muted-foreground |
--pms-cal-button-bg | The button at the bottom. | #8a6d1f | A colour | --pms-button-bg, then --pms-cal-selected-bg, then --pms-primary |
--pms-cal-button-fg | The words on that button. | #ffffff | A colour | --pms-button-fg, then --pms-cal-selected-fg, then --pms-primary-foreground |
--pms-cal-radius | The corners of the calendar, its arrows and its button. | 0px | A length. Our frames take 0 to 32px; a larger one is 32px there | --pms-radius |
--pms-cal-font | The calendar's text. | Georgia, serif | A font-family list | --pms-font |
--pms-cal-title-font | The month names. | Georgia, serif | A font-family list | --pms-heading-font, then --pms-cal-font, then --pms-font |
--pms-cal-bg | The calendar's sheet, with its strip of day names and its arrows. | #fffdf8 | A colour | --pms-card |
--pms-cal-day-bg | A day that is neither chosen nor closed. | #fbf8f1 | A colour | --pms-background |
--pms-cal-day-fg | The number on such a day. | #14302b | A colour | --pms-foreground |
--pms-cal-weekend-color | The weekend day names. | #9b2c1f | A colour | --pms-cal-selected-bg, then --pms-primary |
--pms-cal-footer-bg | The bar with the summary and the button. | #ebe3d1 | A colour | As it is without it |
--pms-cal-overlay | The dim behind the calendar. | rgb(29 59 54 / 0.8) | A colour | --pms-overlay |
Parts of the calendar
Beyond the variables each piece of the calendar has a name, and a ::part() rule in your stylesheet takes any CSS — the same way as the guests panel, so the two can be made to match. Every such rule starts with [data-pms-booking-overlay], the element the calendar opens in: see How a part rule works for that element, for :hover and the other states, and for a rule that holds in the dark look only.
A day carries its state as a second name: style cal-day for every day and cal-day-selected, cal-day-between, cal-day-closed or cal-day-outside for one state. A day has at most one of the first three; cal-day-outside can stand beside any of them.
[data-pms-booking-overlay]::part(cal-sheet) { border: 1px solid #c9b88a;}[data-pms-booking-overlay]::part(cal-title) { text-transform: uppercase; letter-spacing: 0.08em;}[data-pms-booking-overlay]::part(cal-day-selected) { border-radius: 50%;}[data-pms-booking-overlay]::part(cal-day-closed) { text-decoration: line-through;}[data-pms-booking-overlay]::part(cal-day):hover { outline: 2px solid #8a6d1f;}[data-pms-booking-overlay]::part(cal-done):disabled { opacity: 0.35;}| Part | What it is |
|---|---|
cal-sheet | The whole calendar. |
cal-header | The strip at the top: the month names with the two arrows, or on a phone the current month with the close button. |
cal-title | A month name. |
cal-nav | The two arrows that page the months. The first is disabled on the current month. |
cal-close | The close button, on a phone. |
cal-weekday | A day name over a column: Mon, Tue. |
cal-day | Every day of a month. |
cal-day-selected | The chosen check-in or check-out date — together with cal-day. |
cal-day-between | A night between the two dates — together with cal-day. |
cal-day-closed | A day that cannot be booked — together with cal-day. |
cal-day-outside | A day already past — together with cal-day. It is disabled. |
cal-day-number | The number on a day. |
cal-day-price | The price under the number. |
cal-footer | The bar at the bottom. |
cal-summary | The line in that bar with the chosen dates and the number of nights. |
cal-done | The button that applies the dates. Disabled until both are chosen. |
A rule on a part wins over the calendar’s variables for that piece. The part names work on your own page only: the calendar never opens in our frames. The grid of days and the prices are laid out by the calendar — change their look, and check a phone and a desktop after changing a size.
How the pieces sit inside each other, for a rule that relies on it:
cal-dayis a button.cal-day-numberandcal-day-priceare inside it, one under the other, so acolor: inheriton either takes the colour your rule gave the day.- A day draws its own 1px line and overlaps its neighbours by exactly that pixel, so a wider border of your own doubles up between two days. An
outlinetakes no room. - A chosen day (
cal-day-selected) clips its contents, a::beforeor::afterincluded. - On a screen narrower than 768px the calendar is one column of months that scrolls:
cal-headerholds the current month’scal-titleandcal-close, and there is nocal-nav. From 768pxcal-headerholds the twocal-navarrows and the month names, and there is nocal-close.
The guests panel
The guests panel follows the general variables too. Beyond them each piece has a name, and a ::part() rule takes any CSS. It opens in the same element as the calendar, [data-pms-booking-overlay], whichever form opened it — see How a part rule works.
[data-pms-booking-overlay]::part(guests-panel) { border-radius: 0; background: #1d3b36; color: #f3ead8;}[data-pms-booking-overlay]::part(guests-stepper-button) { background: #c9b88a; color: #1d3b36;}[data-pms-booking-overlay]::part(guests-stepper-button):disabled { opacity: 0.35;}[data-pms-booking-overlay]::part(guests-done):hover { background: #b3a070;}| Part | What it is |
|---|---|
guests-panel | The whole panel. |
guests-label | The name over a counter: Adults, Children. |
guests-stepper | A counter: the box with − and + and the number between them. |
guests-stepper-button | The − and + buttons. Disabled at the least and the most. |
guests-stepper-value | The number between them. |
guests-age-row | The row for one child's age. |
guests-age-label | The label of that row. |
guests-age-select | The age field. |
guests-age-options | The list the age field opens. |
guests-age-option | One age in that list. |
guests-done | The button that closes the panel. Disabled until every child has an age. |
The part names work on your own page only: the guests panel never opens in our frames.
How a part rule works
The element the pickers open in
[data-pms-booking-overlay] is one <div> of ours. The script adds it to the end of your <body> when the page gets its first component or its first data-pms-dates / data-pms-guests button. There is one per page.
- What opens in it. Everything a component opens over your page: the calendar, the guests panel and its list of ages, dropdown lists, the room dialog and the photo viewer. It does not matter what opened them — a form in your own HTML, the ready search form, or the search form inside the booking window. The calendar and the guests panel are never drawn inside a component’s own box.
- So every part rule goes through it.
[data-pms-booking-overlay]::part(cal-day)reaches the calendar of every form on the page. The same part asked of another element —[data-pms-booking="search-form"]::part(cal-day),body::part(cal-day)— matches nothing. Write each rule once. - It carries
data-pms-theme,lightordark, like every component’s box. - It is ours. It is fixed to the top left corner above everything else on the page. Do not move, hide or remove it, and do not write its attributes. A property you set on the element itself — a colour, a font — does not reach what is inside.
- Your own custom properties reach the parts. The element is in your document, so a custom property from your
:rootinherits into it andvar(--your-name)works inside a part rule. Give your properties a prefix of your own: inside the components more than a hundred unprefixed names —--primary,--background,--radius,--spacingand the like — are ours, and therevar(--primary)reads our value, not yours.
What a part rule can do
A part rule is a rule of your stylesheet, and most of what follows is how CSS defines ::part() in every browser, not something our code adds. What our markup adds is the names, and which piece is a button.
- Any property, and it wins over the component’s own styles and over the calendar’s variables for that piece.
- A pseudo-class after the part matches the piece’s own state:
:hover,:focus,:focus-visible,:active,:disabled. The pieces that are buttons, and so can be focused or disabled:cal-day,cal-nav,cal-close,cal-done,guests-stepper-button,guests-age-select,guests-done. CSS does not allow the structural ones after a part —:first-child,:nth-child(),:emptymatch nothing. ::beforeand::afterafter a part are allowed by CSS:::part(cal-done)::before. The generated box is laid out by the piece it is in. Incal-day, a column, it becomes one more item in that column.- Nothing inside a part can be selected.
::part(cal-day) spanand::part(cal-day)::part(cal-day-price)match nothing: CSS has no way from one part into another. So “the price inside a chosen day” has no selector; usecolor: inheritoncal-day-priceand colour the day. - Your own
@keyframeswork in a part rule. By CSS’s rules an animation name is looked up in the stylesheet that holds the rule — yours. This is the browser’s behaviour, and our tests do not cover it: check the browsers your site supports. - A state name and
:hover. A chosen day iscal-dayandcal-day-selectedat once. Two rules with the same weight are decided by their order, so write the state’s rule after the general one. A pseudo-class adds weight:::part(cal-day):hoverbeats a plain::part(cal-day-selected), in any order. Give the state its own hover rule. - The dark look only. Add the attribute to the same element:
[data-pms-booking-overlay][data-pms-theme="dark"]::part(…).
/* every day, then one state, then that state under the pointer */[data-pms-booking-overlay]::part(cal-day):hover { background: #efe8d8;}[data-pms-booking-overlay]::part(cal-day-selected) { background: #1d3b36;}[data-pms-booking-overlay]::part(cal-day-selected):hover { background: #16302c;}
/* a keyboard ring on a day */[data-pms-booking-overlay]::part(cal-day):focus-visible { outline: 2px solid #8a6d1f;}
/* one piece, in the dark look only */[data-pms-booking-overlay][data-pms-theme="dark"]::part(cal-sheet) { border: 1px solid #2c3a36;}Our tests cover that every listed name is reached from the page through this element, that no other name exists, that a part rule beats the component’s own styles, and :hover on a part. The rest of the list above is CSS itself.
Recipes
Five short complete stylesheets. Paste one into your site’s stylesheet and change the values.
Your brand colour only
One line. The filled buttons, the chosen dates, the badges and the links take your colour; everything else stays the property’s branding.
:root { --pms-primary: #0f5c4d;}Sharp and editorial
Square corners, black lines, a serif for headings, uppercase tracked buttons and no shadows.
:root { --pms-primary: #111111; --pms-primary-foreground: #ffffff; --pms-border: #111111; --pms-input: #111111; --pms-radius: 0px; --pms-font: "Inter", Arial, sans-serif; --pms-heading-font: "Playfair Display", Georgia, serif; --pms-shadow-color: transparent; --pms-heading-weight: 400; --pms-button-weight: 500; --pms-button-transform: uppercase; --pms-button-letter-spacing: 0.12em;}Soft and round
Large corners, pill buttons, a warm ground, a round typeface and a tinted shadow.
:root { --pms-primary: #e07a5f; --pms-primary-foreground: #ffffff; --pms-background: #fdf6f0; --pms-card: #ffffff; --pms-muted: #f6e7dc; --pms-border: #f0dccd; --pms-input: #e9cdb9; --pms-radius: 16px; --pms-font: "Nunito", Verdana, sans-serif; --pms-shadow-color: rgb(224 122 95 / 0.18); --pms-button-radius: 32px; --pms-card-radius: 24px;}On a dark page
A dark palette set once on :root. It replaces the colours of both the light and the dark look, so the components are dark whatever the script tag says.
:root { --pms-primary: #e8c170; --pms-primary-foreground: #14171a; --pms-background: #0e1113; --pms-foreground: #f2efe9; --pms-card: #171b1e; --pms-muted: #20262a; --pms-muted-foreground: #9aa3a8; --pms-border: #2a3136; --pms-input: #3a434a; --pms-ring: #e8c170; --pms-error: #ff8a80; --pms-input-bg: #101416; --pms-shadow-color: rgb(0 0 0 / 0.5); --pms-overlay: rgb(0 0 0 / 0.7);}Dense, for a sidebar
Tighter spacing with lower fields and buttons, smaller text and smaller corners, for a narrow column.
:root { --pms-radius: 6px; --pms-font: "Inter", Arial, sans-serif; --pms-button-weight: 500; --pms-text-scale: 0.9; --pms-density: 0.8;}Fonts
--pms-font, --pms-heading-font and --pms-button-font take a font-family list. On your own page any font your site loads works.
Our frames can show only the fonts in the table below. A font outside it is skipped there and the next name in your list is used, so always end the list with a common fallback; with no listed font among them the branding’s font stays. Only the first 6 names of a list are read there, and a list longer than 200 characters is ignored there.
:root { --pms-font: "Your Site Font", "Lora", Georgia, serif;}Your page shows the first font. Our frames skip it and show Lora.
| Kind | Fonts our frames can show |
|---|---|
| Sans-serif | Manrope, Inter, Roboto, Open Sans, Noto Sans, Poppins, Montserrat, Lato, Nunito, Raleway, DM Sans, Plus Jakarta Sans, Geist, Rubik, Work Sans, Source Sans 3, Mulish, Jost, Exo 2, IBM Plex Sans, PT Sans, Fira Sans, Onest, Lexend, Sora, Urbanist, Outfit, Space Grotesk, Oxanium |
| Serif | Playfair Display, Merriweather, Lora, PT Serif, Noto Serif, Source Serif 4, Libre Baskerville, EB Garamond, Crimson Text, Bitter |
| Display | Bebas Neue, Righteous, Fredoka, Comfortaa, Unbounded, Lobster, Pacifico |
| Handwriting | Dancing Script, Caveat, Kalam, Patrick Hand |
| Monospace | Geist Mono, JetBrains Mono, Fira Code, Source Code Pro, IBM Plex Mono, Roboto Mono, Space Mono, Ubuntu Mono, Inconsolata, Anonymous Pro |
| System and generic | Arial, Helvetica, Georgia, Times New Roman, Verdana, Tahoma, Trebuchet MS, Courier New, Segoe UI, Roboto, -apple-system, BlinkMacSystemFont, serif, sans-serif, monospace, cursive, fantasy, system-ui, ui-serif, ui-sans-serif, ui-monospace, ui-rounded, emoji, math, fangsong |
Inside the card number, expiry and CVC fields the colours of the text, the placeholder and an error follow --pms-foreground, --pms-muted-foreground and --pms-error, and the box around each field — its line, corners and fill — is ours and follows the general variables too. Those three fields are the payment provider’s own documents: they follow no other variable on this page — not the field variables, not the text size — and they load no fonts, so of your --pms-font list the first font installed on the guest’s device shows.
Light and dark
One value covers both the light and the dark look. To give the dark look a value of its own, set the variable again under [data-pms-theme="dark"] — our components on your page carry that attribute while they show dark, and our frames receive the dark value with it.
[data-pms-theme="dark"] { --pms-background: #101615; --pms-foreground: #f3ead8; --pms-card: #18211f; --pms-border: #2c3a36;}That selector is for variables. A ::part() rule for the dark look alone is written on the overlay element: [data-pms-booking-overlay][data-pms-theme="dark"]::part(…) — see How a part rule works.
A switch between light and dark — a guest’s pick, setTheme(), or your page’s own switch under data-theme="page" — repaints the components on your page and is told to our frames at once. No refresh() is needed.
When every colour is set
One value covers both looks, so a site that sets every colour variable on :root shows the same colours whether the script tag says light or dark. A few things still follow the look, because no variable holds them:
- Fields and outline buttons get a faint fill — a tint of the field’s line colour — that the light look does not have.
--pms-input-bgsets the fill of a field in both looks. - Our frames are told the look is dark, and what no variable of yours covers there — the card-brand marks by the payment form, for one — follows it.
- Your own rules under
[data-pms-theme="dark"]apply, for variables and for parts.
So set data-theme to the look your palette really is — the dark recipe with data-theme="dark".
Where to put it
On :root, in your site’s own CSS, on every page that shows a component.
Not on our <div>: the calendar and the guests panel open over your page, outside that box — in an element of ours at the end of <body> — and would keep the branding.
Two parts are drawn in frames of ours inside your page: the step with the guest’s details and the card payment, and the guest account area. Both follow these variables — your values are read on your page and handed over to them — with the limits below.
Changing a variable while the page is open
On your page the components read your variables the way any CSS reads a custom property: by inheritance. A new value on :root shows at once.
One case can need a moment. For most variables beyond the basic palette, one that was not set at all and now is — or was set and is gone — is noticed only when the script looks again. It looks again when an attribute of <html> or <body> changes (a class, a data-* attribute, an inline style: what a theme switch writes), when the device’s colour scheme changes, when the window has loaded, on a switch between light and dark, and on pmsBooking.refresh(). A variable that appears inside a media query as the window is resized, or with a stylesheet swapped in, changes no attribute: call refresh().
Our frames cannot inherit. They are sent your values when they open and again at those same moments, only if something changed. Between them a frame keeps what it was last sent.
Animating a variable is not supported. A @keyframes rule on :root that changes a --pms-* value is carried on your page only as far as CSS inheritance carries it — and CSS flips a plain custom property from one keyframe to the next, it does not blend it. Nothing sends the moving value to the frames: they keep the value read at one of the moments above, whichever it happened to be. Our tests do not cover it. To make something of your own blink, animate your own element; to animate a piece of the calendar or the guests panel, animate the part.
Values, and what happens to a wrong one
A colour may be written any way CSS allows on your page: hex, rgb(), hsl(), oklch(), a named colour or another variable.
On your own page any radius works. In our frames a radius above 32px is taken as 32px, the nearest value they allow. A percentage is not carried over — the branding’s corners stay there; rem and em are.
In the details-and-payment step and the guest account area a colour for text — the foregrounds, the heading, price, button, field and badge text, an error — must be at least half opaque; a fainter one is ignored there and the branding’s colour stays. A fill or a line may be as faint as you like: --pms-button-bg: transparent is carried to the frames like any other colour.
A variable with an empty value or the wrong kind of value — a length where a colour belongs, a colour as a radius — makes that one property take the browser’s starting value on your own page: no fill, a square corner. Our frames keep the branding, because such a value is never handed over.
A weight between two hundreds, such as 550 with a variable font, shows as written on your page and as the nearest hundred — 600 — in our frames.
A number, a line width or a letter-spacing outside the range our frames take works as written on your own page and is taken as the nearest allowed value in the frames: --pms-density: 0.5 is 0.75 there, so the whole booking still follows your choice. On a phone, the text typed into a field of the details-and-payment step stays 16px whatever --pms-text-scale says.
What you cannot change
- The order and the layout of the booking steps.
- The round icon controls: no radius variable reaches them. The calendar’s arrows are not among them — their corners follow
--pms-radiusand--pms-cal-radius. - The text inside the card number, expiry and CVC fields, beyond its colour.
- The card-brand marks by the payment form.
- The details-and-payment step and the guest area beyond the variables above: no other CSS of yours reaches them.
Only the --pms-* variables on this page and the ::part() names of the calendar and the guests panel reach the engine. Any other rule in your stylesheet — on the page, on our box, on the overlay element, with !important — has no effect inside it. A custom property of your own does nothing by itself; it can only be read by you, with var(), inside a part rule.