u-switch.css 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. @charset "UTF-8";
  2. /**
  3. * 下方引入的为uView UI的集成样式文件,为scss预处理器,其中包含了一些"u-"开头的自定义变量
  4. * uView自定义的css类名和scss变量,均以"u-"开头,不会造成冲突,请放心使用
  5. */
  6. .u-switch.data-v-7cafa8c0 {
  7. position: relative;
  8. display: inline-block;
  9. box-sizing: initial;
  10. width: 2em;
  11. height: 1em;
  12. background-color: #fff;
  13. border: 1px solid rgba(0, 0, 0, 0.1);
  14. border-radius: 1em;
  15. -webkit-transition: background-color 0.3s;
  16. transition: background-color 0.3s;
  17. font-size: 50rpx;
  18. }
  19. .u-switch__node.data-v-7cafa8c0 {
  20. display: -webkit-box;
  21. display: -webkit-flex;
  22. display: flex;
  23. -webkit-box-orient: horizontal;
  24. -webkit-box-direction: normal;
  25. -webkit-flex-direction: row;
  26. flex-direction: row;
  27. -webkit-box-align: center;
  28. -webkit-align-items: center;
  29. align-items: center;
  30. -webkit-box-pack: center;
  31. -webkit-justify-content: center;
  32. justify-content: center;
  33. position: absolute;
  34. top: 0;
  35. left: 0;
  36. border-radius: 100%;
  37. z-index: 1;
  38. background-color: #fff;
  39. background-color: #fff;
  40. box-shadow: 0 3px 1px 0 rgba(0, 0, 0, 0.05), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 3px 3px 0 rgba(0, 0, 0, 0.05);
  41. box-shadow: 0 3px 1px 0 rgba(0, 0, 0, 0.05), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 3px 3px 0 rgba(0, 0, 0, 0.05);
  42. -webkit-transition: -webkit-transform 0.3s cubic-bezier(0.3, 1.05, 0.4, 1.05);
  43. transition: -webkit-transform 0.3s cubic-bezier(0.3, 1.05, 0.4, 1.05);
  44. transition: transform 0.3s cubic-bezier(0.3, 1.05, 0.4, 1.05);
  45. transition: transform 0.3s cubic-bezier(0.3, 1.05, 0.4, 1.05), -webkit-transform 0.3s cubic-bezier(0.3, 1.05, 0.4, 1.05);
  46. -webkit-transition: -webkit-transform cubic-bezier(0.3, 1.05, 0.4, 1.05);
  47. transition: -webkit-transform cubic-bezier(0.3, 1.05, 0.4, 1.05);
  48. transition: transform cubic-bezier(0.3, 1.05, 0.4, 1.05);
  49. transition: transform cubic-bezier(0.3, 1.05, 0.4, 1.05), -webkit-transform cubic-bezier(0.3, 1.05, 0.4, 1.05);
  50. transition: transform 0.3s cubic-bezier(0.3, 1.05, 0.4, 1.05);
  51. }
  52. .u-switch__loading.data-v-7cafa8c0 {
  53. display: -webkit-box;
  54. display: -webkit-flex;
  55. display: flex;
  56. -webkit-box-orient: horizontal;
  57. -webkit-box-direction: normal;
  58. -webkit-flex-direction: row;
  59. flex-direction: row;
  60. -webkit-box-align: center;
  61. -webkit-align-items: center;
  62. align-items: center;
  63. -webkit-box-pack: center;
  64. -webkit-justify-content: center;
  65. justify-content: center;
  66. }
  67. .u-switch--on.data-v-7cafa8c0 {
  68. background-color: #1989fa;
  69. }
  70. .u-switch--on .u-switch__node.data-v-7cafa8c0 {
  71. -webkit-transform: translateX(100%);
  72. transform: translateX(100%);
  73. }
  74. .u-switch--disabled.data-v-7cafa8c0 {
  75. opacity: 0.4;
  76. }