_filled-card-theme.scss 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. @use '@material/theme/keys';
  22. @use '@material/theme/theme';
  23. @use '@material/tokens/resolvers';
  24. @use './card-shared-theme';
  25. @use './mixins' as card;
  26. @use 'sass:map';
  27. $custom-property-prefix: 'filled-card';
  28. $light-theme: (
  29. container-color: null,
  30. container-elevation: null,
  31. container-shadow-color: null,
  32. container-shape: null,
  33. container-surface-tint-layer-color: null,
  34. disabled-container-color: null,
  35. disabled-container-elevation: null,
  36. disabled-container-opacity: null,
  37. dragged-container-elevation: null,
  38. dragged-state-layer-color: null,
  39. dragged-state-layer-opacity: null,
  40. focus-container-elevation: null,
  41. focus-state-layer-color: null,
  42. focus-state-layer-opacity: null,
  43. hover-container-elevation: null,
  44. hover-state-layer-color: null,
  45. hover-state-layer-opacity: null,
  46. icon-color: null,
  47. icon-size: null,
  48. pressed-container-elevation: null,
  49. pressed-state-layer-color: null,
  50. pressed-state-layer-opacity: null,
  51. );
  52. @mixin theme($theme) {
  53. @include theme.validate-theme($light-theme, $theme);
  54. @include keys.declare-custom-properties(
  55. $theme,
  56. $prefix: $custom-property-prefix
  57. );
  58. }
  59. @mixin theme-styles($theme, $resolver: resolvers.$material) {
  60. @include theme.validate-theme-styles($light-theme, $theme);
  61. $theme: keys.create-theme-properties(
  62. $theme,
  63. $prefix: $custom-property-prefix
  64. );
  65. @include card-shared-theme.theme($theme, $resolver);
  66. @include card.outline(
  67. $color: map.get($theme, container-color),
  68. $thickness: 0
  69. );
  70. }