From 919258d5ebf60e24a2fb491741039b7261a7a7d7 Mon Sep 17 00:00:00 2001 From: Arno V Date: Tue, 12 Mar 2024 09:43:44 -0400 Subject: [PATCH] docs: better Dark mode explanation --- .../src/Styles/DarkMode.stories.tsx | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/packages/documentation/src/Styles/DarkMode.stories.tsx b/packages/documentation/src/Styles/DarkMode.stories.tsx index 706e05ae..3e2fcb7f 100644 --- a/packages/documentation/src/Styles/DarkMode.stories.tsx +++ b/packages/documentation/src/Styles/DarkMode.stories.tsx @@ -52,12 +52,16 @@ const CommonTemplate = () => { return ( <>

- Most components support a system mode which allows them to - toggle from dark to light colors automatically by relying on the + Most components support a system mode prop which allows + them to toggle from dark to light colors automatically by relying on the prefers-color-scheme CSS media feature. For special cases, there is aalt-system mode which is a toggled version of the system mode.

+

+ Additionally, some components also provide a focusMode prop + that is also set to system by default. +

Toggling dark mode manually

@@ -82,7 +86,9 @@ module.exports = {

Kitchen Sink

All the components rendered below have their mode sets to{" "} - system. + system by default, except for a few ones where we force the + mode to be different so that the contrast with the background is + accessible (see the Button in the TextInput for example).

@@ -118,7 +124,7 @@ module.exports = { label="Type your question here" helperText="Powered by the sun" rightElement={ - } @@ -126,7 +132,7 @@ module.exports = {
- +
Date @@ -184,7 +190,6 @@ module.exports = {
App Name v1.0.0
} row2={
something something
} /> @@ -194,7 +199,7 @@ module.exports = { }; export const Automatic: Story = () => ( - +

Automatic Dark Mode