_input-chip-theme.scss 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. //
  2. // Copyright 2021 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. @use 'sass:map';
  23. @use '@material/theme/theme';
  24. @use '@material/theme/keys';
  25. @use '@material/tokens/resolvers';
  26. @use './chip-theme';
  27. $_light-theme: (
  28. container-shape: null,
  29. container-height: null,
  30. container-elevation: null,
  31. outline-color: null,
  32. outline-width: null,
  33. container-shadow-color: null,
  34. label-text-font: null,
  35. label-text-line-height: null,
  36. label-text-size: null,
  37. label-text-weight: null,
  38. label-text-tracking: null,
  39. label-text-color: null,
  40. with-trailing-icon-trailing-icon-size: null,
  41. with-trailing-icon-trailing-icon-color: null,
  42. with-leading-icon-leading-icon-size: null,
  43. with-leading-icon-leading-icon-color: null,
  44. with-avatar-avatar-size: null,
  45. with-avatar-avatar-shape: null,
  46. disabled-outline-color: null,
  47. disabled-outline-opacity: null,
  48. disabled-label-text-color: null,
  49. disabled-label-text-opacity: null,
  50. with-trailing-icon-disabled-trailing-icon-color: null,
  51. with-trailing-icon-disabled-trailing-icon-opacity: null,
  52. with-leading-icon-disabled-leading-icon-color: null,
  53. with-leading-icon-disabled-leading-icon-opacity: null,
  54. with-avatar-disabled-avatar-opacity: null,
  55. hover-state-layer-color: null,
  56. hover-state-layer-opacity: null,
  57. hover-label-text-color: null,
  58. with-trailing-icon-hover-trailing-icon-color: null,
  59. with-leading-icon-hover-leading-icon-color: null,
  60. focus-state-layer-color: null,
  61. focus-state-layer-opacity: null,
  62. focus-label-text-color: null,
  63. focus-outline-color: null,
  64. with-trailing-icon-focus-trailing-icon-color: null,
  65. with-leading-icon-focus-leading-icon-color: null,
  66. pressed-state-layer-color: null,
  67. pressed-state-layer-opacity: null,
  68. pressed-label-text-color: null,
  69. with-trailing-icon-pressed-trailing-icon-color: null,
  70. with-leading-icon-pressed-leading-icon-color: null,
  71. container-surface-tint-layer-color: null,
  72. );
  73. $_custom-property-prefix: 'input-chip';
  74. @mixin theme($theme, $resolvers: resolvers.$material) {
  75. @include theme.validate-theme($_light-theme, $theme);
  76. $theme: chip-theme.resolve-theme($theme, $resolvers: $resolvers);
  77. @include keys.declare-custom-properties(
  78. $theme,
  79. $prefix: $_custom-property-prefix
  80. );
  81. }
  82. @mixin theme-styles($theme, $resolvers: resolvers.$material) {
  83. @include theme.validate-theme-styles($_light-theme, $theme);
  84. $theme: keys.create-theme-properties(
  85. $theme,
  86. $prefix: $_custom-property-prefix
  87. );
  88. @include chip-theme.theme-styles($theme, $resolvers: $resolvers);
  89. }