_assist-chip-theme.scss 3.3 KB

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