Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

1v9/hexo-next-nightmode

Repository files navigation

Hexo NexT Night Mode

Theme Version Package Version

Add Night Mode support for NexT.

Try scheme Mist for now, since nightmode.styl lacks much...

Install

This plugin has been released to GitHub Package Registry and you can choose one of the following ways to install it.

Default

npm i 1v9/hexo-next-nightmode

If the above installation failed, please try:

npm i 1v9/hexo-next-nightmode#master

Via Github

npm i https://github.com/1v9/hexo-next-nightmode

Via GitHub Package Registry (Not Recommended)

You need to configure authToken for GPR by yourself

npm config set @1v9:registry=https://npm.pkg.github.com
npm i @1v9/hexo-next-nightmode

Usage

Hotkey

Try pressing Alt + X to toggle the mode, it's same as clicking sidebar button.

Configure

You can add follow options in hexo or theme _config.yml.

next_nightmode:
  enable: false
  # FontAwesome or ForkAwesome icon in sidebar button.
  icon: lightbulb-o
  # Text for sidebar button.
  text: Night Mode
  # If true, when you disable Night Mode, Hexo will show warning messages in your console.
  reminder: false
  # Debugger for alpha option below.
  debugger: false
  # Support experimental prefers-color-scheme media query.
  # For now if alpha mode enabled, sidebar button will be disabled.
  # The only way to toggle night mode is changing your device scheme.
  # Also see: https://caniuse.com/#feat=prefers-color-scheme.
  alpha: false

Custom

NexT supports customizing styles, so you can custom dark mode style by yourself, check css/scheme.styl then do your job.

Also if you don't like this plugin based on JavaScript, you can use a simple CSS method.

@media (prefers-color-scheme: dark) {
  /* do everything yo want */
}

About

Add Night Mode support for NexT

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages