checkbox.scss 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. .cl-checkbox {
  2. display: inline-block;
  3. line-height: 40rpx;
  4. font-size: 26rpx;
  5. transition: all 0.3s;
  6. &__input {
  7. display: inline-block;
  8. vertical-align: middle;
  9. height: 40rpx;
  10. width: 40rpx;
  11. text-align: center;
  12. color: #999;
  13. margin-right: 14rpx;
  14. box-sizing: border-box;
  15. border: 1px solid #ddd;
  16. border-radius: 6rpx;
  17. position: relative;
  18. top: -2rpx;
  19. transition: all 0.3s;
  20. text {
  21. font-size: 24rpx;
  22. position: relative;
  23. top: -2rpx;
  24. }
  25. }
  26. &__label {
  27. display: inline;
  28. }
  29. &.is-checked {
  30. .cl-checkbox__input {
  31. background-color: $cl-color-primary;
  32. border-color: $cl-color-primary;
  33. color: #fff;
  34. }
  35. }
  36. &.is-disabled {
  37. .cl-checkbox__input {
  38. background-color: #f5f7fa;
  39. border-color: #e4e7ed;
  40. color: #c0c4cc;
  41. }
  42. .cl-checkbox__label {
  43. color: #c0c4cc;
  44. }
  45. }
  46. &.is-fill {
  47. width: 100%;
  48. }
  49. &--border {
  50. border-radius: 10rpx;
  51. padding: 14rpx 20rpx;
  52. border: 1rpx solid #ddd;
  53. box-sizing: border-box;
  54. .cl-checkbox__input {
  55. display: none;
  56. }
  57. &.is-checked {
  58. border: 1rpx solid $cl-color-primary;
  59. background-color: $cl-color-primary;
  60. color: #fff;
  61. }
  62. }
  63. &--round {
  64. .cl-checkbox__input {
  65. border-radius: 100%;
  66. }
  67. }
  68. }
  69. .cl-checkbox + .cl-checkbox,
  70. cl-checkbox + cl-checkbox {
  71. margin-left: 20rpx;
  72. }
  73. /* #ifdef MP-TOUTIAO */
  74. .cl-checkbox {
  75. margin-right: 20rpx;
  76. }
  77. /* #endif */