postcss-autoreset
Advanced tools
Comparing version 2.0.2 to 3.0.0
@@ -8,13 +8,22 @@ # Change Log | ||
## [3.0.0] - 2020-09-29 | ||
- Update to PostCSS v8 | ||
## [2.0.2] - 2018-02-25 | ||
- Add support for prefixed keyframes(#27, #25). Thnx @olavhaugen for PR | ||
- Add support for prefixed keyframes(#27, #25). Thnx @olavhaugen for PR | ||
## [2.0.1] - 2017-08-25 | ||
- Fix keyframes adding to common reset list .Thnx @copycut for suggestion! | ||
- Fix keyframes adding to common reset list .Thnx @copycut for suggestion! | ||
## [2.0.0] - 2017-07-30 | ||
- Update to PostCSS 6 | ||
## [1.2.1] - 2016-10-09 | ||
Thnx to @giuseppeg and simonsmith for contribution! | ||
- Do not modify css if not required | ||
@@ -24,5 +33,7 @@ - Fix duplicate selector issue when using nested rulesets. ([#18](https://github.com/maximkoretskiy/postcss-autoreset/pull/18)) | ||
## [1.2.0] - 2016-09-29 | ||
- Improved accuracy of SUIT CSS regex (see https://github.com/maximkoretskiy/postcss-autoreset/pull/17 and https://github.com/maximkoretskiy/postcss-autoreset/issues/16). Thnx @giuseppeg and @simonsmith for suggestion and contribution. | ||
## [1.1.5] - 2016-01-21 | ||
- Fix plugin prepublish script again with babel-plugin-add-module-exports. Thnx @mikaa123 for patience %) | ||
@@ -32,5 +43,7 @@ - Add integration test to prevent this bug. | ||
## [1.1.4] - 2016-01-21 | ||
- Fix plugin prepublish script with babel-plugin-transform-es2015-modules-umd. Thnx @mikaa123 for bugreport | ||
## [1.1.3] - 2016-01-21 | ||
- Put all resets in one rule. Thnx @DanGamble89 for idea | ||
@@ -43,8 +56,11 @@ - Add virtual source for generated code. Thnx @ai for review | ||
## [1.1.2] - 2016-01-10 | ||
- Fixed default matchers pseudoclasses matching. Thnx to @kinday for contribution. | ||
## [1.1.1] - 2015-12-16 | ||
- Roll back dependencies update to fix test suite work | ||
## [1.1.0] - 2015-12-16 | ||
- Added `css2js` custom rules notation support. Thnx to @ai for idea | ||
@@ -54,5 +70,7 @@ - Update deps | ||
## [1.0.0] - 2015-08-29 | ||
First project release. | ||
Added | ||
- BEM and Suit support | ||
- README docs | ||
- BEM and Suit support | ||
- README docs |
{ | ||
"name": "postcss-autoreset", | ||
"version": "2.0.2", | ||
"version": "3.0.0", | ||
"description": "PostCSS plugin for partial styles reset", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"prepublish": "npm run build", | ||
"build": "babel src --out-dir dist", | ||
"lint": "eslint ./src ./test", | ||
"test": "npm run lint && npm run test-unit && npm run test-integration", | ||
"test-unit": "mocha --compilers es6:babel-register test/index.es6", | ||
"test-integration": "npm run build && mocha test/integration.js", | ||
"test-dev": "mocha -w --compilers es6:babel-register test/index.es6", | ||
"precommit": "npm test" | ||
}, | ||
"repository": { | ||
@@ -38,16 +28,11 @@ "type": "git", | ||
"homepage": "https://github.com/maximkoretskiy/postcss-reset", | ||
"devDependencies": { | ||
"babel-cli": "^6.4.0", | ||
"babel-eslint": "^7.2.3", | ||
"babel-plugin-add-module-exports": "^0.2.1", | ||
"babel-preset-es2015": "^6.3.13", | ||
"babel-register": "^6.3.13", | ||
"eslint": "^3.19.0", | ||
"husky": "^0.13.4", | ||
"mocha": "^3.4.2" | ||
"dependencies": { | ||
"postcss-js": "^3.0.1" | ||
}, | ||
"dependencies": { | ||
"postcss": "^6.0.1", | ||
"postcss-js": "^1.0.0" | ||
"peerDependency": { | ||
"postcss": "^8.1.1" | ||
}, | ||
"optionalPeerDependencies": { | ||
"postcss-js": "^3.0.1" | ||
} | ||
} |
105
README.md
@@ -13,12 +13,11 @@ # PostCSS Auto Reset | ||
[postcss]: https://github.com/postcss/postcss | ||
[ci-img]: https://travis-ci.org/maximkoretskiy/postcss-autoreset.svg | ||
[ci]: https://travis-ci.org/maximkoretskiy/postcss-autoreset | ||
[npm-img]: https://badge.fury.io/js/postcss-autoreset.svg | ||
[npm]: https://www.npmjs.com/package/postcss-autoreset | ||
[david-img]: https://david-dm.org/maximkoretskiy/postcss-autoreset.svg | ||
[david]: https://david-dm.org/maximkoretskiy/postcss-autoreset | ||
[initial]: https://github.com/maximkoretskiy/postcss-initial | ||
[PostCSS]: https://github.com/postcss/postcss | ||
[ci-img]: https://travis-ci.org/maximkoretskiy/postcss-autoreset.svg | ||
[ci]: https://travis-ci.org/maximkoretskiy/postcss-autoreset | ||
[npm-img]: https://badge.fury.io/js/postcss-autoreset.svg | ||
[npm]: https://www.npmjs.com/package/postcss-autoreset | ||
[david-img]: https://david-dm.org/maximkoretskiy/postcss-autoreset.svg | ||
[david]: https://david-dm.org/maximkoretskiy/postcss-autoreset | ||
[initial]: https://github.com/maximkoretskiy/postcss-initial | ||
The following CSS is written in [BEM](https://en.bem.info/) notation. | ||
@@ -42,23 +41,28 @@ | ||
} | ||
``` | ||
```css | ||
.block, .block__element { /* combined reset block */ | ||
.block, | ||
.block__element { | ||
/* combined reset block */ | ||
all: initial; | ||
} | ||
.block { /* reseted */ | ||
.block { | ||
/* reseted */ | ||
padding: 1em; | ||
} | ||
.block:hover { /* ignored, we don`t need to reset pseudoclasses */ | ||
.block:hover { | ||
/* ignored, we don`t need to reset pseudoclasses */ | ||
background-color: red; | ||
} | ||
.block__element { /* reseted */ | ||
.block__element { | ||
/* reseted */ | ||
margin: 1em; | ||
} | ||
.block--modifier { /* ignored, we don`t need to reset BEM modifiers */ | ||
.block--modifier { | ||
/* ignored, we don`t need to reset BEM modifiers */ | ||
border: 1em; | ||
@@ -71,46 +75,83 @@ } | ||
### reset | ||
Set of properties that we use to reset rules. | ||
Takes `string` or `object`. | ||
Possible values: | ||
- 'initial' - `all: initial`; | ||
- 'sizes' - reset size properties. | ||
- 'initial' - `all: initial`; | ||
- 'sizes' - reset size properties. | ||
Use object to create your own reset. CSS-in-JS notation is supported. | ||
**Example** | ||
```js | ||
postcss([ require('postcss-autoreset')({ | ||
postcss([ | ||
require("postcss-autoreset")({ | ||
reset: { | ||
margin: 0, | ||
padding: 0, | ||
borderRadius: 0 | ||
} | ||
})]) | ||
borderRadius: 0, | ||
}, | ||
}), | ||
]); | ||
``` | ||
### rulesMatcher | ||
### rulesMatcher | ||
Rules filter function. | ||
Takes `string` or `function`. | ||
Possible values: | ||
- 'bem' - reset all [BEM](https://en.bem.info/) blocks and element, ignore modifiers and pseudoclasses. (naming: `.block__element-modifier`); | ||
- 'suit' - reset all [SUIT CSS](https://suitcss.github.io/) components and parts, ignore modifiers, states and pseudoclasses. | ||
You can define custom rules filter to fit your styles naming. | ||
- 'bem' - reset all [BEM](https://en.bem.info/) blocks and element, ignore modifiers and pseudoclasses. (naming: `.block__element-modifier`); | ||
- 'suit' - reset all [SUIT CSS](https://suitcss.github.io/) components and parts, ignore modifiers, states and pseudoclasses. | ||
You can define custom rules filter to fit your styles naming. | ||
**Example** | ||
```js | ||
postcss([ require('postcss-autoreset')({ | ||
rulesMatcher: (rule)=> rule.selector.match(/regexp/) | ||
})]) | ||
postcss([ | ||
require("postcss-autoreset")({ | ||
rulesMatcher: (rule) => rule.selector.match(/regexp/), | ||
}), | ||
]); | ||
``` | ||
Reset only simple rules. See [#28](https://github.com/maximkoretskiy/postcss-autoreset/issues/28) | ||
```js | ||
postcss([ | ||
require("postcss-autoreset")({ | ||
rulesMatcher: (rule) => rule.selector.match(/^[.]\w+$/), | ||
}), | ||
]); | ||
``` | ||
## Usage | ||
```js | ||
postcss([ require('postcss-autoreset')()]) | ||
**Step 1:** Install plugin: | ||
```sh | ||
npm install --save-dev postcss postcss-autoreset | ||
``` | ||
See [PostCSS] docs for examples for your environment. | ||
**Step 2:** Check you project for existed 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: | ||
```diff | ||
module.exports = { | ||
plugins: [ | ||
+ require('postcss-autoreset')(), | ||
require('autoprefixer') | ||
] | ||
} | ||
``` | ||
[official docs]: https://github.com/postcss/postcss#usage |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1
0
155
7129
4
0
1
+ Addedcamelcase-css@2.0.1(transitive)
+ Addednanoid@3.3.8(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedpostcss@8.4.49(transitive)
+ Addedpostcss-js@3.0.3(transitive)
+ Addedsource-map-js@1.2.1(transitive)
- Removedpostcss@^6.0.1
- Removedansi-styles@3.2.1(transitive)
- Removedcamelcase-css@1.0.1(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedpostcss@6.0.23(transitive)
- Removedpostcss-js@1.0.1(transitive)
- Removedsource-map@0.6.1(transitive)
- Removedsupports-color@5.5.0(transitive)
Updatedpostcss-js@^3.0.1