Yeti with Web Awesome
Web Awesome is a full set of finished components, each one sealed. Yeti lays out the page and styles everything around them. This page takes one form apart to show the seam, then shows two things the pair does well.
Who does what
| Part of the page | Yeti | Web Awesome | The bridge |
|---|---|---|---|
| Layout and spacing between things | Yes | ||
| Text, headings, links, tables | Yes | ||
| Your own fields, buttons and cards | Yes | ||
What is inside a wa- tag |
Yes | ||
| Its label, hint, keyboard and popup | Yes | ||
| Its color, corners, height and type | Yes | ||
Anything you put inside a wa- tag |
Yes |
What to load
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@awesome.me/[email protected]/dist-cdn/styles/themes/default.css">
<link rel="stylesheet" href="yeti.css">
<link rel="stylesheet" href="bridge.css">
<script type="module" src="https://cdn.jsdelivr.net/npm/@awesome.me/[email protected]/dist-cdn/webawesome.loader.js"></script>
<script type="module" src="yeti.js"></script>
The order matters. Web Awesome's theme sets a font, a text color and a color scheme for the whole page, in its own cascade layers. Linked after Yeti, those layers win: a visitor in dark mode gets a light page in Web Awesome's font. Linked before, they rank below Yeti's, and the page stays yours.
Load the theme only. Web Awesome also has a bundle with styles for bare elements and layout utilities. Yeti already does both, so leave them out.
The frames on this page also load this site's own theme, which is why they are teal. You do not need it.
One form, taken apart
A plant record. Yeti has the text field and the button. It has no tag input, no star rating and no color picker.
Step 1: Yeti alone
View Code
<form class="stack" data-gap="md">
<div class="field">
<label for="plant-name">Plant</label>
<input id="plant-name" value="Sea holly">
</div>
<!-- tags, a rating and a color go here -->
<p><button class="button" type="button">Save plant</button></p>
</form>Step 2: the library added
Three tags fill the gap. They work, and they look like Web Awesome: the tag input is a little taller than the field above it, its type is smaller, and the corners and the line color are not the same. The hint is nearer the box, and the tags are gray.
For a visitor in dark mode it is worse than a mismatch. Web Awesome waits for its own switch, so its parts stay light on Yeti's dark page, and their labels all but vanish. If your screen is in dark mode you are looking at it now.
View Code
<form class="stack" data-gap="md">
<div class="field">
<label for="plant-name">Plant</label>
<input id="plant-name" value="Sea holly">
</div>
<wa-tag-input label="Tags" hint="Type a word and press Enter." value="coastal,full sun" delimiter=","></wa-tag-input>
<div class="cluster" data-gap="lg" data-align="start">
<div class="stack" data-gap="xs">
<strong>How it did this year</strong>
<wa-rating label="How it did this year" value="4"></wa-rating>
</div>
<wa-color-picker label="Flower color" value="#6a7bd6"></wa-color-picker>
</div>
<p><button class="button" type="button">Save plant</button></p>
</form>Step 3: the bridge added
The markup has not changed. One stylesheet has been added, and the tag input now has the same height, corners, line, fill and type as the Yeti field. It is the same in dark, with no second switch, because every value the bridge passes over is a Yeti token that already knows about both.
Step 4: who owns what
Solid lines are Yeti. Dashed lines are Web Awesome. The rating has no visible label of its own, so its heading is yours, and Yeti's.
What crosses the bridge: line color, corner radius, control height, type size and face, focus color, the five hues.
Things to take from it:
- Do not wrap a
wa-control in Yeti'sfield. It brings its own label and hint, and ties them to the control for a screen reader. Yeti'sfielddoes that job for a nativeinput. - Let Yeti do the space around it. The tag input is a child of a
stacklike any other, so it takes the stack's gap. - Yeti cannot reach in, and does not need to. There is an
inputinside the tag input. Yeti's rules forinputstop at the shadow root. What you see there is Web Awesome, reading values through the bridge.
Their stepper, your panels
The stepper at the top is Web Awesome's. It knows which step is current, draws the markers and the line, and announces the change. That is all it does. The three panels under it, and both buttons, are Yeti on your page.
The buttons are plain button class="button". An attribute, data-stepper="next setup", tells Web Awesome to move the stepper when one is pressed, so a Yeti button drives their component with nothing in between. Going the other way, the stepper reports each change with an event, and a short script of yours shows the matching panel.
The setup code and the six boxes are two more of theirs. Neither needed anything the bridge did not already carry, and the current step's marker is the same color as the button.
View Code
<div class="stack" data-gap="lg">
<wa-stepper id="setup" active="scan" orientation="auto" label="Two-step sign-in">
<wa-step name="scan">Scan</wa-step>
<wa-step name="code">Code</wa-step>
<wa-step name="name">Name</wa-step>
</wa-stepper>
<section class="stack" data-gap="sm" data-panel-for="scan">
<h2>Scan the setup code</h2>
<p>Point your authenticator app at it.</p>
<div class="cluster"><wa-qr-code value="otpauth://totp/Example?secret=EXAMPLE" label="Setup code" size="120"></wa-qr-code></div>
</section>
<section class="stack" data-gap="sm" data-panel-for="code">
<h2>Type the code</h2>
<wa-otp-input label="The six digits it shows" length="6"></wa-otp-input>
</section>
<section class="stack" data-gap="sm" data-panel-for="name">
<h2>Name this device</h2>
<div class="field">
<label for="device">Device</label>
<input id="device" value="Work phone">
</div>
</section>
<div class="cluster" data-gap="sm">
<button class="button" type="button" id="back" data-emphasis="medium" data-stepper="previous setup">Back</button>
<button class="button" type="button" id="next" data-stepper="next setup">Continue</button>
</div>
<p id="status" role="status"></p>
</div><script type="module">
const stepper = document.querySelector('#setup');
const steps = [...stepper.children];
const panels = document.querySelectorAll('[data-panel-for]');
const back = document.querySelector('#back');
const next = document.querySelector('#next');
const status = document.querySelector('#status');
// The stepper says which step is current. Showing the panel is up to you.
const show = (name) => {
panels.forEach((panel) => { panel.hidden = panel.dataset.panelFor !== name; });
const at = steps.findIndex((step) => step.getAttribute('name') === name);
steps.forEach((step, i) => { step.completed = i < at; });
// Disabling the button a person just pressed would throw their focus away.
back.setAttribute('aria-disabled', at === 0);
status.textContent = '';
next.textContent = at === steps.length - 1 ? 'Turn it on' : 'Continue';
};
// Wait for it: if it never loads, all three panels stay in view.
await customElements.whenDefined('wa-stepper');
stepper.addEventListener('wa-step-change', (event) => show(event.detail.name));
next.addEventListener('click', () => {
if (stepper.active !== steps.at(-1).name) return;
steps.at(-1).completed = true;
status.textContent = 'Two-step sign-in is on.';
}, { capture: true });
show('scan');
</script>One small thing: a stack stretches its children, and the setup code is square, so stretching it makes it enormous. It sits in a cluster, which does not.
Yeti cards in their split panel
Drag the divider. At the start the first card has its picture beside the words; pull the divider in and the picture goes on top. Nobody told the card. A Yeti card measures its own box, so a pane that a person can drag is no different to it from a narrow screen.
The cards are put inside the panel, and they are still Yeti: what you slot into a sealed part keeps your page's styles. Web Awesome makes the panes, and Yeti makes what is in them answer. Neither does this alone.
View Code
<wa-split-panel position="60">
<div slot="start" class="box" data-gap="sm">
<article class="card" data-threshold="xs">
<img src="/yeti/trail.jpg" alt="A mountain trail at dawn">
<h3>Weekend in the hills</h3>
<p>Drag the divider. The picture moves beside the words when there is room.</p>
</article>
</div>
<div slot="end" class="box" data-gap="sm">
<article class="card">
<wa-comparison position="50">
<img slot="after" src="/yeti/valley.jpg" alt="A valley in color">
<img slot="before" src="/yeti/valley.jpg" alt="The same valley in black and white" class="mono">
</wa-comparison>
<h3>In color and without</h3>
<p>The comparison is Web Awesome. The card around it is Yeti.</p>
</article>
</div>
</wa-split-panel>wa-split-panel { --divider-width: 4px; --min: 20%; --max: 80%; }
wa-split-panel[orientation="vertical"] { block-size: 56rem; }
.mono { filter: grayscale(1); }<script type="module">
// A split panel does not stack itself. Yeti's layouts do, at their own width.
const panel = document.querySelector('wa-split-panel');
const narrow = matchMedia('(max-width: 30rem)');
const turn = () => { panel.orientation = narrow.matches ? 'vertical' : 'horizontal'; };
narrow.addEventListener('change', turn);
turn();
</script>The split panel itself does not stack when it runs out of room, so five lines of script turn it. The picture comparison in the second card is Web Awesome too.
A whole page
A picture library's card index, with the two working together all the way down the page. The layout, the type, the spacing, the color, the cards, the buttons, the badges, the switch and the caption field are Yeti. Seven parts are Web Awesome: the tree of guides, the split panel between the index and the card, and the drawer that opens from Edit card, which holds a tag input, a multiple select, a rating and a color picker.
Turn on Show the join and each of the seven takes a dashed outline.
It has a theme of its own, made of Yeti tokens, and its bridge points Web Awesome at them. So Web Awesome's parts take that theme's ink, rules and square corners, and with the join hidden it is hard to tell which library drew what.
Where both have it
Web Awesome has its own version of many Yeti parts. Pick one for each kind of thing, and use it all the way through.
Use Yeti's for:
- buttons, badges, cards, dividers: plain markup, there before any script runs
- text fields, checkboxes, switches, plain selects, a slider with one handle: native controls, with the browser's own keyboard, validation and phone keyboards
- dialogs, tabs, accordions, dropdowns, tooltips: little or no script, and the same markup as the rest of your page
- tables, breadcrumbs, pagination, progress, spinners: a component adds nothing
Use Web Awesome's for:
- tag inputs, color pickers, ratings, trees, steppers, split panels, toasts: Yeti has none
- a slider with two handles, or a select that takes many choices and shows them as tags: the native controls stop short of both
- a carousel that loops or plays by itself: Yeti's scrolls and snaps, and stops there
The bridge
All of it. Copy it into your own stylesheet, after both. It is about ninety lines, and half of them are one pattern repeated for five hues.
/* Web Awesome follows Yeti. Load after both stylesheets. */
:root {
/* Type */
--wa-font-family-body: var(--yeti-font-sans);
--wa-font-family-heading: var(--yeti-font-heading);
--wa-font-family-code: var(--yeti-font-mono);
--wa-font-size-m: var(--yeti-text-md);
--wa-font-weight-semibold: var(--yeti-weight-strong);
--wa-font-weight-bold: var(--yeti-weight-bold);
/* Surfaces and text */
--wa-color-surface-default: var(--yeti-color-surface);
--wa-color-surface-raised: var(--yeti-color-surface-raised);
--wa-color-surface-lowered: var(--yeti-color-surface-sunken);
--wa-color-surface-border: var(--yeti-color-border);
--wa-color-text-normal: var(--yeti-color-text);
--wa-color-text-quiet: var(--yeti-color-text-muted);
--wa-color-text-link: var(--yeti-link-color, var(--yeti-color-primary-line, var(--yeti-color-primary)));
--wa-color-focus: var(--yeti-color-focus);
/* Form controls */
--wa-form-control-border-color: var(--yeti-control-border);
--wa-form-control-background-color: var(--yeti-control-surface);
--wa-form-control-placeholder-color: var(--yeti-color-text-muted);
--wa-form-control-border-radius: var(--yeti-control-radius);
--wa-form-control-height: var(--yeti-control-size);
--wa-form-control-label-font-weight: var(--yeti-weight-strong);
/* Corners and lines */
--wa-border-radius-s: var(--yeti-radius-sm);
--wa-border-radius-m: var(--yeti-radius-md);
--wa-border-radius-l: var(--yeti-radius-lg);
--wa-border-width-s: var(--yeti-border-width);
/* The five hues. Yeti's alert is Web Awesome's danger. */
--wa-color-brand-fill-quiet: var(--yeti-color-primary-subtle);
--wa-color-brand-fill-normal: var(--yeti-color-primary-soft);
--wa-color-brand-fill-loud: var(--yeti-color-primary);
--wa-color-brand-border-quiet: var(--yeti-color-primary-soft);
--wa-color-brand-border-normal: var(--yeti-color-primary-soft);
--wa-color-brand-border-loud: var(--yeti-color-primary);
--wa-color-brand-on-quiet: var(--yeti-color-primary-text);
--wa-color-brand-on-normal: var(--yeti-color-primary-text);
--wa-color-brand-on-loud: var(--yeti-on-primary);
--wa-color-neutral-fill-quiet: var(--yeti-color-neutral-subtle);
--wa-color-neutral-fill-normal: var(--yeti-color-neutral-soft);
--wa-color-neutral-fill-loud: var(--yeti-color-neutral);
--wa-color-neutral-border-quiet: var(--yeti-color-neutral-soft);
--wa-color-neutral-border-normal: var(--yeti-color-neutral-soft);
--wa-color-neutral-border-loud: var(--yeti-color-neutral);
--wa-color-neutral-on-quiet: var(--yeti-color-neutral-text);
--wa-color-neutral-on-normal: var(--yeti-color-neutral-text);
--wa-color-neutral-on-loud: var(--yeti-on-neutral);
--wa-color-success-fill-quiet: var(--yeti-color-success-subtle);
--wa-color-success-fill-normal: var(--yeti-color-success-soft);
--wa-color-success-fill-loud: var(--yeti-color-success);
--wa-color-success-border-quiet: var(--yeti-color-success-soft);
--wa-color-success-border-normal: var(--yeti-color-success-soft);
--wa-color-success-border-loud: var(--yeti-color-success);
--wa-color-success-on-quiet: var(--yeti-color-success-text);
--wa-color-success-on-normal: var(--yeti-color-success-text);
--wa-color-success-on-loud: var(--yeti-on-success);
--wa-color-warning-fill-quiet: var(--yeti-color-warning-subtle);
--wa-color-warning-fill-normal: var(--yeti-color-warning-soft);
--wa-color-warning-fill-loud: var(--yeti-color-warning);
--wa-color-warning-border-quiet: var(--yeti-color-warning-soft);
--wa-color-warning-border-normal: var(--yeti-color-warning-soft);
--wa-color-warning-border-loud: var(--yeti-color-warning);
--wa-color-warning-on-quiet: var(--yeti-color-warning-text);
--wa-color-warning-on-normal: var(--yeti-color-warning-text);
--wa-color-warning-on-loud: var(--yeti-on-warning);
--wa-color-danger-fill-quiet: var(--yeti-color-alert-subtle);
--wa-color-danger-fill-normal: var(--yeti-color-alert-soft);
--wa-color-danger-fill-loud: var(--yeti-color-alert);
--wa-color-danger-border-quiet: var(--yeti-color-alert-soft);
--wa-color-danger-border-normal: var(--yeti-color-alert-soft);
--wa-color-danger-border-loud: var(--yeti-color-alert);
--wa-color-danger-on-quiet: var(--yeti-color-alert-text);
--wa-color-danger-on-normal: var(--yeti-color-alert-text);
--wa-color-danger-on-loud: var(--yeti-on-alert);
}
/* Web Awesome shares one radius between buttons and inputs. Yeti does not. */
wa-button::part(base) { border-radius: var(--yeti-button-radius); }
- Type. Yeti sizes
body, and Web Awesome sizes from the root, so without--wa-font-size-mits parts are smaller than the text around them. The rest of its type scale follows from that one line. - Surfaces and text. Yeti's three surfaces map straight across. The link color has a fallback because Yeti reads
--yeti-link-coloronly if you set it. - Form controls. Height, radius, line and fill. These four are why the tag input matches the field.
- Corners and lines. For everything that is not a form control.
- The five hues. Web Awesome asks for a fill, a border and a text color for each hue, at three strengths: quiet, normal and loud. Yeti's subtle, soft and base are the same idea. Only the names change, and Yeti's
alertis theirdanger. - The last rule. Web Awesome has one radius for buttons and inputs. Yeti has two, so the button's is set through its named part.
If you only use their form controls, you can leave out the success, warning and danger groups.
Limits
- The color picker opens upward when there is no room below, and is cut off if there is no room there either. Give it space.
- Their labels, hints and popups come from Web Awesome, so their wording and translations do too.
- Before the script loads, or if it never does, a
wa-tag shows only what you put inside it. An empty one shows nothing. The Yeti fields still work. - Screen readers were not tested.
Run on 24 November 2026 with Web Awesome 3.15.0 (MIT, free components only) and Yeti's current alpha, in Chromium, Firefox and WebKit, in light and dark, at 320 pixels, by keyboard, and with the network copy of Web Awesome blocked.