u-switch.wxss 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. @charset "UTF-8";
  2. /**
  3. * 这里是uni-app内置的常用样式变量
  4. *
  5. * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
  6. * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
  7. *
  8. */
  9. /**
  10. * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
  11. *
  12. * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
  13. */
  14. /* 颜色变量 */
  15. /* 行为相关颜色 */
  16. /* 文字基本颜色 */
  17. /* 背景颜色 */
  18. /* 边框颜色 */
  19. /* 尺寸变量 */
  20. /* 文字尺寸 */
  21. /* 图片尺寸 */
  22. /* Border Radius */
  23. /* 水平间距 */
  24. /* 垂直间距 */
  25. /* 透明度 */
  26. /* 文章场景相关 */
  27. .u-switch.data-v-7cafa8c0 {
  28. position: relative;
  29. display: inline-block;
  30. box-sizing: initial;
  31. width: 2em;
  32. height: 1em;
  33. background-color: #fff;
  34. border: 1px solid rgba(0, 0, 0, 0.1);
  35. border-radius: 1em;
  36. -webkit-transition: background-color 0.3s;
  37. transition: background-color 0.3s;
  38. font-size: 50rpx;
  39. }
  40. .u-switch__node.data-v-7cafa8c0 {
  41. display: -webkit-box;
  42. display: -webkit-flex;
  43. display: flex;
  44. -webkit-box-orient: horizontal;
  45. -webkit-box-direction: normal;
  46. -webkit-flex-direction: row;
  47. flex-direction: row;
  48. -webkit-box-align: center;
  49. -webkit-align-items: center;
  50. align-items: center;
  51. -webkit-box-pack: center;
  52. -webkit-justify-content: center;
  53. justify-content: center;
  54. position: absolute;
  55. top: 0;
  56. left: 0;
  57. border-radius: 100%;
  58. z-index: 1;
  59. background-color: #fff;
  60. background-color: #fff;
  61. 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);
  62. 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);
  63. -webkit-transition: -webkit-transform 0.3s cubic-bezier(0.3, 1.05, 0.4, 1.05);
  64. transition: -webkit-transform 0.3s cubic-bezier(0.3, 1.05, 0.4, 1.05);
  65. transition: transform 0.3s cubic-bezier(0.3, 1.05, 0.4, 1.05);
  66. 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);
  67. -webkit-transition: -webkit-transform cubic-bezier(0.3, 1.05, 0.4, 1.05);
  68. transition: -webkit-transform cubic-bezier(0.3, 1.05, 0.4, 1.05);
  69. transition: transform cubic-bezier(0.3, 1.05, 0.4, 1.05);
  70. transition: transform cubic-bezier(0.3, 1.05, 0.4, 1.05), -webkit-transform cubic-bezier(0.3, 1.05, 0.4, 1.05);
  71. transition: transform 0.3s cubic-bezier(0.3, 1.05, 0.4, 1.05);
  72. }
  73. .u-switch__loading.data-v-7cafa8c0 {
  74. display: -webkit-box;
  75. display: -webkit-flex;
  76. display: flex;
  77. -webkit-box-orient: horizontal;
  78. -webkit-box-direction: normal;
  79. -webkit-flex-direction: row;
  80. flex-direction: row;
  81. -webkit-box-align: center;
  82. -webkit-align-items: center;
  83. align-items: center;
  84. -webkit-box-pack: center;
  85. -webkit-justify-content: center;
  86. justify-content: center;
  87. }
  88. .u-switch--on.data-v-7cafa8c0 {
  89. background-color: #1989fa;
  90. }
  91. .u-switch--on .u-switch__node.data-v-7cafa8c0 {
  92. -webkit-transform: translateX(100%);
  93. transform: translateX(100%);
  94. }
  95. .u-switch--disabled.data-v-7cafa8c0 {
  96. opacity: 0.4;
  97. }