Slab
Slab

Overlays

Alert

An inline message that gets announced when it shows up. Put it on the page empty, then fill it in when there's something to say.

Element
<slab-alert>
Built on
[role=alert]

Example

Here's a styled version, <slab-styled-alert>. It's not in the package — it's an example of what you can build with the headless element. Copy it and make it yours at the bottom of this page. Switch to "As it ships" to see the same markup with the headless element and no CSS at all. That's your starting point.

Styled example As it ships
HTML
<button class="styled-button" type="button">
  Simulate a cold snap
</button>

<slab-styled-alert id="alert-example" dismissible></slab-styled-alert>
HTML
<button class="styled-button" type="button">
  Simulate a cold snap
</button>

<slab-alert id="alert-example-as-it-ships" dismissible></slab-alert>

Usage

Install
pnpm add slab-elements lit
ReactLitVueSvelteEmberHTML
import 'slab-elements/alert.js';

// Empty until there's a message, so it's announced when it arrives.
export function MyAlert({ message }) {
  return <slab-alert dismissible>{message}</slab-alert>;
}

MyAlert.jsx React 19 or later, which sets props on custom elements as properties.

import 'slab-elements/alert.js';
import { html, LitElement } from 'lit';
import { customElement, property } from 'lit/decorators.js';

@customElement('my-alert')
export class MyAlert extends LitElement {
  // Empty until there's a message, so it's announced when it arrives.
  @property()
  message = '';

  render() {
    return html`<slab-alert dismissible>${this.message}</slab-alert>`;
  }
}

my-alert.ts Slab is built on Lit, so its elements are at home in Lit's templates.

<script setup>
import 'slab-elements/alert.js';

// Empty until there's a message, so it's announced when it arrives.
defineProps(['message']);
</script>

<template>
  <slab-alert dismissible>{{ message }}</slab-alert>
</template>

MyAlert.vue Let Vue's compiler know slab- tags are custom elements with isCustomElement.

<script>
  import 'slab-elements/alert.js';

  // Empty until there's a message, so it's announced when it arrives.
  let { message = '' } = $props();
</script>

<slab-alert dismissible>{message}</slab-alert>

MyAlert.svelte Svelte binds properties and events to custom elements like any other element.

import 'slab-elements/alert.js';

// Empty until there's a message, so it's announced when it arrives.
export const MyAlert = <template>
  <slab-alert dismissible>{{@message}}</slab-alert>
</template>;

MyAlert.gjs Ember sets attributes, and a dynamic value like {{this.max}} sets the property when the element has one. {{on}} listens for any event by its name.

<script type="module">
  import 'slab-elements/alert.js';
</script>

<slab-alert dismissible></slab-alert>

<script type="module">
  document.querySelector('slab-alert').textContent =
    'Error: the file is too large';
</script>

index.html Any bundler (or an import map) takes care of the imports.

Behavior

An inline alert with no visual styles, around a [role=alert], so its message is announced when it appears.

Screenreaders announce what changes inside an alert, not what an alert already holds when the page loads. So put the alert on the page empty and slot the message in when there's something to say. A message that's in the markup from the start is read like any other text, if it's read at all. Replacing the message later announces the new one.

There's no severity. The old Inline Alert's variant only picked a color and an icon, and a severity is only announced if it's in the message, so put it there: "Error: the file is too large".

Style it through its parts. A dismissed alert is hidden, and stays hidden whatever display you give the host.

Dismissing with the button hides the button, which would drop focus to <body>. So when focus is on the button at the time, the alert returns it to the element that had it before the button did, provided that element is still on the page, outside the alert, and takes focus. Otherwise focus is left where the browser puts it. That includes a click in a browser that doesn't focus buttons on click, like Safari, and a button that was focused with nothing focused before it. Focus isn't moved when the "dismiss" event is canceled, or when a "dismiss" listener has already moved it off the button.

API

<slab-alert>

Attributes
Name Type Default Description
dismissible boolean false Adds a button that dismisses the alert
dismiss-label string The dismiss button's text and so its accessible name. "Dismiss" in English when unset.
Events
Name Type Description
dismiss Event When its dismiss button is pressed. Cancel it to keep the alert.
Slots
Name Type Description
(default) Element | string The message. Slot it in after the alert is on the page, so it's announced.
CSS parts
Name Description
alert The alert, around its text
dismiss-button The button that dismisses it

