_variant.sass 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. @use "./absolute" as *
  2. @use "./elevation" as *
  3. @mixin variant($contained-background, $contained-color, $contained-elevation, $plain-opacity, $name)
  4. &--variant-plain,
  5. &--variant-outlined,
  6. &--variant-text,
  7. &--variant-tonal
  8. background: transparent
  9. color: inherit
  10. &--variant-plain
  11. opacity: $plain-opacity
  12. &:focus,
  13. &:hover
  14. opacity: 1
  15. &--variant-plain
  16. .#{$name}__overlay
  17. display: none
  18. &--variant-elevated,
  19. &--variant-flat
  20. background: $contained-background
  21. color: $contained-color
  22. @if ($contained-elevation > 0)
  23. &--variant-elevated
  24. @include elevation($contained-elevation)
  25. &--variant-flat
  26. @include elevation(0)
  27. &--variant-outlined
  28. border: thin solid currentColor
  29. &--variant-text
  30. .#{$name}__overlay
  31. background: currentColor
  32. &--variant-tonal
  33. .#{$name}__underlay
  34. background: currentColor
  35. opacity: var(--v-activated-opacity)
  36. border-radius: inherit
  37. position: absolute
  38. top: 0
  39. right: 0
  40. bottom: 0
  41. left: 0
  42. pointer-events: none