Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit e80c621

Browse files
committed
fix(datepicker): make dark theme picker not terrible. Fixes #4614
1 parent afc0963 commit e80c621

File tree

5 files changed

+29
-15
lines changed

5 files changed

+29
-15
lines changed
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** Theme styles for mdCalendar. */
22

33
.md-calendar.md-THEME_NAME-theme {
4-
color: '{{foreground-2}}';
4+
color: '{{foreground-1}}';
55

66
tr:last-child td {
77
border-bottom-color: '{{background-200}}';
@@ -10,12 +10,15 @@
1010
.md-THEME_NAME-theme {
1111

1212
.md-calendar-day-header {
13-
background: '{{background-200}}'; // grey-200
14-
color: '{{foreground-2}}'; // grey-700
13+
background: '{{background-hue-1}}';
14+
color: '{{foreground-1}}';
1515
}
1616

1717
.md-calendar-date.md-calendar-date-today {
18-
color: '{{primary-500}}'; // blue-500
18+
19+
.md-calendar-date-selection-indicator {
20+
border: 1px solid '{{primary-500}}'; // blue-500
21+
}
1922

2023
&.md-calendar-date-disabled {
2124
color: '{{primary-500-0.6}}';
@@ -26,12 +29,12 @@
2629
// (the root md-calendar holds browser focus).
2730
.md-calendar-date.md-focus {
2831
.md-calendar-date-selection-indicator {
29-
background: '{{background-300}}'; // grey-300
32+
background: '{{background-hue-1}}';
3033
}
3134
}
3235

3336
.md-calendar-date-selection-indicator:hover {
34-
background: '{{background-300}}'; // grey-300
37+
background: '{{background-hue-1}}';
3538
}
3639

3740
// Selected style goes after hover and focus so that it takes priority.
@@ -40,11 +43,12 @@
4043
.md-calendar-date-selection-indicator {
4144
background: '{{primary-500}}'; // blue-500
4245
color: '{{primary-500-contrast}}'; // white
46+
border-color: transparent;
4347
}
4448
}
4549

4650
.md-calendar-date-disabled,
4751
.md-calendar-month-label-disabled {
48-
color: '{{background-400}}'; // grey-400
52+
color: '{{foreground-3}}';
4953
}
5054
}

src/components/datepicker/calendar.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ $md-calendar-side-padding: 16px !default;
66
$md-calendar-weeks-to-show: 7 !default;
77

88
$md-calendar-month-label-padding: 8px !default;
9-
$md-calendar-month-label-font-size: 13px !default;
9+
$md-calendar-month-label-font-size: 14px !default;
1010

1111
$md-calendar-scroll-cue-shadow-radius: 6px;
1212

@@ -122,6 +122,7 @@ md-calendar {
122122
.md-calendar-month-label {
123123
height: $md-calendar-cell-size;
124124
font-size: $md-calendar-month-label-font-size;
125+
font-weight: 500; // Roboto Medium
125126
padding: 0 0 0 $md-calendar-side-padding + $md-calendar-month-label-padding;
126127
}
127128

src/components/datepicker/datePicker-theme.scss

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
/** Theme styles for mdDatepicker. */
22

33
md-datepicker.md-THEME_NAME-theme {
4-
background: white;
4+
background: '{{background-color}}';
55
}
66

77
.md-THEME_NAME-theme {
88

9+
.md-datepicker-input {
10+
color: '{{background-contrast}}';
11+
background: '{{background-color}}';
12+
}
13+
914
.md-datepicker-input-container {
1015
border-bottom-color: '{{background-300}}';
1116

@@ -23,6 +28,10 @@ md-datepicker.md-THEME_NAME-theme {
2328
}
2429

2530
.md-datepicker-triangle-button {
31+
.md-datepicker-expand-triangle {
32+
border-top-color: '{{foreground-3}}';
33+
}
34+
2635
&:hover .md-datepicker-expand-triangle {
2736
border-top-color: '{{foreground-2}}';
2837
}
@@ -35,7 +44,8 @@ md-datepicker.md-THEME_NAME-theme {
3544
}
3645
}
3746

38-
.md-datepicker-calendar {
39-
background: white;
47+
.md-datepicker-calendar,
48+
.md-datepicker-input-mask-opaque {
49+
background: '{{background-color}}';
4050
}
4151
}

src/components/datepicker/datePicker.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ md-datepicker {
7777
position: absolute;
7878
right: 0;
7979
left: 120px;
80-
background: white;
8180

8281
height: 100%;
8382
}
@@ -115,7 +114,7 @@ $md-date-arrow-size: 5px;
115114
height: 0;
116115
border-left: $md-date-arrow-size solid transparent;
117116
border-right: $md-date-arrow-size solid transparent;
118-
border-top: $md-date-arrow-size solid rgba(black, 0.20);
117+
border-top: $md-date-arrow-size solid;
119118
}
120119

121120
// Button containing the down "disclosure" triangle/arrow.

src/core/services/theming/theming.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ var LIGHT_DEFAULT_HUES = {
100100
var DARK_DEFAULT_HUES = {
101101
'background': {
102102
'default': '800',
103-
'hue-1': '300',
104-
'hue-2': '600',
103+
'hue-1': '600',
104+
'hue-2': '300',
105105
'hue-3': '900'
106106
}
107107
};

0 commit comments

Comments
 (0)