1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | @use '@material/animation/animation';
|
27 | @use '@material/animation/variables';
|
28 | @use '@material/theme/theme';
|
29 | @use '@material/typography/typography';
|
30 | @use '@material/feature-targeting/feature-targeting';
|
31 |
|
32 |
|
33 |
|
34 | @mixin helper-text-core-styles($query: feature-targeting.all()) {
|
35 | $feat-structure: feature-targeting.create-target($query, structure);
|
36 | $feat-animation: feature-targeting.create-target($query, animation);
|
37 |
|
38 |
|
39 |
|
40 | .mdc-text-field-helper-text {
|
41 | @include typography.typography(caption, $query: $query);
|
42 | @include typography.text-baseline($top: 16px, $query: $query);
|
43 |
|
44 | @include feature-targeting.targets($feat-structure) {
|
45 | margin: 0;
|
46 | opacity: 0;
|
47 | will-change: opacity;
|
48 | }
|
49 |
|
50 | @include feature-targeting.targets($feat-animation) {
|
51 | transition: animation.standard(opacity, 150ms);
|
52 | }
|
53 | }
|
54 |
|
55 | .mdc-text-field-helper-text--persistent {
|
56 | @include feature-targeting.targets($feat-animation) {
|
57 | transition: none;
|
58 | }
|
59 |
|
60 | @include feature-targeting.targets($feat-structure) {
|
61 | opacity: 1;
|
62 | will-change: initial;
|
63 | }
|
64 | }
|
65 |
|
66 |
|
67 | }
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 | @mixin helper-text-color($color, $query: feature-targeting.all()) {
|
74 | &:not(.mdc-text-field--disabled) {
|
75 | @include helper-text-color_($color, $query);
|
76 | }
|
77 | }
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 | @mixin disabled-helper-text-color($color, $query: feature-targeting.all()) {
|
84 | &.mdc-text-field--disabled {
|
85 | @include helper-text-color_($color, $query);
|
86 | }
|
87 | }
|
88 |
|
89 | @mixin helper-text-validation-color($color, $query: feature-targeting.all()) {
|
90 | &:not(.mdc-text-field--disabled) {
|
91 | @include helper-text-validation-color_($color, $query);
|
92 | }
|
93 | }
|
94 |
|
95 |
|
96 |
|
97 | @mixin helper-text-color_($color, $query: feature-targeting.all()) {
|
98 | $feat-color: feature-targeting.create-target($query, color);
|
99 |
|
100 | + .mdc-text-field-helper-line .mdc-text-field-helper-text {
|
101 | @include feature-targeting.targets($feat-color) {
|
102 | @include theme.property(color, $color);
|
103 | }
|
104 | }
|
105 | }
|
106 |
|
107 | @mixin helper-text-validation-color_($color, $query: feature-targeting.all()) {
|
108 | $feat-color: feature-targeting.create-target($query, color);
|
109 |
|
110 | &.mdc-text-field--invalid
|
111 | + .mdc-text-field-helper-line
|
112 | .mdc-text-field-helper-text--validation-msg {
|
113 | @include feature-targeting.targets($feat-color) {
|
114 | @include theme.property(color, $color);
|
115 | }
|
116 | }
|
117 | }
|