Skip to content
This repository was archived by the owner on Dec 23, 2023. It is now read-only.

Add initial version of dark mode support #40

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix styles for table add column and table add row
kgrosvenor committed Oct 10, 2022
commit eb410b50cd5f7ea78df1b99daa52b7971e00d35a
25 changes: 16 additions & 9 deletions admin/src/components/Wysiwyg/wrapper.js
Original file line number Diff line number Diff line change
@@ -7,13 +7,20 @@ const computeInterfaceModeStyle = () => {
let toolbarButtonHoverColor = 'white';
let selectionColor = '#e1f2ff';
let linkColor = 'initial';
let actionButtonFillColor = 'initial';

const darkModeDefaults = () => {
strapiTheme = 'dark';
interfaceModeTextColor = 'white';
toolbarButtonHoverColor = '#181826';
selectionColor = "#181826";
linkColor = '#7b79ff';
actionButtonFillColor = 'white';
}

if (strapiTheme) {
if (strapiTheme === 'dark') {
interfaceModeTextColor = 'white';
toolbarButtonHoverColor = '#181826';
selectionColor = "#181826";
linkColor = '#7b79ff';
darkModeDefaults()
}
if (strapiTheme === 'light') {
interfaceModeTextColor = 'black'
@@ -22,11 +29,7 @@ const computeInterfaceModeStyle = () => {
} else {
// Check what the browser settings are, strapi falls back onto this when there is no local storage
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
strapiTheme = 'dark';
interfaceModeTextColor = 'white';
toolbarButtonHoverColor = '#181826';
selectionColor = "#181826";
linkColor = '#7b79ff';
darkModeDefaults();
}
}

@@ -90,6 +93,10 @@ const computeInterfaceModeStyle = () => {
.ce-settings--opened svg {
fill: currentColor;
}

.tc-add-column svg:first-of-type, .tc-add-row svg:first-of-type {
fill: ${actionButtonFillColor};
}
`;
}