折腾一下博客夜间模式

折腾一下博客夜间模式

啊哈,与时俱进

小日子

2020.12.11

18 👣 #dark #css #scss #color

最近看到 GitHub 更新了黑暗模式(夜间模式),自己也心血来潮,给自己博客更新下样式。

本以为需要改的东西地方会很多,结果基本上就是在 SCSS 中设置好颜色变量,对需要改动的地方更新下新的颜色就行了,主要就是一些背景和文字的调和。

我目前是基于 prefers-color-scheme 这个 media query 来自动调用夜间模式的,黑白分明,也不会突然闪烁。

@media (prefers-color-scheme: dark) {
  // TO-DO, colors in dark mode
}

先上线试试,或许以后会增加访客设置选项,不知道如何设置更好,有建议的朋友可以留言交流下。

林宏

Frank Lin

Hey, there! This is Frank Lin (@flinhong), one of the 1.41 billion . This 'inDev. Journal' site holds the exploration of my quirky thoughts and random adventures through life. Hope you enjoy reading and perusing my posts.

YOU MAY ALSO LIKE

Sass 基础

Web Notes

2017.08.17

Sass 基础

该来的总会来,用到的时候总是要去学习的。Bootstrap 4 进入 Beta,就想着是不是要折腾一下博客模板,这次就试试用 Scss 来更新吧。

Syntax highlight with Rouge in Jekyll

Web Notes

2017.03.18

Syntax highlight with Rouge in Jekyll

By default, Jekyll 3 and versions above integrated with Rouge, a pure Ruby syntax highlighter which supports over 100 languages. Since Rouge themes are compatible with Pygments's stylesheets, it’s nice for us to choose a favourable style.

Setting up snap Nextcloud on Ubuntu

Tutorials

2019.12.05

Setting up snap Nextcloud on Ubuntu

Nextcloud, a fork of ownCloud, is a open-source file sharing server that allows you to store your personal content, like documents and pictures, in a centralized location, much like Dropbox. It also returns the control and security of your sensitive data back to you, thus eliminating the use of a third-party cloud hosting service. Here, I'm going to walk through the installing and configurations on Ubuntu 18.04 using the snappy packaging system.

戚氏·晚秋天

柳永「宋代」

晚秋天,一霎微雨洒庭轩。
槛菊萧疏,井梧零乱,惹残烟。凄然,望江关,飞云黯淡夕阳间。当时宋玉悲感,向此临水与登山。远道迢递,行人凄楚,倦听陇水潺湲。正蝉吟败叶,蛩响衰草,相应喧喧。

孤馆,度日如年。
风露渐变,悄悄至更阑。长天净,绛河清浅,皓月婵娟。思绵绵。夜永对景,那堪屈指暗想从前。未名未禄,绮陌红楼,往往经岁迁延。

帝里风光好,当年少日,暮宴朝欢。
况有狂朋怪侣,遇当歌对酒竞留连。别来迅景如梭,旧游似梦,烟水程何限。念名利,憔悴长萦绊。追往事、空惨愁颜。漏箭移,稍觉轻寒。渐呜咽,画角数声残。对闲窗畔,停灯向晓,抱影无眠。

logout