_select-outlined-theme.scss 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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. // Selector '.mdc-*' should only be used in this project.
  23. // stylelint-disable selector-class-pattern --
  24. // NOTE: this is the implementation of the aforementioned classes.
  25. @use 'sass:map';
  26. @use '@material/theme/theme';
  27. @use '@material/theme/keys';
  28. @use '@material/tokens/resolvers';
  29. @use './select-theme';
  30. @use './select-shared-theme';
  31. $_light-theme: (
  32. menu-cascading-menu-indicator-icon-color: null,
  33. menu-cascading-menu-indicator-icon-size: null,
  34. menu-container-color: null,
  35. menu-container-elevation: null,
  36. menu-container-shadow-color: null,
  37. menu-container-shape: null,
  38. menu-container-surface-tint-layer-color: null,
  39. menu-divider-color: null,
  40. menu-divider-height: null,
  41. menu-list-item-container-height: null,
  42. menu-list-item-focus-state-layer-color: null,
  43. menu-list-item-focus-state-layer-opacity: null,
  44. menu-list-item-hover-state-layer-color: null,
  45. menu-list-item-hover-state-layer-opacity: null,
  46. menu-list-item-label-text-color: null,
  47. menu-list-item-label-text-font: null,
  48. menu-list-item-label-text-line-height: null,
  49. menu-list-item-label-text-size: null,
  50. menu-list-item-label-text-tracking: null,
  51. menu-list-item-label-text-type: null,
  52. menu-list-item-label-text-weight: null,
  53. menu-list-item-pressed-state-layer-color: null,
  54. menu-list-item-pressed-state-layer-opacity: null,
  55. menu-list-item-selected-container-color: null,
  56. menu-list-item-with-leading-icon-leading-icon-color: null,
  57. menu-list-item-with-leading-icon-leading-icon-size: null,
  58. menu-list-item-with-trailing-icon-trailing-icon-color: null,
  59. menu-list-item-with-trailing-icon-trailing-icon-size: null,
  60. text-field-caret-color: null,
  61. text-field-container-color: null,
  62. text-field-container-height: null,
  63. text-field-container-shape: null,
  64. text-field-disabled-input-text-color: null,
  65. text-field-disabled-input-text-opacity: null,
  66. text-field-disabled-label-text-color: null,
  67. text-field-disabled-label-text-opacity: null,
  68. text-field-disabled-leading-icon-color: null,
  69. text-field-disabled-leading-icon-opacity: null,
  70. text-field-disabled-outline-color: null,
  71. text-field-disabled-outline-opacity: null,
  72. text-field-disabled-outline-width: null,
  73. text-field-disabled-supporting-text-color: null,
  74. text-field-disabled-supporting-text-opacity: null,
  75. text-field-disabled-trailing-icon-color: null,
  76. text-field-disabled-trailing-icon-opacity: null,
  77. text-field-error-caret-color: null,
  78. text-field-error-focus-caret-color: null,
  79. text-field-error-focus-input-text-color: null,
  80. text-field-error-focus-label-text-color: null,
  81. text-field-error-focus-leading-icon-color: null,
  82. text-field-error-focus-outline-color: null,
  83. text-field-error-focus-supporting-text-color: null,
  84. text-field-error-focus-trailing-icon-color: null,
  85. text-field-error-hover-caret-color: null,
  86. text-field-error-hover-input-text-color: null,
  87. text-field-error-hover-label-text-color: null,
  88. text-field-error-hover-leading-icon-color: null,
  89. text-field-error-hover-outline-color: null,
  90. text-field-error-hover-state-layer-color: null,
  91. text-field-error-hover-state-layer-opacity: null,
  92. text-field-error-hover-supporting-text-color: null,
  93. text-field-error-hover-trailing-icon-color: null,
  94. text-field-error-input-text-color: null,
  95. text-field-error-label-text-color: null,
  96. text-field-error-leading-icon-color: null,
  97. text-field-error-outline-color: null,
  98. text-field-error-supporting-text-color: null,
  99. text-field-error-trailing-icon-color: null,
  100. text-field-focus-caret-color: null,
  101. text-field-focus-input-text-color: null,
  102. text-field-focus-label-text-color: null,
  103. text-field-focus-leading-icon-color: null,
  104. text-field-focus-outline-color: null,
  105. text-field-focus-outline-width: null,
  106. text-field-focus-supporting-text-color: null,
  107. text-field-focus-trailing-icon-color: null,
  108. text-field-hover-caret-color: null,
  109. text-field-hover-input-text-color: null,
  110. text-field-hover-label-text-color: null,
  111. text-field-hover-leading-icon-color: null,
  112. text-field-hover-outline-color: null,
  113. text-field-hover-outline-width: null,
  114. text-field-hover-state-layer-color: null,
  115. text-field-hover-state-layer-opacity: null,
  116. text-field-hover-supporting-text-color: null,
  117. text-field-hover-trailing-icon-color: null,
  118. text-field-input-text-color: null,
  119. text-field-input-text-font: null,
  120. text-field-input-text-line-height: null,
  121. text-field-input-text-size: null,
  122. text-field-input-text-tracking: null,
  123. text-field-input-text-type: null,
  124. text-field-input-text-weight: null,
  125. text-field-label-text-color: null,
  126. text-field-label-text-font: null,
  127. text-field-label-text-line-height: null,
  128. text-field-label-text-populated-line-height: null,
  129. text-field-label-text-populated-size: null,
  130. text-field-label-text-size: null,
  131. text-field-label-text-tracking: null,
  132. text-field-label-text-type: null,
  133. text-field-label-text-weight: null,
  134. text-field-leading-icon-color: null,
  135. text-field-leading-icon-size: null,
  136. text-field-outline-color: null,
  137. text-field-outline-width: null,
  138. text-field-supporting-text-color: null,
  139. text-field-supporting-text-font: null,
  140. text-field-supporting-text-line-height: null,
  141. text-field-supporting-text-size: null,
  142. text-field-supporting-text-tracking: null,
  143. text-field-supporting-text-type: null,
  144. text-field-supporting-text-weight: null,
  145. text-field-trailing-icon-color: null,
  146. text-field-trailing-icon-size: null,
  147. );
  148. $custom-property-prefix: 'outlined-select';
  149. @mixin theme($theme, $resolvers: resolvers.$material) {
  150. @include theme.validate-theme($_light-theme, $theme);
  151. $theme: select-shared-theme.resolve-theme($theme, $resolvers);
  152. @include keys.declare-custom-properties($theme, $custom-property-prefix);
  153. }
  154. @mixin theme-styles($theme, $resolvers: resolvers.$material) {
  155. @include theme.validate-theme-styles($_light-theme, $theme);
  156. $theme: select-shared-theme.resolve-theme($theme, $resolvers);
  157. $theme: keys.create-theme-properties(
  158. $theme,
  159. $prefix: $custom-property-prefix
  160. );
  161. @include select-theme.theme-styles($theme, $resolvers: $resolvers);
  162. @if map.get($theme, text-field-container-height) {
  163. @include select-theme.outlined-height(
  164. map.get($theme, text-field-container-height)
  165. );
  166. &.mdc-select--with-leading-icon {
  167. @include select-theme.outlined-with-leading-icon-height(
  168. map.get($theme, text-field-container-height)
  169. );
  170. }
  171. }
  172. @if map.get($theme, text-field-container-shape) {
  173. @include select-theme.outline-shape-radius(
  174. map.get($theme, text-field-container-shape),
  175. $height: map.get($theme, text-field-container-height)
  176. );
  177. }
  178. }