Yeti with small widgets
You do not need a whole set of components to fill one gap. These are small libraries that each do a single job. This page takes one apart to show the seam, then shows two more that meet Yeti in other ways.
Who does what
| Part of the page | Yeti | The widget | The bridge |
|---|---|---|---|
| Layout and spacing between things | Yes | ||
| Text, headings, links, tables | Yes | ||
| Your own fields, buttons and cards | Yes | ||
| The label above a widget | Yes | ||
| The widget itself: keys, state, popup | Yes | ||
| Its color, corners, height and type | Yes |
Each of the three examples has a different kind of seam. Choices.js is open: it builds plain elements on your page. Cally is sealed: its parts are in shadow roots. PhotoSwipe adds an overlay at the end of body.
What to load
Only the widget you want. This is all of it for Choices.js:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/public/assets/styles/choices.min.css">
<link rel="stylesheet" href="yeti.css">
<link rel="stylesheet" href="bridge.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/public/assets/scripts/choices.min.js"></script>
<script type="module" src="yeti.js"></script>
Link the widget's own stylesheet first. Here the order between the two hardly matters: the stylesheets on this page are in no cascade layer, so they win over Yeti's layers either way. Your bridge comes after both. It has the same standing as theirs, so being last is what lets it win.
The frames on this page also load this site's own theme, which is why they are teal. You do not need it.
One field, taken apart
A planting record. Yeti has the text field, the button and a plain select. It has no select you can type into.
Step 1: Yeti alone
View Code
<form class="stack" data-gap="md">
<div class="field">
<label for="place">Bed</label>
<input id="place" value="South wall">
</div>
<div class="field">
<label for="plant" id="plant-label">Plant</label>
<select id="plant">
<option>Astrantia</option>
<option>Geum</option>
<option>Salvia</option>
<option selected>Sea holly</option>
<option>Thyme</option>
<option>Yarrow</option>
</select>
</div>
<p><button class="button" type="button">Save</button></p>
</form>This already works, on every phone, with no script. The widget will be built on top of it, so this is also what a visitor gets if the script never loads.
Step 2: the library added
The markup is the same. A script has hidden the select and drawn a control in its place, and the hidden select still holds the value your form sends.
The control is taller than the field above it, its fill is gray, its line is fainter and its corners are tighter. In dark mode it stays light, and its text all but vanishes. It also draws no focus ring, so a person on a keyboard cannot see where they are.
View Code
<form class="stack" data-gap="md">
<div class="field">
<label for="place">Bed</label>
<input id="place" value="South wall">
</div>
<div class="field">
<label for="plant" id="plant-label">Plant</label>
<select id="plant">
<option>Astrantia</option>
<option>Geum</option>
<option>Salvia</option>
<option selected>Sea holly</option>
<option>Thyme</option>
<option>Yarrow</option>
</select>
</div>
<p><button class="button" type="button">Save</button></p>
</form><script type="module">
// If it never loads, the select is still a select.
if (window.Choices) {
const plant = new Choices('#plant', { itemSelectText: '', shouldSort: false });
// It names its search box from the label, and forgets to name the control.
plant.containerOuter.element.setAttribute('aria-labelledby', 'plant-label');
}
</script>Step 3: the bridge added
The control now has the height, line, corners, fill and type of the field above it, in light and dark, and it has a focus ring.
Step 4: who owns what
Solid lines are Yeti. Dashed lines are Choices.js. The label is yours, and Yeti styles it as in any field.
What crosses the bridge: line color, corner radius, control height, type size, focus color, list color.
Things to take from it:
- Keep the
field. The widget replaces theselectand nothing around it, so the label, the gap and the hint stay where they were. - Keep the
for, and name the control yourself. Choices.js finds the label by itsforand names the search box with it, but leaves the control without a name. ItslabelIdoption does the reverse. The line of script after it names both. - Yeti reaches the search box. Open the list: the box you type in is a plain
inputinside afield. That is what an open boundary means, for better and for worse.
A sealed calendar
Cally draws a month and sends you a date. All of it is in shadow roots, so no rule of Yeti's gets in. The type is inherited, and the rest has to be handed over. Its arrows are two small pictures you slot in, and what you slot in stays yours.
<link rel="stylesheet" href="yeti.css">
<link rel="stylesheet" href="bridge.css">
<script type="module" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cally.js"></script>
<script type="module" src="yeti.js"></script>
It takes its look from two custom properties and from named parts. The chosen day is the same color as the button under it.
View Code
<div class="stack" data-gap="md">
<calendar-date id="day" value="2026-06-11" locale="en-GB">
<svg aria-label="Previous" slot="previous" viewBox="0 0 24 24" width="20"><path d="m15 5-7 7 7 7" fill="none" stroke="currentColor" stroke-width="2"/></svg>
<svg aria-label="Next" slot="next" viewBox="0 0 24 24" width="20"><path d="m9 5 7 7-7 7" fill="none" stroke="currentColor" stroke-width="2"/></svg>
<calendar-month></calendar-month>
</calendar-date>
<p id="chosen" role="status">Thursday 11 June</p>
<p><button class="button" type="button">Book this day</button></p>
</div><script type="module">
document.querySelector('#day').addEventListener('change', (event) => {
const day = new Date(event.target.value + 'T12:00');
document.querySelector('#chosen').textContent = day.toLocaleDateString('en-GB', { weekday: 'long', day: 'numeric', month: 'long' });
});
</script>The text under the calendar is a role="status" line, so the choice is announced as well as drawn.
A lightbox Yeti nudges
This one needs a fix, and it is the one to remember. Press a picture.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/photoswipe.css">
<link rel="stylesheet" href="yeti.css">
<link rel="stylesheet" href="bridge.css">
<script type="module" src="yeti.js"></script>
PhotoSwipe adds its overlay to the end of body. Yeti puts a space between the children of body, so a page of plain headings and paragraphs reads well with no classes. The overlay is one more child, so it gets the space too and sits a step too low. Yeti also spaces the children of a section, and PhotoSwipe's top bar is in one, so the bar sits a step lower again. One rule takes it off.
View Code
<div class="grid" data-gap="sm" id="gallery">
<a href="/yeti/ridge.jpg" data-pswp-width="1200" data-pswp-height="800"><img src="/yeti/ridge.jpg" alt="A ridge above cloud"></a>
<a href="/yeti/valley.jpg" data-pswp-width="1200" data-pswp-height="800"><img src="/yeti/valley.jpg" alt="A valley floor"></a>
<a href="/yeti/peak.jpg" data-pswp-width="1200" data-pswp-height="800"><img src="/yeti/peak.jpg" alt="A peak in snow"></a>
</div><script type="module">
import PhotoSwipeLightbox from 'https://cdn.jsdelivr.net/npm/[email protected]/dist/photoswipe-lightbox.esm.min.js';
new PhotoSwipeLightbox({
gallery: '#gallery',
children: 'a',
pswpModule: () => import('https://cdn.jsdelivr.net/npm/[email protected]/dist/photoswipe.esm.min.js'),
}).init();
</script>Expect this from any library that appends something to body: a lightbox, a toast, a menu that is moved to the end of the page. If an overlay sits a little too low, set its margin to zero.
The pictures are plain links to bigger pictures. With the script blocked, they still open.
Six jobs
Every one of these was run on a page with Yeti. The last column is all it took to match.
| Job | Library | To match Yeti |
|---|---|---|
| Searchable select | Choices.js 11.2.4 | 14 custom properties, 2 rules |
| Calendar | Cally 0.9.2 | 4 rules |
| Lightbox | PhotoSwipe 5.4.4 | 1 rule |
| Slider that loops | Swiper Element 14.4.0 | 1 line |
| Data grid | AG Grid Community 36.3.0 | 10 theme parameters |
| Color picker | vanilla-colorful 0.7.2 | Nothing |
Swiper's line is swiper-container { --swiper-theme-color: var(--yeti-color-primary); }. AG Grid's parameters each take a Yeti token, passed to themeQuartz.withParams.
A whole page
A glass school's prospectus and booking slip, with four widgets doing one job each: Cally for the range of nights, Choices.js for the color, Swiper for the pictures and PhotoSwipe for the plates. The rest is Yeti.
Turn on Printer's marks and each outside part takes a dashed outline and its name. Then choose a color on the slip. The choice changes one Yeti token, and the calendar's range, the list, the lightbox's caption and the button all follow it, because every bridge hands over the same tokens.
The page goes further than the bridges below, with round arrows, struck-out nights and swatches in the list, so its styles for each widget are longer. Every widget has plain markup underneath. With the libraries blocked the page still takes a booking: two date boxes, a native select, a row of photographs that scrolls, and links that open the pictures. The school and its prices are invented.
Where both have it
Use Yeti's for:
- a plain list of choices: a native
selectin afield, until the list is too long to read - a date somebody already knows, such as a birthday: a native date input in a
field - a row of slides that scrolls and snaps: Yeti's carousel
- a table people read: Yeti's table in a scroller
Use a widget for:
- a list long enough to search
- choosing a day by looking at the month, or a range of days
- pictures that open full size and zoom
- slides that loop, and rows of data people sort, filter and edit
The bridges
All of them. Copy the one you need into your own stylesheet, after both.
Choices.js
/* Choices.js follows Yeti. */
:root {
--choices-bg-color: var(--yeti-control-surface);
--choices-bg-color-dropdown: var(--yeti-color-surface-raised);
--choices-keyline-color: var(--yeti-control-border);
--choices-base-border: var(--yeti-border-width) solid;
--choices-border-radius: var(--yeti-control-radius);
--choices-text-color: var(--yeti-color-text);
--choices-highlighted-color: var(--yeti-color-primary-soft);
--choices-highlight-color: var(--yeti-color-focus);
--choices-font-size-lg: var(--yeti-text-md);
--choices-font-size-md: var(--yeti-text-md);
--choices-input-height: var(--yeti-control-size);
--choices-inner-padding: 0 var(--yeti-space-sm);
--choices-inner-one-padding: 0;
--choices-list-single-padding: 0;
}
.choices__inner { display: flex; align-items: center; box-sizing: border-box; }
.choices:focus-visible,
.choices__input:focus-visible { outline: 2px solid var(--yeti-color-focus); outline-offset: -2px; }
The two fill colors, the line and the corners are Yeti's control tokens, the ones a field uses. The paddings undo Choices.js's own, because the height comes from Yeti's control size. The first rule centers the text in that height. The second is the missing focus ring, on the closed control and on the search box.
Cally
/* Cally follows Yeti, through its two properties and its parts. */
calendar-month {
--color-accent: var(--yeti-color-primary);
--color-text-on-accent: var(--yeti-on-primary);
}
calendar-date::part(button) {
inline-size: var(--yeti-control-size);
block-size: var(--yeti-control-size);
border: var(--yeti-border-width) solid var(--yeti-control-border);
border-radius: var(--yeti-control-radius);
background-color: var(--yeti-control-surface);
color: inherit;
}
calendar-month::part(button) {
border-radius: var(--yeti-radius-sm);
font: inherit;
}
calendar-date::part(button):focus-visible,
calendar-month::part(button):focus-visible { outline: 2px solid var(--yeti-color-focus); outline-offset: 2px; }
The two properties color the chosen day. The first part rule turns the arrows into controls the size of a Yeti button. Do not set a color on the day buttons: it would override the chosen day's own.
PhotoSwipe
/* Yeti's spacing between siblings reaches PhotoSwipe's overlay. Take it off. */
.pswp, .pswp__top-bar { margin: 0; }
Limits
- Choices.js has no focus ring of its own, on the closed control or in its search box. Do not use it without the last rule of its bridge.
- PhotoSwipe is black in light and dark. It needs the width and height of each picture in the markup.
- Cally draws a calendar and nothing else. If you want a text box and a popup, they are yours to build: a Yeti field and a popover.
- Screen readers were not tested.
Run on 24 November 2026 with the versions above and Yeti's current alpha, in Chromium, Firefox and WebKit, in light and dark. The three live examples were also run at 320 pixels, by keyboard, and with the network copies blocked.