VSelectionControl.sass 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. @use 'sass:map'
  2. @use 'sass:list'
  3. @use '../../styles/settings'
  4. @use '../../styles/tools'
  5. @use './variables' as *
  6. .v-selection-control
  7. align-items: center
  8. contain: layout
  9. display: flex
  10. flex: 1 0
  11. grid-area: control
  12. position: relative
  13. user-select: none
  14. .v-label
  15. white-space: normal
  16. word-break: break-word
  17. height: 100%
  18. width: 100%
  19. &--disabled
  20. opacity: var(--v-disabled-opacity)
  21. pointer-events: none
  22. &--error,
  23. &--disabled
  24. .v-label
  25. opacity: 1
  26. &--error:not(.v-selection-control--disabled)
  27. .v-label
  28. color: rgb(var(--v-theme-error))
  29. &--inline
  30. display: inline-flex
  31. flex: 0 0 auto
  32. min-width: 0
  33. max-width: 100%
  34. .v-label
  35. width: auto
  36. @at-root
  37. @include tools.density('v-selection-control', $selection-control-density) using ($modifier)
  38. --v-selection-control-size: #{$selection-control-size + $modifier}
  39. .v-selection-control__wrapper
  40. width: var(--v-selection-control-size)
  41. height: var(--v-selection-control-size)
  42. display: inline-flex
  43. align-items: center
  44. position: relative
  45. justify-content: center
  46. flex: none
  47. .v-selection-control__input
  48. width: var(--v-selection-control-size)
  49. height: var(--v-selection-control-size)
  50. align-items: center
  51. display: flex
  52. flex: none
  53. justify-content: center
  54. position: relative
  55. border-radius: 50%
  56. input
  57. cursor: pointer
  58. position: absolute
  59. left: 0
  60. top: 0
  61. width: 100%
  62. height: 100%
  63. opacity: 0
  64. &::before
  65. @include tools.absolute(true)
  66. border-radius: 100%
  67. background-color: currentColor
  68. opacity: 0
  69. pointer-events: none
  70. &:hover::before
  71. opacity: calc(#{map.get(settings.$states, 'hover')} * var(--v-theme-overlay-multiplier))
  72. > .v-icon
  73. opacity: var(--v-medium-emphasis-opacity)
  74. .v-selection-control--disabled &,
  75. .v-selection-control--dirty &,
  76. .v-selection-control--error &
  77. > .v-icon
  78. opacity: 1
  79. .v-selection-control--error:not(.v-selection-control--disabled) &
  80. > .v-icon
  81. color: rgb(var(--v-theme-error))
  82. .v-selection-control--focus-visible &::before
  83. opacity: calc(#{map.get(settings.$states, 'focus')} * var(--v-theme-overlay-multiplier))