Dark mode

The parts of `mantra_starter` that do not follow the color scheme yet, from the dark mode task. Every section is rendered twice, in a panel that sets `color-scheme: light` on itself and in one that sets `color-scheme: dark`. Each `light-dark()` in the theme resolves against the color scheme of the element it paints, so the panels switch whatever mode the page is in, and whatever stays light in the dark panel is a color the theme still writes down as a literal. Each section names the file and the lines it comes from. The sections for Calendar, Calendar View, FullCalendar, DRD and bpmn.io appear only where those modules are installed. Layout Builder, the toolbar and Coffee are on the list too, but are left out: they style an interface of their own module, which is on the page wherever that module runs. The FullCalendar section loads FullCalendar from unpkg, as FullCalendar View does when the library is not in `/libraries`.

Status messages

`libraries/drupal/messages.css` starts with an `@import` of the messages stylesheet of core starterkit_theme, which writes every message color down as a hex: the light green, yellow and red grounds stay light under a dark color scheme. The theme has no `--color-error`, `--color-warning` or `--color-info` token for them to use instead.

color-scheme: light

Status message

The configuration options have been saved.

Warning message

There are unsaved changes on this page.

color-scheme: dark

Status message

The configuration options have been saved.

Warning message

There are unsaved changes on this page.

Form errors

`libraries/global/component/form.css` marks an errored field with `border: 2px solid red` and nothing else -- an off-palette red, the same in both schemes, at 4:1 on white. The required asterisk beside the label uses the accent token and does switch. The message under each field is printed by the Inline Form Errors module, which this site does not run, so the fields look as they do on a real form here: the border, and the message at the top of the page.

color-scheme: light

color-scheme: dark

Buttons, file input and blockquote

`libraries/global/base/elements.input.css` draws the file input button border (line 149) and the blockquote rule (line 162) in `--color-dark`, a fixed `#444`, which is faint on a dark ground.

color-scheme: light

A blockquote, with the rule along its start edge.

color-scheme: dark

A blockquote, with the rule along its start edge.

Selected table row

`libraries/global/component/tableselect.css:9` paints the cells of a selected row `#ffc`, a pale yellow that stays pale on a dark ground and takes the text color of the page with it -- light text on a light row. The second row is selected.

color-scheme: light

Title Status
First article Unpublished
Second article Published
Third article Unpublished

color-scheme: dark

Title Status
First article Unpublished
Second article Published
Third article Unpublished

To-do list

`libraries/global/component/todo-list.css:46` grays out the description of a done item in `--color-dark`, which on a dark ground reads darker than the open items rather than dimmer. The markup is what the to-do list plugin of the editor saves.

color-scheme: light

color-scheme: dark

Unpublished content

`libraries/drupal/node.css:11-12` marks an unpublished node with an outline and a background of `--color-unpublished`, which is `--color-lighter`, a fixed `#eee`: barely visible on white, and a bright slab on a dark ground. Media and paragraphs print an `--unpublished` class of their own, and neither is styled.

color-scheme: light

color-scheme: dark

Progress bar

`libraries/drupal/progress.css:4-8` gives the track a `#b3b3b3` border and a light gradient from `#e7e7df` to `#f0f0f0`, so the track stays a light bar on a dark ground.

color-scheme: light

Importing content
60%
Processed 60 of 100 items.

color-scheme: dark

Importing content
60%
Processed 60 of 100 items.

Password strength

`libraries/drupal/user.css` has the only red, amber and green scale in the theme: the indicator levels (lines 11-23), a `#b4b4b4` border on the suggestions (line 38), and `#325e1c` and `#a51b00` for the confirmation message (lines 58 and 62), both too dark to read on a dark ground. The meter itself is `--color-lighter`. The markup is what `user.js` writes into the password widget.

color-scheme: light

Password strength: Weak
Password strength: Fair
Password strength: Good
Password strength: Strong
Passwords match: yes
Passwords match: no
Recommendations to make your password stronger:
  • Make it at least 12 characters
  • Add punctuation

color-scheme: dark

Password strength: Weak
Password strength: Fair
Password strength: Good
Password strength: Strong
Passwords match: yes
Passwords match: no
Recommendations to make your password stronger:
  • Make it at least 12 characters
  • Add punctuation

Tabledrag changed marker

`libraries/drupal/tabledrag.css:84` colors the asterisk that marks a moved row `#734c00`, a dark amber that disappears on a dark ground. The warning beside it is message markup, and so has the problem of the messages above. The full widget is on the tabledrag example.

color-scheme: light

A moved row *

color-scheme: dark

A moved row *

Module requirements

`libraries/drupal/system-admin.component.css:369-376` writes the requirement lines of the module list in `#666`, with `#080` for a module that is enabled and `#f00` for one that is missing -- the green and the gray both lose most of their contrast on a dark ground.

color-scheme: light

Requires: Views (enabled), Search API (missing)
Required by: Mantra Examples

color-scheme: dark

Requires: Views (enabled), Search API (missing)
Required by: Mantra Examples

Block layout

`libraries/drupal/block-admin.theme.css` labels each region of the block demonstration in black on `#ff6` (lines 22-23), which reads in both schemes but ignores them, and lays a disabled block row on `#fcfcfa` (line 52), a near-white bar under light text in the dark scheme.

color-scheme: light

Sidebar first
Block Region
Main navigation Header
Powered by Drupal (disabled) Footer

color-scheme: dark

Sidebar first
Block Region
Main navigation Header
Powered by Drupal (disabled) Footer