grandsilence / vuepress-theme-default-prefers-color-scheme

add prefers-color-scheme for vuepress default theme

Home Page:https://tolking.github.io/vuepress-theme-default-prefers-color-scheme

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vuepress-theme-default-prefers-color-scheme

add prefers-color-scheme for vuepress default theme

README | CHANGELOG

This theme for Vuepress 1.x

Live Demo and Documentation


light.jpg

light.jpg


Installation

yarn add vuepress-theme-default-prefers-color-scheme
# or
npm i vuepress-theme-default-prefers-color-scheme

Usage

// .vuepress -> config.js
module.exports = {
  theme: 'default-prefers-color-scheme',
  themeConfig: {
    // ...
  }
}

Options

defaultTheme

  • Type: string, object
  • Default: undefined
  • Required: false

By default, light or dark themes are displayed by prefers-color-scheme, You can change it by defaultTheme

support light, dark or { theme: [begin hours, end hours] }

module.exports = {
  theme: 'default-prefers-color-scheme',
  themeConfig: {
    defaultTheme: 'dark',
    // or
    defaultTheme: { dark: [18, 6] },
    // or
    defaultTheme: { light: [6, 18], dark: [18, 6] },
  },
  // When using `light theme` or `dark theme`, you need to add a postcss plugins to your config.js
  postcss: {
    plugins: [
      require('css-prefers-color-scheme/postcss'),
      require('autoprefixer')
    ]
  }
}

Theme Config

Styling

To apply simple color overrides to the styling of the default preset, In your .vuepress/styles/palette.styl file.

$accentColor and $accentDarkColor are best changed together

License

MIT

Keywords

vue vuepress documentation prefers-color-scheme default-theme light-theme dark-theme

About

add prefers-color-scheme for vuepress default theme

https://tolking.github.io/vuepress-theme-default-prefers-color-scheme

License:MIT License


Languages

Language:CSS 87.4%Language:Vue 12.2%Language:JavaScript 0.5%