折腾一下博客夜间模式

折腾一下博客夜间模式

啊哈,与时俱进

最近看到 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.

Ads by Google