Skip to content

Commit 7acd332

Browse files
committed
docs(README): wording, and add reference to new test case
1 parent 1f66fe8 commit 7acd332

2 files changed

Lines changed: 24 additions & 15 deletions

File tree

.changeset/gentle-numbers-clap.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'postcss-color-scheme': patch
3+
---
4+
5+
fix broken links in README, add missing reference to test case

README.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ module.exports = {
5353

5454
## Design Decisions
5555

56-
You might have noticed a couple of opinionated code at the top of this document. These are extracted from my work, and currently serve my use cases very well. Should you have concerns, suggestions for improvements, or solution for making this more generic, feel free to open an issue. Thanks!
56+
You might have noticed a couple of opinionated code at the top of this document. These are extracted from my daily work, and currently serve my use cases very well. Should you have concerns, suggestions for improvements, or solution for making this more generic, feel free to open an issue. Thanks!
5757

5858
1. Rely on `data-color-scheme` for explicit theme settings. This requires setting `data-color-scheme` on the root html element.
5959

60-
2. Provide fallback to when user has not explicitly select a theme. Let's refer to the demo above, with rules enumerated:
60+
2. Provide fallback when user has not explicitly select a theme. Let's refer to the demo above, with rules enumerated:
6161

6262
```css
6363
/* (1) */
@@ -78,7 +78,7 @@ You might have noticed a couple of opinionated code at the top of this document.
7878
}
7979
```
8080

81-
Imagine your system provides 3 options: `dark`, `light`, and `system` (default). There are 4 possible scenarios.
81+
Imagine your system provides 3 options: `dark`, `light`, and `system` (default, auto, i.e respect system preferences). There are 4 possible scenarios.
8282

8383
1. User has not explicitly selected a theme (theme = `system`), and the system prefers `light` (`prefers-color-scheme` = `light`):
8484

@@ -104,7 +104,7 @@ You might have noticed a couple of opinionated code at the top of this document.
104104
B --> Dark
105105
A -->|No| C[prefers-color-scheme?]
106106
C -->Light
107-
C --->Dark
107+
C -->Dark
108108
```
109109

110110
## Supported At Rules
@@ -147,18 +147,19 @@ The following table lists test cases covered by this plugin, please refer to [te
147147
| --- | --- | --- | --- |
148148
| nest in other media queries | `@media (min-width: 768px) { .my-class { @dark { color: white } } }` | [input][tests.in-media-queries.input] | [output][tests.in-media-queries.output] |
149149
| with combined selector | `.my-class, .others { @dark { color: white } }` | [input][tests.with-combined-selector.input] | [output][tests.with-combined-selector.output] |
150+
| with selector at `html`| `` | [input][tests.with-selector-at-html.input] | [output][tests.with-selector-at-html.output] |
150151
| with [postcss-nesting] | `.my-class { & .nested { @dark { color: white } } }` | [input][tests.with-postcss-nesting.input] | [output][tests.with-postcss-nesting.output] |
151152
| with [postcss-nested] | `.my-class { .nested { @dark { color: white } } }` | [input][tests.with-postcss-nested.input] | [output][tests.with-postcss-nested.output] |
152153

153-
## Tailwind Support
154+
## [Tailwind] Support
154155

155156
Make sure you have installed and configured `tailwindcss`.
156157

157158
```bash
158159
npm install --save-dev tailwindcss
159160
```
160161

161-
Add `postcss-color-scheme` to your tailwind config as a plugin, and turn off the default `darkMode` handling.
162+
Add `postcss-color-scheme` to your [tailwind] config as a plugin, and turn off the default `darkMode` handling.
162163

163164
```js
164165
/** @type {import("tailwindcss").Config } */
@@ -176,19 +177,22 @@ Now, the following is available:
176177
```
177178

178179
[changelog]: ./CHANGELOG.md
179-
[tests]: https://github.com/vnphanquang/postcss-color-scheme/blob/main/src/color-scheme.test.js
180+
[tests]: https://github.com/vnphanquang/postcss-color-scheme/blob/main/lib/color-scheme.test.js
180181

181-
[tests.in-media-queries.input]: https://github.com/vnphanquang/postcss-color-scheme/blob/main/src/tests/in-media-queries.input.css
182-
[tests.in-media-queries.output]: https://github.com/vnphanquang/postcss-color-scheme/blob/main/src/tests/in-media-queries.output.css
182+
[tests.in-media-queries.input]: https://github.com/vnphanquang/postcss-color-scheme/blob/main/lib/tests/in-media-queries.input.css
183+
[tests.in-media-queries.output]: https://github.com/vnphanquang/postcss-color-scheme/blob/main/lib/tests/in-media-queries.output.css
183184

184-
[tests.with-combined-selector.input]: https://github.com/vnphanquang/postcss-color-scheme/blob/main/src/tests/with-combined-selector.input.css
185-
[tests.with-combined-selector.output]: https://github.com/vnphanquang/postcss-color-scheme/blob/main/src/tests/with-combined-selector.output.css
185+
[tests.with-combined-selector.input]: https://github.com/vnphanquang/postcss-color-scheme/blob/main/lib/tests/with-combined-selector.input.css
186+
[tests.with-combined-selector.output]: https://github.com/vnphanquang/postcss-color-scheme/blob/main/lib/tests/with-combined-selector.output.css
186187

187-
[tests.with-postcss-nesting.input]: https://github.com/vnphanquang/postcss-color-scheme/blob/main/src/tests/with-postcss-nesting.input.css
188-
[tests.with-postcss-nesting.output]: https://github.com/vnphanquang/postcss-color-scheme/blob/main/src/tests/with-postcss-nest.output.css
188+
[tests.with-postcss-nesting.input]: https://github.com/vnphanquang/postcss-color-scheme/blob/main/lib/tests/with-postcss-nesting.input.css
189+
[tests.with-postcss-nesting.output]: https://github.com/vnphanquang/postcss-color-scheme/blob/main/lib/tests/with-postcss-nest.output.css
189190

190-
[tests.with-postcss-nested.input]: https://github.com/vnphanquang/postcss-color-scheme/blob/main/src/tests/with-postcss-nested.input.css
191-
[tests.with-postcss-nested.output]: https://github.com/vnphanquang/postcss-color-scheme/blob/main/src/tests/with-postcss-nest.output.css
191+
[tests.with-postcss-nested.input]: https://github.com/vnphanquang/postcss-color-scheme/blob/main/lib/tests/with-postcss-nested.input.css
192+
[tests.with-postcss-nested.output]: https://github.com/vnphanquang/postcss-color-scheme/blob/main/lib/tests/with-postcss-nest.output.css
193+
194+
[tests.with-selector-at-html.input]: https://github.com/vnphanquang/postcss-color-scheme/blob/main/lib/tests/selector-is-html.input.css
195+
[tests.with-selector-at-html.output]: https://github.com/vnphanquang/postcss-color-scheme/blob/main/lib/tests/selector-is-html.output.css
192196

193197
<!-- npm -->
194198
[npm.badge]: https://img.shields.io/npm/v/postcss-color-scheme

0 commit comments

Comments
 (0)