Skip to content

Commit 612ee59

Browse files
committed
refactor(date-picker): material theme readonly state
1 parent 928a2db commit 612ee59

2 files changed

Lines changed: 74 additions & 2 deletions

File tree

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
@use 'styles/utilities' as *;
2+
@use '../light/themes' as *;
3+
4+
$theme: $material;
5+
6+
:host(:not([invalid])[outlined][readonly]:hover) {
7+
igc-date-time-input::part(start),
8+
igc-date-time-input::part(end),
9+
igc-date-time-input::part(filler) {
10+
border-color: var-get($theme, 'border-color');
11+
}
12+
13+
igc-date-time-input::part(notch) {
14+
border-bottom-color: var-get($theme, 'border-color');
15+
}
16+
}
17+
18+
:host(:not([invalid])[outlined][readonly]) {
19+
igc-date-time-input:focus-within {
20+
&::part(start),
21+
&::part(end),
22+
&::part(filler) {
23+
border-color: var-get($theme, 'focused-border-color');
24+
}
25+
26+
&::part(notch) {
27+
border-bottom-color: var-get($theme, 'focused-border-color');
28+
}
29+
}
30+
}
31+
32+
:host(:not([outlined],[disabled])[readonly]) {
33+
igc-date-time-input::part(container) {
34+
background: var-get($theme, 'box-background-focus');
35+
}
36+
}
37+
38+
:host(:not([outlined],[invalid])[readonly]) {
39+
igc-date-time-input:hover {
40+
&::part(container) {
41+
border-bottom-color: var-get($theme, 'idle-bottom-line-color');
42+
43+
&::after {
44+
background: var-get($theme, 'idle-bottom-line-color');
45+
}
46+
}
47+
}
48+
49+
igc-date-time-input:focus-within {
50+
&::part(container) {
51+
border-bottom-color: var-get($theme, 'focused-bottom-line-color');
52+
53+
&::after {
54+
background: var-get($theme, 'focused-bottom-line-color');
55+
}
56+
}
57+
}
58+
}
59+
60+
:host(:not([outlined])[readonly][invalid]) {
61+
igc-date-time-input:hover,
62+
igc-date-time-input:focus-within {
63+
&::part(container) {
64+
border-color: var-get($theme, 'error-secondary-color');
65+
66+
&::after {
67+
border-color: var-get($theme, 'error-secondary-color');
68+
}
69+
}
70+
}
71+
}

src/components/date-picker/themes/themes.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { styles as shared } from './light/date-picker.shared.css.js';
1616
import { styles as bootstrap } from './shared/date-picker.bootstrap.css.js';
1717
import { styles as fluent } from './shared/date-picker.fluent.css.js';
1818
import { styles as indigo } from './shared/date-picker.indigo.css.js';
19+
import { styles as material } from './shared/date-picker.material.css.js';
1920

2021
const light = {
2122
shared: css`
@@ -25,7 +26,7 @@ const light = {
2526
${bootstrap} ${bootstrapLight}
2627
`,
2728
material: css`
28-
${materialLight}
29+
${material} ${materialLight}
2930
`,
3031
fluent: css`
3132
${fluent} ${fluentLight}
@@ -43,7 +44,7 @@ const dark = {
4344
${bootstrap} ${bootstrapDark}
4445
`,
4546
material: css`
46-
${materialDark}
47+
${material} ${materialDark}
4748
`,
4849
fluent: css`
4950
${fluent} ${fluentDark}

0 commit comments

Comments
 (0)