UNPKG

6.75 kBSCSSView Raw
1//
2// Copyright 2022 Google Inc.
3//
4// Permission is hereby granted, free of charge, to any person obtaining a copy
5// of this software and associated documentation files (the "Software"), to deal
6// in the Software without restriction, including without limitation the rights
7// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8// copies of the Software, and to permit persons to whom the Software is
9// furnished to do so, subject to the following conditions:
10//
11// The above copyright notice and this permission notice shall be included in
12// all copies or substantial portions of the Software.
13//
14// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20// THE SOFTWARE.
21//
22
23// Selector '.mdc-*' should only be used in this project.
24// stylelint-disable selector-class-pattern --
25// NOTE: this is the implementation of the aforementioned classes.
26
27@use 'sass:map';
28@use '@material/theme/theme';
29@use '@material/tokens/resolvers';
30@use './select-theme';
31
32$_light-theme: (
33 menu-cascading-menu-indicator-icon-color: null,
34 menu-cascading-menu-indicator-icon-size: null,
35 menu-container-color: null,
36 menu-container-elevation: null,
37 menu-container-shadow-color: null,
38 menu-container-shape: null,
39 menu-container-surface-tint-layer-color: null,
40 menu-divider-color: null,
41 menu-divider-height: null,
42 menu-list-item-container-height: null,
43 menu-list-item-label-text-color: null,
44 menu-list-item-label-text-font: null,
45 menu-list-item-label-text-line-height: null,
46 menu-list-item-label-text-size: null,
47 menu-list-item-label-text-tracking: null,
48 menu-list-item-label-text-weight: null,
49 menu-list-item-selected-container-color: null,
50 menu-list-item-with-leading-icon-leading-icon-color: null,
51 menu-list-item-with-leading-icon-leading-icon-size: null,
52 menu-list-item-with-trailing-icon-trailing-icon-color: null,
53 menu-list-item-with-trailing-icon-trailing-icon-size: null,
54 text-field-caret-color: null,
55 text-field-hover-caret-color: null,
56 text-field-focus-caret-color: null,
57 text-field-container-color: null,
58 text-field-container-height: null,
59 text-field-container-shape: null,
60 text-field-disabled-input-text-color: null,
61 text-field-disabled-input-text-opacity: null,
62 text-field-disabled-label-text-color: null,
63 text-field-disabled-label-text-opacity: null,
64 text-field-disabled-leading-icon-color: null,
65 text-field-disabled-leading-icon-opacity: null,
66 text-field-disabled-outline-color: null,
67 text-field-disabled-outline-opacity: null,
68 text-field-disabled-outline-width: null,
69 text-field-disabled-supporting-text-color: null,
70 text-field-disabled-supporting-text-opacity: null,
71 text-field-disabled-trailing-icon-color: null,
72 text-field-disabled-trailing-icon-opacity: null,
73 text-field-error-caret-color: null,
74 text-field-error-hover-caret-color: null,
75 text-field-error-focus-caret-color: null,
76 text-field-error-focus-input-text-color: null,
77 text-field-error-focus-label-text-color: null,
78 text-field-error-focus-leading-icon-color: null,
79 text-field-error-focus-outline-color: null,
80 text-field-error-focus-supporting-text-color: null,
81 text-field-error-focus-trailing-icon-color: null,
82 text-field-error-hover-input-text-color: null,
83 text-field-error-hover-label-text-color: null,
84 text-field-error-hover-leading-icon-color: null,
85 text-field-error-hover-outline-color: null,
86 text-field-error-hover-state-layer-color: null,
87 text-field-error-hover-state-layer-opacity: null,
88 text-field-error-hover-supporting-text-color: null,
89 text-field-error-hover-trailing-icon-color: null,
90 text-field-error-input-text-color: null,
91 text-field-error-label-text-color: null,
92 text-field-error-leading-icon-color: null,
93 text-field-error-outline-color: null,
94 text-field-error-supporting-text-color: null,
95 text-field-error-trailing-icon-color: null,
96 text-field-focus-input-text-color: null,
97 text-field-focus-label-text-color: null,
98 text-field-focus-leading-icon-color: null,
99 text-field-focus-outline-color: null,
100 text-field-focus-outline-width: null,
101 text-field-focus-supporting-text-color: null,
102 text-field-focus-trailing-icon-color: null,
103 text-field-hover-input-text-color: null,
104 text-field-hover-label-text-color: null,
105 text-field-hover-leading-icon-color: null,
106 text-field-hover-outline-color: null,
107 text-field-hover-outline-width: null,
108 text-field-hover-state-layer-color: null,
109 text-field-hover-state-layer-opacity: null,
110 text-field-hover-supporting-text-color: null,
111 text-field-hover-trailing-icon-color: null,
112 text-field-input-text-color: null,
113 text-field-input-text-font: null,
114 text-field-input-text-line-height: null,
115 text-field-input-text-size: null,
116 text-field-input-text-tracking: null,
117 text-field-input-text-weight: null,
118 text-field-label-text-color: null,
119 text-field-label-text-font: null,
120 text-field-label-text-line-height: null,
121 text-field-label-text-populated-line-height: null,
122 text-field-label-text-populated-size: null,
123 text-field-label-text-size: null,
124 text-field-label-text-tracking: null,
125 text-field-label-text-weight: null,
126 text-field-leading-icon-color: null,
127 text-field-leading-icon-size: null,
128 text-field-outline-color: null,
129 text-field-outline-width: null,
130 text-field-supporting-text-color: null,
131 text-field-supporting-text-font: null,
132 text-field-supporting-text-line-height: null,
133 text-field-supporting-text-size: null,
134 text-field-supporting-text-tracking: null,
135 text-field-supporting-text-weight: null,
136 text-field-trailing-icon-color: null,
137 text-field-trailing-icon-size: null,
138);
139
140@mixin theme-styles($theme, $resolvers: resolvers.$material) {
141 @include theme.validate-theme($_light-theme, $theme);
142 @include select-theme.theme-styles($theme, $resolvers: $resolvers);
143 @if map.get($theme, text-field-container-height) {
144 @include select-theme.outlined-height(
145 map.get($theme, text-field-container-height)
146 );
147 &.mdc-select--with-leading-icon {
148 @include select-theme.outlined-with-leading-icon-height(
149 map.get($theme, text-field-container-height)
150 );
151 }
152 }
153 @if map.get($theme, text-field-container-shape) {
154 @include select-theme.outline-shape-radius(
155 map.get($theme, text-field-container-shape),
156 $height: map.get($theme, text-field-container-height)
157 );
158 }
159}