Skip to content

Commit

Permalink
Simplify dark mode implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
axelboc committed May 19, 2021
1 parent ff2a683 commit 6194637
Showing 1 changed file with 9 additions and 29 deletions.
38 changes: 9 additions & 29 deletions style/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,15 @@
}

body[data-jp-theme-light='false'] .h5web-root {
--black: var(--jp-inverse-layout-color0);
--near-black: var(--jp-inverse-layout-color0);
--dark-slate-gray: var(--jp-inverse-layout-color1);
--dark-gray: var(--jp-inverse-layout-color2);
--gray: var(--jp-inverse-layout-color2);
--light-gray: var(--jp-layout-color2);
--white: var(--jp-layout-color0);
--primary: var(--jp-brand-color1);
--primary-light: var(--jp-layout-color2);
--primary-dark: var(--jp-brand-color3);
--primary-bg: var(--jp-layout-color1);
--primary-light-bg: var(--jp-layout-color1);
--primary-light-bg-70: #212121b6;
--primary-dark-bg: var(--jp-layout-color3);
--secondary: var(--jp-brand-color3);
--secondary-light: var(--jp-brand-color1);
--secondary-lighter: var(--jp-layout-color4);
--secondary-dark: var(--jp-brand-color1);
--secondary-dark-15: #757575aa;
--secondary-darker: var(--jp-brand-color4);
--secondary-bg: var(--jp-layout-color1);
--secondary-light-bg: var(--jp-layout-color2);
--secondary-light-bg-90: #424242e5;
--btn-bg-raised: var(--jp-layout-color3);
--btn-shadow-color: var(--jp-layout-color2);
--btn-shadow-dark-color: var(--jp-layout-color1);
--btn-shadow-darker-color: var(--jp-layout-color0);
filter: invert();

/* Set shadows to lighter colors so they remain dark once inverted */
--btn-shadow-color: #f5f5f5;
--btn-shadow-dark-color: #fafafa;
--btn-shadow-darker-color: #fff;
}

.h5web-root .reflex-container > .reflex-splitter {
background: var(--secondary-bg);
body[data-jp-theme-light='false'] .h5web-root .no-invert,
body[data-jp-theme-light='false'] .h5web-root .no-invert-canvas > canvas {
filter: invert(); /* invert back to normal colors */
}

0 comments on commit 6194637

Please sign in to comment.