switch.css 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*!
  2. * Angular Material Design
  3. * https://github.com/angular/material
  4. * @license MIT
  5. * v0.11.4
  6. */
  7. md-switch {
  8. display: -webkit-flex;
  9. display: -ms-flexbox;
  10. display: flex;
  11. -webkit-align-items: center;
  12. -ms-flex-align: center;
  13. align-items: center;
  14. margin: 15px;
  15. white-space: nowrap;
  16. cursor: pointer;
  17. outline: none;
  18. -webkit-user-select: none;
  19. -moz-user-select: none;
  20. -ms-user-select: none;
  21. user-select: none; }
  22. md-switch .md-container {
  23. cursor: -webkit-grab;
  24. cursor: grab;
  25. width: 36px;
  26. height: 24px;
  27. position: relative;
  28. -webkit-user-select: none;
  29. -moz-user-select: none;
  30. -ms-user-select: none;
  31. user-select: none;
  32. margin-right: 8px; }
  33. md-switch:not([disabled]) .md-dragging, md-switch:not([disabled]).md-dragging .md-container {
  34. cursor: -webkit-grabbing;
  35. cursor: grabbing; }
  36. md-switch.md-focused:not([disabled]) .md-thumb:before {
  37. left: -8px;
  38. top: -8px;
  39. right: -8px;
  40. bottom: -8px; }
  41. md-switch.md-focused:not([disabled]):not(.md-checked) .md-thumb:before {
  42. background-color: rgba(0, 0, 0, 0.12); }
  43. md-switch .md-label {
  44. border-color: transparent;
  45. border-width: 0; }
  46. md-switch .md-bar {
  47. left: 1px;
  48. width: 34px;
  49. top: 5px;
  50. height: 14px;
  51. border-radius: 8px;
  52. position: absolute; }
  53. md-switch .md-thumb-container {
  54. top: 2px;
  55. left: 0;
  56. width: 16px;
  57. position: absolute;
  58. -webkit-transform: translate3d(0, 0, 0);
  59. transform: translate3d(0, 0, 0);
  60. z-index: 1; }
  61. md-switch.md-checked .md-thumb-container {
  62. -webkit-transform: translate3d(100%, 0, 0);
  63. transform: translate3d(100%, 0, 0); }
  64. md-switch .md-thumb {
  65. position: absolute;
  66. margin: 0;
  67. left: 0;
  68. top: 0;
  69. outline: none;
  70. height: 20px;
  71. width: 20px;
  72. border-radius: 50%;
  73. box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 2px 1px -1px rgba(0, 0, 0, 0.12); }
  74. md-switch .md-thumb:before {
  75. background-color: transparent;
  76. border-radius: 50%;
  77. content: '';
  78. position: absolute;
  79. display: block;
  80. height: auto;
  81. left: 0;
  82. top: 0;
  83. right: 0;
  84. bottom: 0;
  85. transition: all 0.5s;
  86. width: auto; }
  87. md-switch .md-thumb .md-ripple-container {
  88. position: absolute;
  89. display: block;
  90. width: auto;
  91. height: auto;
  92. left: -20px;
  93. top: -20px;
  94. right: -20px;
  95. bottom: -20px; }
  96. md-switch:not(.md-dragging) .md-bar, md-switch:not(.md-dragging) .md-thumb-container, md-switch:not(.md-dragging) .md-thumb {
  97. transition: all 0.08s linear;
  98. transition-property: -webkit-transform, background-color;
  99. transition-property: transform, background-color; }
  100. md-switch:not(.md-dragging) .md-bar, md-switch:not(.md-dragging) .md-thumb {
  101. transition-delay: 0.05s; }
  102. @media screen and (-ms-high-contrast: active) {
  103. md-switch.md-default-theme .md-bar {
  104. background-color: #666; }
  105. md-switch.md-default-theme.md-checked .md-bar {
  106. background-color: #9E9E9E; }
  107. md-switch.md-default-theme .md-thumb {
  108. background-color: #fff; } }