From cee668d10a551d9bec6c3a960e36f8230a07ba16 Mon Sep 17 00:00:00 2001 From: Julien Deniau Date: Mon, 7 Apr 2025 10:38:26 +0200 Subject: [PATCH] Dark mode of console using `light-dark` --- src/createFormatters.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/createFormatters.js b/src/createFormatters.js index 293138d..f667518 100644 --- a/src/createFormatters.js +++ b/src/createFormatters.js @@ -1,10 +1,18 @@ +const orange = 'light-dark(rgb(232,98,0), rgb(255, 150, 50))'; +const purple = 'light-dark( #881391, #D48CE6)'; +const gray = 'light-dark(rgb(119,119,119), rgb(201, 201, 201))'; + const listStyle = {style: 'list-style-type: none; padding: 0; margin: 0 0 0 12px; font-style: normal; position: relative'}; -const immutableNameStyle = {style: 'color: rgb(232,98,0); position: relative'}; -const keyStyle = {style: 'color: #881391'}; -const defaultValueKeyStyle = {style: 'color: #777'}; -const alteredValueKeyStyle = {style: 'color: #881391; font-weight: bolder'}; -const inlineValuesStyle = {style: 'color: #777; font-style: italic; position: relative'} -const nullStyle = {style: 'color: #777'}; +const immutableNameStyle = { + style: `color: ${orange}; position: relative`, +}; +const keyStyle = { style: `color: ${purple}` }; +const defaultValueKeyStyle = { style: `color: ${gray}` }; +const alteredValueKeyStyle = { style: `color: ${purple}; font-weight: bolder` }; +const inlineValuesStyle = { + style: `color: ${gray}; font-style: italic; position: relative`, +}; +const nullStyle = { style: `color: ${gray}` }; export default function createFormatter(Immutable) {