Giter VIP home page Giter VIP logo

vuepress-theme-default-prefers-color-scheme's Introduction

License Latest tag via npm Latest tag via GitHub

vuepress-theme-default-prefers-color-scheme

This plugin adds support for prefers-color-scheme to the Vuepress 1.x default theme.

Live Demo and Documentation

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'
}

Options

overrideTheme (optional)

Force users into a specific theme, ignoring prefers-color-scheme.

Allowed values:

  • 'light' | 'dark': Always use the given theme
  • { light: [beginHours: number, endHours: number], dark: [beginHours: number, endHours: number] }: Control the time of the day when each theme is used

For example:

module.exports = {
  theme: 'default-prefers-color-scheme',
  themeConfig: {
    overrideTheme: 'dark',
    // or
    overrideTheme: { light: [6, 18], dark: [18, 6] },
  }
}

prefersTheme (optional)

Use the given theme when the browser does not support prefers-color-scheme but supports CSS Variables

Allowed values:

  • 'light' | 'dark'

For example:

module.exports = {
  theme: 'default-prefers-color-scheme',
  themeConfig: {
    prefersTheme: 'dark',
  }
}

Theme Config

Styling

Apply simple color overrides to the styling of the default preset in your .vuepress/styles/palette.styl file.

Alternatively, set CSS Variables in your .vuepress/styles/index.styl file.

$accentColor and $accentDarkColor are best changed together

Changelog

This project uses semantic versioning and tracks changes in CHANGELOG.

License

MIT

vuepress-theme-default-prefers-color-scheme's People

Contributors

tolking avatar jrappen avatar grandsilence avatar spawnia avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.