Skip to content

Commit

Permalink
Add color-adjust declaration support (#1009)
Browse files Browse the repository at this point in the history
* Add color-adjust declaration support

* Remove unnecessary mistakes array, fix hack test name

* Change feature name and link in prefixes.js, add 'print-color-adjust' to names array in color-adjust.js, change html elements to class names and fix indentation in color-adjust.out.css

* Upgrade caniuse-lite version

* Upgrade yarn.lock file
  • Loading branch information
soul-wish authored and ai committed Mar 21, 2018
1 parent cbf41b9 commit 7c4dfb1
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 14 deletions.
5 changes: 2 additions & 3 deletions lib/hacks/color-adjust.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@

const Declaration = require('../declaration');

class ColorAdjust extends Declaration {

static names = ['color-adjust'];
static names = ['color-adjust', 'print-color-adjust'];

/**
* Change property name for -webkit browsers
* Change property name for WebKit-based browsers
*/
prefixed(prop, prefix) {
return prefix + 'print-color-adjust';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"dependencies": {
"babel-register": "^6.26.0",
"browserslist": "^3.1.2",
"caniuse-lite": "^1.0.30000813",
"caniuse-lite": "^1.0.30000817",
"normalize-range": "^0.1.2",
"num2fraction": "^1.2.2",
"postcss": "^6.0.19",
Expand Down
8 changes: 4 additions & 4 deletions test/cases/color-adjust.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.economy {
color-adjsut: economy;
.a {
color-adjust: economy;
}

.exact {
color-adjsut: exact;
.b {
color-adjust: exact;
}
12 changes: 6 additions & 6 deletions test/cases/color-adjust.out.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.economy {
-webkit-print-color-adjust: economy;
color-adjsut: economy;
.a {
-webkit-print-color-adjust: economy;
color-adjust: economy;
}

.exact {
-webkit-print-color-adjust: exact;
color-adjsut: exact;
.b {
-webkit-print-color-adjust: exact;
color-adjust: exact;
}
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1364,6 +1364,10 @@ caniuse-lite@^1.0.30000792, caniuse-lite@^1.0.30000813:
version "1.0.30000813"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000813.tgz#7b25e27fdfb8d133f3c932b01f77452140fcc6c9"

caniuse-lite@^1.0.30000817:
version "1.0.30000817"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000817.tgz#e993c380eb4bfe76a2aed4223f841c02d6e0d832"

caseless@~0.12.0:
version "0.12.0"
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
Expand Down

0 comments on commit 7c4dfb1

Please sign in to comment.