Skip to content

Commit b3aa559

Browse files
committed
fix: improved dark theme
changed cards background color, and fixed editor on full screen mode. also fixed theme switch.
1 parent 5bb459f commit b3aa559

File tree

5 files changed

+50
-17
lines changed

5 files changed

+50
-17
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"patterns": [
2424
"src"
2525
],
26-
"extensions": "js,jsx"
26+
"extensions": "js,jsx,css"
2727
}
2828
},
2929
"scripts": {

src/App.css

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,12 @@
127127
}
128128

129129
.dark .card {
130-
background-color: #272727;
130+
background-color: #272727!important;
131+
}
132+
.dark .labels {
133+
color: #fff;
134+
background-color: #121212;
131135
}
132-
133136
.dark .search .ant-input, .dark .search .ant-btn {
134137
background-color: rgba(255, 255, 255, 0.1);
135138
color: #fff !important;
@@ -144,7 +147,7 @@
144147
}
145148

146149
.dark .ant-select-selection-item {
147-
background-color: #272727 !important;
150+
background-color: rgb(94, 94, 94) !important;
148151
border: #272727 !important;
149152
color: #fff;
150153
}
@@ -158,7 +161,7 @@
158161
background: #272727 !important;
159162
}
160163

161-
.dark .ant-select-selection-item-remove, .dark .ant-progress-circle .ant-progress-text, .dark .ant-radio-wrapper, .dark .ant-tabs, .dark .editor-toolbar button {
164+
.dark .ant-select-selection-item-remove, .dark .ant-progress-circle .ant-progress-text, .dark .ant-radio-wrapper,.dark .ant-checkbox-wrapper, .dark .ant-tabs, .dark .editor-toolbar button {
162165
color: #fff !important;
163166
}
164167

@@ -167,10 +170,42 @@
167170
background: #272727 !important;
168171
}
169172

170-
.dark .react-kanban-column, .dark .news-feed {
171-
background-color: #5e5e5e !important;
173+
.dark .react-kanban-column {
174+
background-color: #121212!important;
175+
}
176+
.dark .news-feed{
177+
background-color: #121212!important;
178+
border: none;
172179
}
173-
174180
.dark h2, .dark a {
175181
color: #fff !important
182+
}
183+
.dark .ant-tag{
184+
background-color: #5e5e5e;
185+
border-color: #5e5e5e !important;
186+
color: #fff !important;
187+
}
188+
.dark .ant-select-item-option{
189+
background-color: #473f46!important;
190+
color : #fff;
191+
}
192+
.dark .ant-select-item-option-active{
193+
background-color: #5e5e5e !important;
194+
}
195+
.ant-select-item-option-active:not(.ant-select-item-option-disabled) {
196+
background-color: #f5f5f5 !important;
197+
color: #5e5e5e !important;
198+
}
199+
.dark .CodeMirror-wrap, .dark .cm-link, .dark .editor-preview{
200+
background-color: #121212!important;
201+
color : #fff !important;
202+
}
203+
204+
.CodeMirror-fullscreen{
205+
z-index: 9999 !important;
206+
}
207+
208+
.dark .editor-toolbar.fullscreen {
209+
background-color: #121212!important;
210+
color: #fff!important;
176211
}

src/App.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ import Github from './components/misc/github';
1616
import Todo from './components/todo';
1717
import 'simplebar/dist/simplebar.min.css';
1818

19-
const { TabPane } = Tabs;
20-
19+
const { TabPane } = Tabs;
2120

2221
const App = () => {
2322
return (
@@ -51,8 +50,7 @@ const App = () => {
5150
</div>
5251
<div className="row mb-5">
5352
<Window size="col-md-12 mt-4 mb-5 card p-5">
54-
<News />
55-
53+
<News />
5654
</Window>
5755
</div>
5856
</div>

src/components/context/appContext.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ export const AppContext = React.createContext(null)
66
export function AppProvider({ children, ...rest }) {
77
let currentTheme = "light";
88
const [history, setHistory] = useState([])
9-
const [theme, setTheme] = useState(currentTheme)
9+
const [theme, setTheme] = useState(false)
1010

1111
useEffect(() => {
1212
chrome.storage.local.get('theme', (thm) => {
13-
setTheme(thm.theme ? thm.theme : currentTheme)
14-
document.body.classList.add(thm.theme ? thm.theme : currentTheme);
13+
let tm = thm.theme ? thm.theme : currentTheme
14+
setTheme(tm)
15+
document.body.classList.add(tm);
1516
});
1617
}, [])
1718

src/components/infobar/stats.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const Stats = () => {
1111
const [previousCpuInfo,setPreviousCpuInfo]= useState(false)
1212

1313
const {theme,switchTeme } = useApp()
14-
1514
// load memory and cpu usage from chrome apis
1615
const loadData = () => {
1716
chrome.system.memory.getInfo(function (info) {
@@ -57,7 +56,7 @@ const Stats = () => {
5756
<Progress width={50} type="circle" percent={memoryPercentage} />
5857
<label style={{ fontSize: 12 }} className="ms-3 me-3">Cpu used : </label>
5958
<Progress width={50} type="circle" percent={cpuPercentage} />
60-
<Switch onChange={switchTeme} className="ms-3 me-3" checkedChildren="🌙" unCheckedChildren="🌙" defaultChecked={theme !== "light"} />
59+
<Switch key={theme} onChange={switchTeme} className="ms-3 me-3" checkedChildren="🌙" unCheckedChildren="🌙" defaultChecked={theme !== "light"} />
6160
</div>
6261
:
6362
<div className="col-md-6 offset-md-6 text-end">

0 commit comments

Comments
 (0)