guardian / guardian/dotcom-rendering

[Investigation] Darkmode for source components

Open
#9,333 0 comments 1 reaction 0 assignees View on GitHub
Team Candidate: WebX
Dominant language
TypeScript
Stars
274
Forks
34
Avg merge
2d 22h
Merged PRs (30d)
121

Description

The way AR did dark mode made it possible to only override source component styling for in dark mode (e.g in [ClickToView](https://github.com/guardian/dotcom-rendering/blob/main/apps-rendering/src/components/ClickToView/index.tsx#L99), we only add button styles for darkmode

In DCR we [require](https://github.com/guardian/dotcom-rendering/blob/main/dotcom-rendering/src/palette.ts#L110) both light and dark colour definitions.

This means for ClickToView in DCR when we overrode the values for dark mode, we [also had to override the values for light mode](https://github.com/guardian/dotcom-rendering/pull/9319/files#diff-973b637f2bb37c692210e98d51ead93e6335f53315f946d49e58e9380312a237R104-R105).

This was fine for the button, as the light palette was exposed from source, so if that ever updates in source, we should get the updated values in DCR.

However for other source components we might not get that benefit if the colours haven't been exported.
We could also end up with a lot of unnecessary duplication as we could feasibly end up redefining the light mode colours for a lot of the source components.

We should think about this, and decide if we're ok with the duplication, or if there are any other solutions

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.