Skip to content

Commit 7a93b09

Browse files
Ivan Buryakljharb
authored andcommitted
[Fix] DateRangePicker: replace sass-specific darken with runtime color calculation
Fixes #1513.
1 parent 80d4e51 commit 7a93b09

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
},
117117
"dependencies": {
118118
"airbnb-prop-types": "^2.16.0",
119+
"color2k": "^1.1.0",
119120
"consolidated-events": "^1.1.1 || ^2.0.0",
120121
"enzyme-shallow-equal": "^1.0.4",
121122
"is-touch-device": "^1.0.1",

src/components/DateRangePicker.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { forbidExtraProps } from 'airbnb-prop-types';
66
import { addEventListener } from 'consolidated-events';
77
import isTouchDevice from 'is-touch-device';
88
import OutsideClickHandler from 'react-outside-click-handler';
9+
import { darken } from 'color2k';
910

1011
import DateRangePickerShape from '../shapes/DateRangePickerShape';
1112
import { DateRangePickerPhrases } from '../defaultPhrases';
@@ -749,12 +750,12 @@ export default withStyles(({ reactDates: { color, zIndex } }) => ({
749750
zIndex: zIndex + 2,
750751

751752
':hover': {
752-
color: `darken(${color.core.grayLighter}, 10%)`,
753+
color: darken(color.core.grayLighter, 0.1),
753754
textDecoration: 'none',
754755
},
755756

756757
':focus': {
757-
color: `darken(${color.core.grayLighter}, 10%)`,
758+
color: darken(color.core.grayLighter, 0.1),
758759
textDecoration: 'none',
759760
},
760761
},

src/components/SingleDatePicker.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { forbidExtraProps } from 'airbnb-prop-types';
66
import { addEventListener } from 'consolidated-events';
77
import isTouchDevice from 'is-touch-device';
88
import OutsideClickHandler from 'react-outside-click-handler';
9+
import { darken } from 'color2k';
910

1011
import SingleDatePickerShape from '../shapes/SingleDatePickerShape';
1112
import { SingleDatePickerPhrases } from '../defaultPhrases';
@@ -707,12 +708,12 @@ export default withStyles(({ reactDates: { color, zIndex } }) => ({
707708
zIndex: zIndex + 2,
708709

709710
':hover': {
710-
color: `darken(${color.core.grayLighter}, 10%)`,
711+
color: darken(color.core.grayLighter, 0.1),
711712
textDecoration: 'none',
712713
},
713714

714715
':focus': {
715-
color: `darken(${color.core.grayLighter}, 10%)`,
716+
color: darken(color.core.grayLighter, 0.1),
716717
textDecoration: 'none',
717718
},
718719
},

0 commit comments

Comments
 (0)