Once a set of dark mode decision tokens exists (see T360341), we need to update the tokens build process to generate both default and dark modes side by side. All assets need to be produced in all necessary formats.
Rough outline of what needs to happen here
When T360341 is complete, we'll have a new file in the Codex Design Tokens repo called modes/dark.json or something similar. That file should contain a subset of decision tokens relating to color with alternate values (chosen from existing option tokens) suitable for use on dark backgrounds.
At that point we can produce the dark mode output by doing the following:
- Call sd.extend() in build.js and pass in the default token files using include instead of source; then set source to an array which includes the dark mode file. This will ensure that the dark mode values override the default values.
- Inside the config for sd.extend(), re-define the "stylesheet" platform. The files array should contain one entry, with a destination of codex-dark.css (or whatever we want to call it). We need a filter here to filter out tokens so that only tokens with "dark" in the file path (or matching some some similar rule) get included.
We may also want to rename the "experimental" CSS variables file we currently produce to something like codex-light.css – this is the default value that should be loaded alongside the experimental Less variables file.