radio.scss 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. .m-radio{
  2. color: #606266;
  3. font-weight: 500;
  4. line-height: 1;
  5. position: relative;
  6. display: inline-block;
  7. white-space: nowrap;
  8. outline: none;
  9. font-size: 14px;
  10. margin-right: 30px;
  11. cursor: pointer;
  12. .m-radio__input{
  13. display: inline-block;
  14. line-height: 1;
  15. white-space: nowrap;
  16. outline: none;
  17. position: relative;
  18. vertical-align: middle;
  19. cursor: pointer;
  20. .m-radio__inner{
  21. border: 1px solid #dcdfe6;
  22. border-radius: 100%;
  23. width: 14px;
  24. height: 14px;
  25. background-color: #fff;
  26. cursor: pointer;
  27. display: inline-block;
  28. box-sizing: border-box;
  29. position: relative;
  30. &::after{
  31. width: 4px;
  32. height: 4px;
  33. border-radius: 100%;
  34. background-color: #fff;
  35. content: "";
  36. position: absolute;
  37. left: 50%;
  38. top: 50%;
  39. transform: translate(-50%,-50%);
  40. }
  41. }
  42. .m-radio__original{
  43. opacity: 0;
  44. outline: none;
  45. position: absolute;
  46. z-index: -1;
  47. top: 0;
  48. left: 0;
  49. right: 0;
  50. bottom: 0;
  51. margin: 0;
  52. }
  53. }
  54. .is-checked{
  55. .m-radio__inner{
  56. border-color: #409eff;
  57. background: #409eff;
  58. }
  59. }
  60. .is-checked.is-disabled{
  61. .m-radio__inner{
  62. &::after{
  63. background-color: #c0c4cc;
  64. }
  65. }
  66. }
  67. // 禁用
  68. .is-disabled{
  69. cursor: no-drop;
  70. color: #c0c4cc;
  71. .m-radio__inner{
  72. background-color: #f5f7fa;
  73. border-color: #e4e7ed;
  74. cursor: no-drop;
  75. }
  76. }
  77. .m-radio__label{
  78. padding-left: 8px;
  79. font-size: 14px;
  80. }
  81. }
  82. // 禁用
  83. .is-disabled{
  84. cursor: no-drop;
  85. color: #c0c4cc;
  86. }
  87. // 边框
  88. .is-bordered{
  89. padding: 12px 20px 0 10px;
  90. border-radius: 4px;
  91. border: 1px solid #dcdfe6;
  92. box-sizing: border-box;
  93. height: 40px;
  94. }
  95. .is-bordered.is-checked{
  96. border-color: #409eff;
  97. color: #409eff;
  98. }
  99. .is-bordered.is-disabled{
  100. cursor: not-allowed;
  101. border-color: #ebeef5;
  102. .m-radio__label{
  103. color: #c0c4cc;
  104. }
  105. }