Skip to content
Permalink
Browse files
Add dark mode
  • Loading branch information
jiangtj committed May 11, 2020
1 parent 9af39a4 commit 8556fe6cb26e993c99805cd9b9d28d80039734b1
Showing 3 changed files with 20 additions and 7 deletions.
@@ -14,12 +14,12 @@
}

.moon-menu-cricle {
fill: #607d8b;
fill: var(--moon-cricle, #607d8b);
opacity: .9;
}

.moon-menu-border {
stroke: #607d8b;
stroke: var(--moon-cricle, #607d8b);
opacity: .9;
stroke-width: 1px;
fill: none;
@@ -30,7 +30,7 @@
.moon-menu-icon{
font-size: 2.5em;
line-height: 1.6em;
color: white;
color: var(--color, #fff);
text-align: center;
}

@@ -43,7 +43,7 @@
}

.moon-menu-text {
color: white;
color: var(--color, #fff);
font-weight: 400;
text-align: center;
line-height: 3.2em;
@@ -58,14 +58,14 @@
width: 2.5em;
height: 2.5em;
border-radius: 50%;
background-color: #000;
background-color: var(--moon-item-bg-color, #000);
opacity: 0;
display: block;
//display: none;
transition: all .3s cubic-bezier(0,0,.382,1.618);
z-index: -1;
text-align: center;
line-height: 2.5em;
color: white;
color: var(--color, #fff);
cursor: pointer;
}
@@ -0,0 +1,12 @@
.moon-menu {
--moon-cricle: #607d8b;
--color: #fff;
--moon-item-bg-color: #000;
}
@media (prefers-color-scheme: dark) {
.moon-menu {
--moon-cricle: #2b5278;
--color: #6c7883;
--moon-item-bg-color: #182533;
}
}
@@ -50,7 +50,8 @@ hexo.extend.filter.register('after_init', () => {
})
.sort((a, b) => a.order - b.order);

injector.register('style', join(__dirname, 'assets/moon-menu.styl'));
injector.register('variable', join(__dirname, 'assets/variables.styl'));
injector.register('style', join(__dirname, 'assets/styles.styl'));
injector.register('js', fs.readFileSync(join(__dirname, 'assets/moon-menu.js')).toString());
injector.register('bodyEnd', () => {
return cache.apply('cache', () => {

0 comments on commit 8556fe6

Please sign in to comment.