postcss-initial
Advanced tools
Comparing version 3.0.2 to 4.0.0
@@ -5,18 +5,35 @@ # Changelog | ||
### [3.0.2](https://github.com/maximkoretskiy/postcss-initial/compare/v3.0.1...v3.0.2) (2019-10-31) | ||
## [4.0.0](https://github.com/maximkoretskiy/postcss-initial/compare/v3.0.2...v4.0.0) (2020-09-29) | ||
## [4.0.0] - 2020-09-29 | ||
- Update deps | ||
- Migrate to PostCSS v8 Thanks to @goto-bus-stop and @Semigradsky | ||
- Fix initial false positive. Thanks to @goto-bus-stop | ||
## [3.0.3] - 2020-07-14 | ||
- Update deps | ||
## [3.0.2](https://github.com/maximkoretskiy/postcss-initial/compare/v3.0.1...v3.0.2) (2019-10-31) | ||
## [3.0.1] - 2019-08-09 | ||
- Fix lodash.template vulnerability. See https://github.com/lodash/lodash/pull/4336 | ||
- Fix lodash.template vulnerability. See https://github.com/lodash/lodash/pull/4336 | ||
## [3.0.0] - 2018-08-16 | ||
- Upgrade PostCSS to 7.0.2. It breaks node@4 support. Thanks to @ansballard for contribution | ||
- Upgrade PostCSS to 7.0.2. It breaks node@4 support. Thanks to @ansballard for contribution | ||
## [2.0.0] - 2016-05-09 | ||
- Add yarn | ||
- Update dependcies. Thanks to @Semigradsky | ||
- Add yarn | ||
- Update dependcies. Thanks to @Semigradsky | ||
## [1.5.3] - 2016-11-30 | ||
- Add `.eslintrc` to `.npmignore` Thanks to @wtgtybhertgeghgtwtg for pr [#20](https://github.com/maximkoretskiy/postcss-initial/pull/20) | ||
- Add `.eslintrc` to `.npmignore` Thanks to @wtgtybhertgeghgtwtg for pr [#20](https://github.com/maximkoretskiy/postcss-initial/pull/20) | ||
## [1.5.2] - 2016-07-20 | ||
Fix rules duplication in case when user added own fallback for rule. | ||
@@ -27,26 +44,34 @@ See [#18](https://github.com/maximkoretskiy/postcss-initial/issues/18). | ||
## [1.5.1] - 2016-04-09 | ||
Added support of multiple initial values in property. Thanks to @johnbender for issue and contribution. | ||
## [1.5.0] - 2016-03-09 | ||
- Fix some props with inherit values to more specific values. Thnx @dzhiriki for issue. | ||
- Update deps | ||
- Fix some props with inherit values to more specific values. Thnx @dzhiriki for issue. | ||
- Update deps | ||
## [1.4.1] - 2016-02-05 | ||
- Remove gulp from workflow, using npm-scrips only | ||
- Update lodash.template@4 | ||
- Fix browser compatibility issues(font, orphans, widows, text-decoration). Thnx to @kinday for issue. | ||
- Remove gulp from workflow, using npm-scrips only | ||
- Update lodash.template@4 | ||
- Fix browser compatibility issues(font, orphans, widows, text-decoration). Thnx to @kinday for issue. | ||
## [1.4] - 2015-11-08 | ||
- Added `replace` option. Thanks to @sylvainbaronnet | ||
- Added `replace` option. Thanks to @sylvainbaronnet | ||
## [1.3] - 2015-08-27 | ||
Rename project to make it more universal (plugin name is **postcss-initial**) | ||
## [1.2] - 2015-08-26 | ||
Rename project to fit standards (plugin name is **postcss-all-property**) | ||
## [1.1.0] - 2015-08-25 | ||
Add reset: inherited option | ||
## [1.0.1] - 2015-08-24 | ||
Proof of concept. Plugin still works =)(plugin name is **postcss-all-unset**) |
17
index.js
@@ -1,5 +0,4 @@ | ||
var postcss = require('postcss'); | ||
var makeFallbackFunction = require('./lib/rules-fabric'); | ||
module.exports = postcss.plugin('postcss-initial', function (opts) { | ||
module.exports = function postcssInitial(opts) { | ||
opts = opts || {}; | ||
@@ -18,5 +17,7 @@ opts.reset = opts.reset || 'all'; | ||
}; | ||
return function (css) { | ||
css.walkDecls(function (decl) { | ||
if (decl.value.indexOf('initial') < 0) { | ||
return { | ||
postcssPlugin: 'postcss-initial', | ||
Declaration: function (decl) { | ||
if (!/\binitial\b/.test(decl.value)) { | ||
return; | ||
@@ -34,4 +35,6 @@ } | ||
} | ||
}); | ||
} | ||
}; | ||
}); | ||
}; | ||
module.exports.postcss = true; |
@@ -65,3 +65,3 @@ var template = require('lodash.template'); | ||
prop: rule.prop, | ||
value: value.replace(/initial/g, rule.initial) | ||
value: value.replace(/\binitial\b/g, rule.initial) | ||
}; | ||
@@ -68,0 +68,0 @@ }); |
{ | ||
"name": "postcss-initial", | ||
"version": "3.0.2", | ||
"version": "4.0.0", | ||
"description": "PostCSS plugin to fallback initial keyword.", | ||
@@ -18,11 +18,14 @@ "keywords": [ | ||
"dependencies": { | ||
"lodash.template": "^4.5.0", | ||
"postcss": "^7.0.2" | ||
"lodash.template": "^4.5.0" | ||
}, | ||
"peerDependencies": { | ||
"postcss": "^8.0.0" | ||
}, | ||
"devDependencies": { | ||
"chai": "3.5.0", | ||
"chai": "^4.2.0", | ||
"eslint": "^4.18.2", | ||
"mocha": "^3.3.0", | ||
"husky": "^3.0.9", | ||
"standard-version": "^7.0.0" | ||
"husky": "^4.3.0", | ||
"mocha": "^8.1.3", | ||
"postcss": "^8.0.5", | ||
"standard-version": "^9.0.0" | ||
}, | ||
@@ -37,4 +40,4 @@ "scripts": { | ||
"hooks": { | ||
"pre-commit": "yarn test", | ||
"pre-push": "yarn test" | ||
"pre-commit": "npm test", | ||
"pre-push": "npm test" | ||
} | ||
@@ -44,5 +47,5 @@ }, | ||
"scripts": { | ||
"prerelease": "yarn test" | ||
"prerelease": "npm test" | ||
} | ||
} | ||
} |
@@ -52,2 +52,4 @@ # PostCSS Initial | ||
[!['Can I use' table](https://caniuse.bitsofco.de/image/css-initial-value.png)](https://caniuse.com/#feat=css-initial-value) | ||
**Killer feature!** | ||
@@ -54,0 +56,0 @@ |
10
545
177
24308
6
+ Addednanoid@3.3.7(transitive)
+ Addedpicocolors@1.0.0(transitive)
+ Addedpostcss@8.4.38(transitive)
+ Addedsource-map-js@1.2.0(transitive)
- Removedpostcss@^7.0.2
- Removedpicocolors@0.2.1(transitive)
- Removedpostcss@7.0.39(transitive)
- Removedsource-map@0.6.1(transitive)