Skip to content

Commit bf8c605

Browse files
committed
Toggle titlebar background color
1 parent b2c2df0 commit bf8c605

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232

3333
background-color: #f8f8f8;
3434
color: #484848;
35+
36+
transition: color 0.5s, background-color 0.5s;
3537
}
3638

3739
#title-bar.dark {

renderer.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ onload = () => {
3838

3939
// set dark theme if in home page
4040
if (webview.getURL().split('?')[0].split('#')[0].match(/https:\/\/hackmd.io\/$/)) {
41+
document.querySelector('#title-bar').className = 'dark';
4142
document.querySelector('navbar').className = 'dark';
4243
} else {
44+
document.querySelector('#title-bar').className = '';
4345
document.querySelector('navbar').className = '';
4446
}
4547

0 commit comments

Comments
 (0)