Dojo NG is being built in the open, one section at a time — follow along on Heptapod.

API REFERENCE · UTILITIES

<dj-theme>

Scopes a theme to part of the page.

Set theme to light or dark. dj-theme sets data-dj-theme on itself, so the token rules in theme.css apply, and the tokens inherit into descendants and their shadow roots.

  • auto removes the attribute. The subtree then follows the surrounding theme, or the operating system setting at the page root.
  • Load theme.css once for the page.

Try it in the playground

@dojo-ng/theme · v0.1.2

npm install @dojo-ng/theme

import "@dojo-ng/theme";

Properties

PropertyAttributeTypeDefault
theme theme "light""dark""auto" "auto"

Slots

Default slot