Copy and own it

<slab-styled-alert> isn't in the package. It's an example — copy it into your project and change whatever you want. Keyboard, focus, ARIA, forms, and events all come from the headless element, and the styles only reach in through ::part() and :state(), same as yours would.

ReactLitVueSvelteEmber

The same styles, written from outside the element, so there's nothing to subclass. The CSS styles every <slab-alert> on the page. Import tokens.css, the colors and fonts every styled example shares, once, wherever your global styles go.

Each component registers its headless element and imports its CSS. Use it like the element: its props are the element's attributes and properties.

Alert.jsx
import 'slab-elements/alert.js';
import './alert.css';

export function Alert(props) {
  return <slab-alert {...props} />;
}
alert.css
slab-alert {
  align-items: stretch;
  background-color: var(--ink);
  border-inline-start: 8px solid var(--ember);
  color: var(--paper);
  display: flex;
  font-family: var(--font-body);
  line-height: 1.5;
}

slab-alert:empty {
  background-color: transparent;
  border: 0;
}

slab-alert::part(alert) {
  flex-grow: 1;
  padding: 0.875rem 1rem;
}

slab-alert:empty::part(alert) {
  padding: 0;
}

/* With no message there's nothing to dismiss. */
slab-alert:empty::part(dismiss-button) {
  display: none;
}

slab-alert::part(dismiss-button) {
  background-color: transparent;
  border: 0;
  border-inline-start: 2px solid currentcolor;
  color: inherit;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  padding: 0 1rem;
  text-transform: uppercase;
  transition:
    background-color 100ms,
    color 100ms;
}

slab-alert::part(dismiss-button):hover {
  background-color: var(--paper);
  color: var(--ink);
}

/*
  Inside the button, so on the alert's own color, where ember falls short
  of 3:1 in the dark. The text's color always has the contrast.
*/
slab-alert::part(dismiss-button):focus-visible {
  outline: 3px solid currentcolor;
  outline-offset: -3px;
}

