Skip to content
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.

Commit

Permalink
Merge pull request #28 from jrappen/master
Browse files Browse the repository at this point in the history
some minor fixes
  • Loading branch information
tolking committed Nov 30, 2020
2 parents ccb405f + bf69093 commit a266e84
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 25 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## 2.0.0

> Compare [`v1.1.2...v2.0.0`](https://github.com/tolking/vuepress-theme-default-prefers-color-scheme/compare/v1.1.2...v2.0.0)
[Migration for v1](https://tolking.github.io/vuepress-theme-default-prefers-color-scheme/migration.html)

- rename `defaultTheme` to `overrideTheme` and clarify it overrules and ignores [prefers-color-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)
Expand Down Expand Up @@ -47,15 +49,15 @@ defaultTheme: 'dark' -> <html theme="dark">

## 1.0.5

- fix styles on vuepress 1.3.0
- fix styles on [`vuepress`](https://vuepress.vuejs.org) 1.3.0

## 1.0.4

- fix navigation border color for dark theme

## 1.0.3

- fix styles on vuepress 1.2.0
- fix styles on [`vuepress`](https://vuepress.vuejs.org) 1.2.0

## 1.0.2

Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[![License](https://img.shields.io/github/license/tolking/vuepress-theme-default-prefers-color-scheme.svg?style=flat-square&logo=opensourceinitiative)](https://github.com/tolking/vuepress-theme-default-prefers-color-scheme/blob/master/LICENSE)
[![Latest tag via npm](https://img.shields.io/npm/v/vuepress-theme-default-prefers-color-scheme.svg?style=flat-square&logo=npm)](https://npmjs.com/package/vuepress-theme-default-prefers-color-scheme)
[![Latest tag via GitHub](https://img.shields.io/github/v/tag/tolking/vuepress-theme-default-prefers-color-scheme.svg?sort=semver&style=flat-square&logo=github)](https://github.com/tolking/vuepress-theme-default-prefers-color-scheme/tags)

# vuepress-theme-default-prefers-color-scheme

This plugin adds support for *prefers-color-scheme* to the Vuepress 1.x default theme.
This plugin adds support for *prefers-color-scheme* to the [Vuepress](https://vuepress.vuejs.org) 1.x default theme.

[Live Demo and Documentation](https://tolking.github.io/vuepress-theme-default-prefers-color-scheme)

Expand Down Expand Up @@ -77,7 +81,7 @@ Alternatively, set CSS Variables in your `.vuepress/styles/index.styl` file.

## Changelog

This project uses semantic versioning and tracks changes in [CHANGELOG](CHANGELOG.md)
This project uses semantic versioning and tracks changes in [CHANGELOG](CHANGELOG.md).

## License

Expand Down
31 changes: 17 additions & 14 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
## Introduction

vuepress-theme-default-prefers-color-scheme is a theme that adds `light` and `dark` themes to the [default theme](https://vuepress.vuejs.org/zh/theme/default-theme-config.html) of vuepress
[`vuepress-theme-default-prefers-color-scheme`](https://github.com/tolking/vuepress-theme-default-prefers-color-scheme) is a theme that adds `light` and `dark` themes to the [default theme](https://vuepress.vuejs.org/theme/default-theme-config.html) of `vuepress`.

## How It Works
## Requirements

base on prefers-color-scheme and CSS Variables
### How it works

#### View Support Browsers
Based on `prefers-color-scheme` and CSS Variables.

- [prefers-color-scheme](https://www.caniuse.com/#search=prefers-color-scheme)
### Supported browsers

- [`prefers-color-scheme`](https://www.caniuse.com/#search=prefers-color-scheme)
- [CSS Variables](https://www.caniuse.com/#search=CSS%20Variables)

**`prefers-color-scheme` also needs your system support**
**`prefers-color-scheme` also needs your system support.**

- mac Mojave ^10.14
- windows 10 ^1809
- macOS Mojave `^10.14`
- Windows 10 `^1809`

**For unsupported browsers, the same style as the default theme will be displayed**
**For unsupported browsers, the same style as the default theme will be displayed.**

## Installation

Expand All @@ -40,9 +42,9 @@ module.exports = {

## Options

### overrideTheme (optional)
### `overrideTheme` (optional)

Force users into a specific theme, ignoring [prefers-color-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme).
Force users into a specific theme, ignoring [`prefers-color-scheme`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme).

Allowed values:

Expand All @@ -62,7 +64,7 @@ module.exports = {
}
```

### prefersTheme (optional)
### `prefersTheme` (optional)

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

Expand All @@ -85,6 +87,7 @@ module.exports = {

## Styling

To apply simple color overrides to the styling of the [default preset](https://github.com/tolking/vuepress-theme-default-prefers-color-scheme/blob/master/styles/palette.styl), In your `.vuepress/styles/palette.styl` file. or set CSS Variables in your `.vuepress/styles/index.styl` file.
To apply simple color overrides to the styling of the [default preset](https://github.com/tolking/vuepress-theme-default-prefers-color-scheme/blob/master/styles/palette.styl) in your `.vuepress/styles/palette.styl` file.
Or set CSS Variables in your `.vuepress/styles/index.styl` file.

**`$accentColor` and `$accentDarkColor` are best changed together**
**`$accentColor` and `$accentDarkColor` are best changed together.**
6 changes: 3 additions & 3 deletions docs/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ title: Migration
## Migration from v1

::: tip
If and only if you have configured `defaultTheme` in the `v1` version, you need to know this
If and only if you have configured a `defaultTheme` in the `v1` version, you need to know this.
:::

``` js
``` diff
module.exports = {
theme: 'default-prefers-color-scheme',
themeConfig: {
Expand All @@ -22,4 +22,4 @@ module.exports = {
- ]
- }
}
```
```
4 changes: 2 additions & 2 deletions docs/zh/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ title: 迁移
当且仅当你在 `v1` 版本中配置了 `defaultTheme` 时,需要了解以下内容
:::

``` js
``` diff
module.exports = {
theme: 'default-prefers-color-scheme',
themeConfig: {
Expand All @@ -22,4 +22,4 @@ module.exports = {
- ]
- }
}
```
```
2 changes: 0 additions & 2 deletions layouts/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ export default {
}
}
}
</script>

<style lang="stylus">
Expand Down

0 comments on commit a266e84

Please sign in to comment.