-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
2,301 additions
and
1,827 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Test | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
permissions: | ||
contents: read | ||
jobs: | ||
full: | ||
name: Node.js Latest Full | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- name: Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
cache: pnpm | ||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile --ignore-scripts | ||
- name: Run tests | ||
run: pnpm test | ||
|
||
short: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: | ||
- 18 | ||
name: Node.js ${{ matrix.node-version }} Quick | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- name: Install Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: pnpm | ||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile --ignore-scripts | ||
- name: Run unit tests | ||
run: pnpm unit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
node_modules/ | ||
npm-debug.log | ||
yarn-error.log | ||
|
||
coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,2 @@ | ||
.editorconfig | ||
|
||
node_modules/ | ||
npm-debug.log | ||
yarn-error.log | ||
yarn.lock | ||
|
||
*.test.js | ||
.travis.yml | ||
coverage/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Change Log | ||
This project adheres to [Semantic Versioning](http://semver.org/). | ||
|
||
## 0.6 | ||
* Moved to PostCSS 7. | ||
|
||
## 0.3 | ||
* Renamed from `postcss-messages` to `postcss-browser-reporter`. | ||
|
||
## 0.2.0 | ||
* Updated styles of displayed warnings. | ||
* Added options for overriding styles and selector. | ||
|
||
## 0.1 | ||
* Initial release. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,62 @@ | ||
# PostCSS Browser Reporter [![Build Status](https://travis-ci.org/postcss/postcss-browser-reporter.svg)](https://travis-ci.org/postcss/postcss-browser-reporter) | ||
# PostCSS Browser Reporter | ||
|
||
> [PostCSS] plugin to report warning messages right in your browser. | ||
[PostCSS] plugin to report warning messages right in your browser. | ||
|
||
If a plugin before this one is throwing a warning, this plugin will append warning messages to `html:before`. | ||
|
||
![Postcss-browser-reporter – warnings from other postcss plugins in your browser](http://postcss.github.io/postcss-browser-reporter/screenshot.png) | ||
|
||
|
||
## Usage | ||
|
||
Put this plugin after all plugins if you want to cover all possible warnings: | ||
**Step 1:** Install plugin: | ||
|
||
```sh | ||
npm install --save-dev postcss postcss-browser-reporter | ||
``` | ||
|
||
**Step 2:** Check your project for existing PostCSS config: `postcss.config.js` | ||
in the project root, `"postcss"` section in `package.json` | ||
or `postcss` in bundle config. | ||
|
||
If you do not use PostCSS, add it according to [official docs] | ||
and set this plugin in settings. | ||
|
||
**Step 3:** Add the plugin to plugins list: | ||
|
||
```js | ||
postcss([ | ||
require('other-plugin'), | ||
require('postcss-browser-reporter') | ||
]) | ||
module.exports = { | ||
plugins: [ | ||
+ require('postcss-browser-reporter'), | ||
require('autoprefixer') | ||
] | ||
} | ||
``` | ||
|
||
### Options | ||
[official docs]: https://github.com/postcss/postcss#usage | ||
|
||
#### `selector` (`{String}`, default: `html::before`) | ||
|
||
## Options | ||
|
||
### `selector` (`{String}`, default: `html::before`) | ||
|
||
You can override selector that will be used to display messages: | ||
|
||
```js | ||
var messages = require('postcss-browser-reporter') | ||
postcss([ | ||
messages({ | ||
require('postcss-browser-reporter')({ | ||
selector: 'body:before' | ||
}) | ||
]) | ||
``` | ||
|
||
#### `styles` (`{Object}`, default: opinionated styles) | ||
### `styles` (`{Object}`, default: opinionated styles) | ||
|
||
You can override default styles applied to the selector: | ||
|
||
```js | ||
var messages = require('postcss-browser-reporter') | ||
postcss([ | ||
messages({ | ||
require('postcss-browser-reporter')({ | ||
styles: { | ||
color: 'gray', | ||
'text-align': 'center' | ||
} | ||
}) | ||
]) | ||
``` | ||
|
||
See [PostCSS] docs for examples for your environment. | ||
|
||
## License | ||
|
||
The MIT License | ||
|
||
[PostCSS]: https://github.com/postcss/postcss |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.