@media (prefers-reduced-motion: reduce) {
  slab-alert::part(dismiss-button) {
    transition: none;
  }
}
tokens.css
:root {
  /* Secondary text. 6.8:1 and 6.9:1 on paper. */
  --ash: var(--slab-styled-ash, light-dark(#5e5a55, #a8a19a));
  --border: 2px solid var(--ink);

  /* Behind disabled and read-only controls, and hovered rows. */
  --chalk: var(--slab-styled-chalk, light-dark(#f4f1ec, #2b2926));

  /*
    The logo's orange, brighter in the dark. 4.25:1 and 5.2:1 on paper is
    enough for borders, fills and large text, but not always for small text,
    which takes "--ember-deep".
  */
  --ember: var(--slab-styled-ember, light-dark(#d9492a, #ec5f3b));

  /*
    Orange for small text on paper, and for paper text on it. 5.7:1 and
    7.4:1.
  */
  --ember-deep: var(--slab-styled-ember-deep, light-dark(#b3381a, #ff8566));
  --font-body: var(
    --slab-styled-font-body,
    'IBM Plex Sans',
    system-ui,
    sans-serif
  );
  --font-display: var(
    --slab-styled-font-display,
    'Zilla Slab',
    rockwell,
    'Roboto Slab',
    serif
  );
  --font-mono: var(
    --slab-styled-font-mono,
    'IBM Plex Mono',
    ui-monospace,
    monospace
  );
  --ink: var(--slab-styled-ink, light-dark(#1c1c1c, #f4f1ec));
  --paper: var(--slab-styled-paper, light-dark(#fff, #1a1918));

  /* The hard, offset shadow a raised surface casts. */
  --shadow: 4px 4px 0 var(--ink);
}

/*
  Forced colors, such as Windows' contrast themes, replace every color that
  isn't a system color, so ember fills and paper marks all become the same
  background, and a checked Checkbox looks like an unchecked one. The palette
  becomes the user's system colors instead, which are kept. Ember is the
  highlight, the color of what's selected, and ember-deep, being for text and
  for paper text on it, is the text color.
*/
@media (forced-colors: active) {
  :host {
    --ash: GrayText;
    --chalk: Canvas;
    --ember: Highlight;
    --ember-deep: CanvasText;
    --ink: CanvasText;
    --paper: Canvas;
  }
}

Under the hood, it's just the headless element, subclassed, with styles set. That's it. To use it, copy these files, swap the tag in @customElement() for one of your own, and import it. tokens.styles.ts holds the colors and fonts every styled example shares, so you only need it once.

alert.ts
import { customElement } from 'lit/decorators.js';
import Alert from 'slab-elements/alert.js';
import styles from './alert.styles.js';
import tokens from './tokens.styles.js';

declare global {
  interface HTMLElementTagNameMap {
    'slab-styled-alert': StyledAlert;
  }
}

/**
 * Alert, styled: paper on ink, with a thick ember edge.
 *
 * An Alert goes on the page empty, and its message is slotted in later. Until
 * then it draws nothing, though it's still on the page for screenreaders to
 * find.
 */
@customElement('slab-styled-alert')
export default class StyledAlert extends Alert {
  static override styles = [tokens, styles];
}
alert.styles.ts
import { css } from 'lit';

export default css`
  :host {
    align-items: stretch;
    background-color: var(--ink);
    border-inline-start: 8px solid var(--ember);
    color: var(--paper);
    display: flex;
    font-family: var(--font-body);
    line-height: 1.5;
  }

  :host(:empty) {
    background-color: transparent;
    border: 0;
  }

  [part~='alert'] {
    flex-grow: 1;
    padding: 0.875rem 1rem;
  }

  :host(:empty) [part~='alert'] {
    padding: 0;
  }

  /* With no message there's nothing to dismiss. */
  :host(:empty) [part~='dismiss-button'] {
    display: none;
  }

  [part~='dismiss-button'] {
    background-color: transparent;
    border: 0;
    border-inline-start: 2px solid currentcolor;
    color: inherit;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    letter-spacing: 0.06em;
    padding: 0 1rem;
    text-transform: uppercase;
    transition:
      background-color 100ms,
      color 100ms;

    &:hover {
      background-color: var(--paper);
      color: var(--ink);
    }

    /*
      Inside the button, so on the alert's own color, where ember falls short
      of 3:1 in the dark. The text's color always has the contrast.
    */
    &:focus-visible {
      outline: 3px solid currentcolor;
      outline-offset: -3px;
    }

    @media (prefers-reduced-motion: reduce) {
      transition: none;
    }
  }
`;
tokens.styles.ts
import { css } from 'lit';

/*
  The styled components' palette and type, taken from the logo: ink for the
  courses, ember for the base, paper behind them.

  Each is a short alias for a "--slab-styled-*" property, with the default as
  its fallback. Retheming is "--slab-styled-ember" and the rest on ":root",
  which every shadow root inherits. Were the defaults declared under those
  names here instead, each host's own declaration would shadow the page's.

  Each default is "light-dark()", so the components follow the page's
  "color-scheme": "dark" for dark, "light" for light, and "light dark" to
  follow the operating system. Ink and paper trade places in the dark, so
  ink is always the text and paper always what's behind it. Contrast is given
  as light, then dark.
*/
export default css`
  :host {
    /* Secondary text. 6.8:1 and 6.9:1 on paper. */
    --ash: var(--slab-styled-ash, light-dark(#5e5a55, #a8a19a));
    --border: 2px solid var(--ink);

    /* Behind disabled and read-only controls, and hovered rows. */
    --chalk: var(--slab-styled-chalk, light-dark(#f4f1ec, #2b2926));

    /*
      The logo's orange, brighter in the dark. 4.25:1 and 5.2:1 on paper is
      enough for borders, fills and large text, but not always for small text,
      which takes "--ember-deep".
    */
    --ember: var(--slab-styled-ember, light-dark(#d9492a, #ec5f3b));

    /*
      Orange for small text on paper, and for paper text on it. 5.7:1 and
      7.4:1.
    */
    --ember-deep: var(--slab-styled-ember-deep, light-dark(#b3381a, #ff8566));
    --font-body: var(
      --slab-styled-font-body,
      'IBM Plex Sans',
      system-ui,
      sans-serif
    );
    --font-display: var(
      --slab-styled-font-display,
      'Zilla Slab',
      rockwell,
      'Roboto Slab',
      serif
    );
    --font-mono: var(
      --slab-styled-font-mono,
      'IBM Plex Mono',
      ui-monospace,
      monospace
    );
    --ink: var(--slab-styled-ink, light-dark(#1c1c1c, #f4f1ec));
    --paper: var(--slab-styled-paper, light-dark(#fff, #1a1918));

    /* The hard, offset shadow a raised surface casts. */
    --shadow: 4px 4px 0 var(--ink);
  }

  /*
    Forced colors, such as Windows' contrast themes, replace every color that
    isn't a system color, so ember fills and paper marks all become the same
    background, and a checked Checkbox looks like an unchecked one. The palette
    becomes the user's system colors instead, which are kept. Ember is the
    highlight, the color of what's selected, and ember-deep, being for text and
    for paper text on it, is the text color.
  */
  @media (forced-colors: active) {
    :host {
      --ash: GrayText;
      --chalk: Canvas;
      --ember: Highlight;
      --ember-deep: CanvasText;
      --ink: CanvasText;
      --paper: Canvas;
    }
  }
`;

The same styles, written from outside the element, so there's nothing to subclass. The CSS styles every <slab-alert> on the page. Import tokens.css, the colors and fonts every styled example shares, once, wherever your global styles go.

Each component registers its headless element and imports its CSS. Use it like the element: its props are the element's attributes and properties.

Alert.vue
<script setup>
import 'slab-elements/alert.js';
import './alert.css';
</script>

<template>
  <slab-alert><slot /></slab-alert>
</template>
alert.css
slab-alert {
  align-items: stretch;
  background-color: var(--ink);
  border-inline-start: 8px solid var(--ember);
  color: var(--paper);
  display: flex;
  font-family: var(--font-body);
  line-height: 1.5;
}

slab-alert:empty {
  background-color: transparent;
  border: 0;
}

slab-alert::part(alert) {
  flex-grow: 1;
  padding: 0.875rem 1rem;
}

slab-alert:empty::part(alert) {
  padding: 0;
}

/* With no message there's nothing to dismiss. */
slab-alert:empty::part(dismiss-button) {
  display: none;
}

slab-alert::part(dismiss-button) {
  background-color: transparent;
  border: 0;
  border-inline-start: 2px solid currentcolor;
  color: inherit;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  padding: 0 1rem;
  text-transform: uppercase;
  transition:
    background-color 100ms,
    color 100ms;
}

slab-alert::part(dismiss-button):hover {
  background-color: var(--paper);
  color: var(--ink);
}

/*
  Inside the button, so on the alert's own color, where ember falls short
  of 3:1 in the dark. The text's color always has the contrast.
*/
slab-alert::part(dismiss-button):focus-visible {
  outline: 3px solid currentcolor;
  outline-offset: -3px;
}

@media (prefers-reduced-motion: reduce) {
  slab-alert::part(dismiss-button) {
    transition: none;
  }
}
tokens.css
:root {
  /* Secondary text. 6.8:1 and 6.9:1 on paper. */
  --ash: var(--slab-styled-ash, light-dark(#5e5a55, #a8a19a));
  --border: 2px solid var(--ink);

  /* Behind disabled and read-only controls, and hovered rows. */
  --chalk: var(--slab-styled-chalk, light-dark(#f4f1ec, #2b2926));

  /*
    The logo's orange, brighter in the dark. 4.25:1 and 5.2:1 on paper is
    enough for borders, fills and large text, but not always for small text,
    which takes "--ember-deep".
  */
  --ember: var(--slab-styled-ember, light-dark(#d9492a, #ec5f3b));

  /*
    Orange for small text on paper, and for paper text on it. 5.7:1 and
    7.4:1.
  */
  --ember-deep: var(--slab-styled-ember-deep, light-dark(#b3381a, #ff8566));
  --font-body: var(
    --slab-styled-font-body,
    'IBM Plex Sans',
    system-ui,
    sans-serif
  );
  --font-display: var(
    --slab-styled-font-display,
    'Zilla Slab',
    rockwell,
    'Roboto Slab',
    serif
  );
  --font-mono: var(
    --slab-styled-font-mono,
    'IBM Plex Mono',
    ui-monospace,
    monospace
  );
  --ink: var(--slab-styled-ink, light-dark(#1c1c1c, #f4f1ec));
  --paper: var(--slab-styled-paper, light-dark(#fff, #1a1918));

  /* The hard, offset shadow a raised surface casts. */
  --shadow: 4px 4px 0 var(--ink);
}

/*
  Forced colors, such as Windows' contrast themes, replace every color that
  isn't a system color, so ember fills and paper marks all become the same
  background, and a checked Checkbox looks like an unchecked one. The palette
  becomes the user's system colors instead, which are kept. Ember is the
  highlight, the color of what's selected, and ember-deep, being for text and
  for paper text on it, is the text color.
*/
@media (forced-colors: active) {
  :host {
    --ash: GrayText;
    --chalk: Canvas;
    --ember: Highlight;
    --ember-deep: CanvasText;
    --ink: CanvasText;
    --paper: Canvas;
  }
}

The same styles, written from outside the element, so there's nothing to subclass. The CSS styles every <slab-alert> on the page. Import tokens.css, the colors and fonts every styled example shares, once, wherever your global styles go.

Import alert.js once, such as in your root layout, and use <slab-alert> as is. A Svelte component around it would take slot="…" content as its own slot and drop it.

alert.js
import 'slab-elements/alert.js';
import './alert.css';
alert.css
slab-alert {
  align-items: stretch;
  background-color: var(--ink);
  border-inline-start: 8px solid var(--ember);
  color: var(--paper);
  display: flex;
  font-family: var(--font-body);
  line-height: 1.5;
}

slab-alert:empty {
  background-color: transparent;
  border: 0;
}

slab-alert::part(alert) {
  flex-grow: 1;
  padding: 0.875rem 1rem;
}

slab-alert:empty::part(alert) {
  padding: 0;
}

/* With no message there's nothing to dismiss. */
slab-alert:empty::part(dismiss-button) {
  display: none;
}

slab-alert::part(dismiss-button) {
  background-color: transparent;
  border: 0;
  border-inline-start: 2px solid currentcolor;
  color: inherit;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  padding: 0 1rem;
  text-transform: uppercase;
  transition:
    background-color 100ms,
    color 100ms;
}

slab-alert::part(dismiss-button):hover {
  background-color: var(--paper);
  color: var(--ink);
}

/*
  Inside the button, so on the alert's own color, where ember falls short
  of 3:1 in the dark. The text's color always has the contrast.
*/
slab-alert::part(dismiss-button):focus-visible {
  outline: 3px solid currentcolor;
  outline-offset: -3px;
}

@media (prefers-reduced-motion: reduce) {
  slab-alert::part(dismiss-button) {
    transition: none;
  }
}
tokens.css
:root {
  /* Secondary text. 6.8:1 and 6.9:1 on paper. */
  --ash: var(--slab-styled-ash, light-dark(#5e5a55, #a8a19a));
  --border: 2px solid var(--ink);

  /* Behind disabled and read-only controls, and hovered rows. */
  --chalk: var(--slab-styled-chalk, light-dark(#f4f1ec, #2b2926));

  /*
    The logo's orange, brighter in the dark. 4.25:1 and 5.2:1 on paper is
    enough for borders, fills and large text, but not always for small text,
    which takes "--ember-deep".
  */
  --ember: var(--slab-styled-ember, light-dark(#d9492a, #ec5f3b));

  /*
    Orange for small text on paper, and for paper text on it. 5.7:1 and
    7.4:1.
  */
  --ember-deep: var(--slab-styled-ember-deep, light-dark(#b3381a, #ff8566));
  --font-body: var(
    --slab-styled-font-body,
    'IBM Plex Sans',
    system-ui,
    sans-serif
  );
  --font-display: var(
    --slab-styled-font-display,
    'Zilla Slab',
    rockwell,
    'Roboto Slab',
    serif
  );
  --font-mono: var(
    --slab-styled-font-mono,
    'IBM Plex Mono',
    ui-monospace,
    monospace
  );
  --ink: var(--slab-styled-ink, light-dark(#1c1c1c, #f4f1ec));
  --paper: var(--slab-styled-paper, light-dark(#fff, #1a1918));

  /* The hard, offset shadow a raised surface casts. */
  --shadow: 4px 4px 0 var(--ink);
}

/*
  Forced colors, such as Windows' contrast themes, replace every color that
  isn't a system color, so ember fills and paper marks all become the same
  background, and a checked Checkbox looks like an unchecked one. The palette
  becomes the user's system colors instead, which are kept. Ember is the
  highlight, the color of what's selected, and ember-deep, being for text and
  for paper text on it, is the text color.
*/
@media (forced-colors: active) {
  :host {
    --ash: GrayText;
    --chalk: Canvas;
    --ember: Highlight;
    --ember-deep: CanvasText;
    --ink: CanvasText;
    --paper: Canvas;
  }
}

The same styles, written from outside the element, so there's nothing to subclass. The CSS styles every <slab-alert> on the page. Import tokens.css, the colors and fonts every styled example shares, once, wherever your global styles go.

Each component registers its headless element and imports its CSS. Use it like the element: its attributes and its content go to the element.

Alert.gjs
import 'slab-elements/alert.js';
import './alert.css';

export const Alert = <template>
  <slab-alert ...attributes>{{yield}}</slab-alert>
</template>;
alert.css
slab-alert {
  align-items: stretch;
  background-color: var(--ink);
  border-inline-start: 8px solid var(--ember);
  color: var(--paper);
  display: flex;
  font-family: var(--font-body);
  line-height: 1.5;
}

slab-alert:empty {
  background-color: transparent;
  border: 0;
}

slab-alert::part(alert) {
  flex-grow: 1;
  padding: 0.875rem 1rem;
}

slab-alert:empty::part(alert) {
  padding: 0;
}

/* With no message there's nothing to dismiss. */
slab-alert:empty::part(dismiss-button) {
  display: none;
}

slab-alert::part(dismiss-button) {
  background-color: transparent;
  border: 0;
  border-inline-start: 2px solid currentcolor;
  color: inherit;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  padding: 0 1rem;
  text-transform: uppercase;
  transition:
    background-color 100ms,
    color 100ms;
}

slab-alert::part(dismiss-button):hover {
  background-color: var(--paper);
  color: var(--ink);
}

/*
  Inside the button, so on the alert's own color, where ember falls short
  of 3:1 in the dark. The text's color always has the contrast.
*/
slab-alert::part(dismiss-button):focus-visible {
  outline: 3px solid currentcolor;
  outline-offset: -3px;
}

@media (prefers-reduced-motion: reduce) {
  slab-alert::part(dismiss-button) {
    transition: none;
  }
}
tokens.css
:root {
  /* Secondary text. 6.8:1 and 6.9:1 on paper. */
  --ash: var(--slab-styled-ash, light-dark(#5e5a55, #a8a19a));
  --border: 2px solid var(--ink);

  /* Behind disabled and read-only controls, and hovered rows. */
  --chalk: var(--slab-styled-chalk, light-dark(#f4f1ec, #2b2926));

  /*
    The logo's orange, brighter in the dark. 4.25:1 and 5.2:1 on paper is
    enough for borders, fills and large text, but not always for small text,
    which takes "--ember-deep".
  */
  --ember: var(--slab-styled-ember, light-dark(#d9492a, #ec5f3b));

  /*
    Orange for small text on paper, and for paper text on it. 5.7:1 and
    7.4:1.
  */
  --ember-deep: var(--slab-styled-ember-deep, light-dark(#b3381a, #ff8566));
  --font-body: var(
    --slab-styled-font-body,
    'IBM Plex Sans',
    system-ui,
    sans-serif
  );
  --font-display: var(
    --slab-styled-font-display,
    'Zilla Slab',
    rockwell,
    'Roboto Slab',
    serif
  );
  --font-mono: var(
    --slab-styled-font-mono,
    'IBM Plex Mono',
    ui-monospace,
    monospace
  );
  --ink: var(--slab-styled-ink, light-dark(#1c1c1c, #f4f1ec));
  --paper: var(--slab-styled-paper, light-dark(#fff, #1a1918));

  /* The hard, offset shadow a raised surface casts. */
  --shadow: 4px 4px 0 var(--ink);
}

/*
  Forced colors, such as Windows' contrast themes, replace every color that
  isn't a system color, so ember fills and paper marks all become the same
  background, and a checked Checkbox looks like an unchecked one. The palette
  becomes the user's system colors instead, which are kept. Ember is the
  highlight, the color of what's selected, and ember-deep, being for text and
  for paper text on it, is the text color.
*/
@media (forced-colors: active) {
  :host {
    --ash: GrayText;
    --chalk: Canvas;
    --ember: Highlight;
    --ember-deep: CanvasText;
    --ink: CanvasText;
    --paper: Canvas;
  }
}