From c55e1f5de4301abd1fddddc958c8659df0e3e3f0 Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Wed, 21 Sep 2016 18:52:44 -0400 Subject: [PATCH] a lot of dark theme fixes --- client/modules/IDE/pages/IDEView.js | 300 +++++++++--------- client/styles/abstracts/_variables.scss | 4 + client/styles/base/_base.scss | 3 + client/styles/components/_console.scss | 3 + client/styles/components/_editor.scss | 8 + .../components/_p5-dark-codemirror-theme.scss | 42 +-- .../_p5-light-codemirror-theme.scss | 1 - client/styles/components/_resizer.scss | 10 +- client/styles/components/_sidebar.scss | 10 +- client/styles/components/_toolbar.scss | 2 + client/styles/layout/_ide.scss | 7 +- 11 files changed, 205 insertions(+), 185 deletions(-) diff --git a/client/modules/IDE/pages/IDEView.js b/client/modules/IDE/pages/IDEView.js index d989a015..5fb8f038 100644 --- a/client/modules/IDE/pages/IDEView.js +++ b/client/modules/IDE/pages/IDEView.js @@ -27,7 +27,6 @@ import SplitPane from 'react-split-pane'; import Overlay from '../../App/components/Overlay'; import SketchList from '../components/SketchList'; import About from '../components/About'; -import classNames from 'classnames'; class IDEView extends React.Component { constructor(props) { @@ -62,6 +61,8 @@ class IDEView extends React.Component { this.props.router.setRouteLeaveHook(this.props.route, () => this.warnIfUnsavedChanges()); window.onbeforeunload = () => this.warnIfUnsavedChanges(); + + document.body.className = this.props.preferences.theme; } componentWillUpdate(nextProps) { @@ -76,6 +77,10 @@ class IDEView extends React.Component { if (nextProps.params.project_id && !this.props.params.project_id) { this.props.getProject(nextProps.params.project_id); } + + if (nextProps.preferences.theme !== this.props.preferences.theme) { + document.body.className = nextProps.preferences.theme; + } } componentDidUpdate(prevProps) { @@ -157,164 +162,157 @@ class IDEView extends React.Component { } render() { - let ideClass = classNames({ - ide: true, - light: this.props.preferences.theme === 'light', - dark: this.props.preferences.theme === 'dark', - }); return ( -
-
- {this.props.toast.isVisible && } -