index.scss 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. .nut-checkboxgroup-vertical .nut-checkbox {
  2. display: block;
  3. margin-top: 8px;
  4. }
  5. .nut-checkbox {
  6. margin-right: 10px;
  7. .nut-checkbox-label {
  8. pointer-events: none;
  9. vertical-align: middle;
  10. }
  11. input {
  12. position: relative;
  13. -webkit-appearance: none;
  14. border-radius: 1%;
  15. background-image: url('https://img11.360buyimg.com/imagetools/jfs/t1/153637/38/10229/854/5fd9cfd3E25c62c2a/fed43bc74cd473dd.png');
  16. background-size: cover;
  17. outline: 0;
  18. opacity: 1;
  19. vertical-align: middle;
  20. margin: 0;
  21. &::after {
  22. position: absolute;
  23. left: 50%;
  24. top: 50%;
  25. content: '';
  26. width: 0;
  27. height: 0;
  28. transform: translate(-50%, -50%);
  29. background: $primary-color;
  30. border-radius: 1%;
  31. opacity: 0;
  32. pointer-events: none;
  33. }
  34. &:checked {
  35. background-image: url('https://img13.360buyimg.com/imagetools/jfs/t1/131359/19/19372/2463/5fd3101bEdaf04120/3c8fa97cd4b22c02.png');
  36. background-repeat: no-repeat;
  37. background-position: center;
  38. border-color: $primary-color;
  39. &:not(:disabled).nut-checkbox-ani::after {
  40. animation: nutPulse 0.25s;
  41. }
  42. }
  43. &:disabled {
  44. background-image: url('https://img14.360buyimg.com/imagetools/jfs/t1/155506/4/9365/704/5fd3103cE779ad491/1939699720df7770.png');
  45. // border-color: $disable-color;
  46. &:checked {
  47. background-image: url('https://img12.360buyimg.com/imagetools/jfs/t1/151947/10/10769/2246/5fe04ceeEd31c1a06/2bb48d747c49f9dd.png');
  48. }
  49. }
  50. }
  51. .nut-checkbox-label {
  52. color: #1d1e1e;
  53. }
  54. &.nut-checkbox-size-base {
  55. input {
  56. width: 18px;
  57. height: 18px;
  58. }
  59. .nut-checkbox-label {
  60. font-size: $font-size-2;
  61. margin-left: 10px;
  62. }
  63. }
  64. &.nut-checkbox-size-small {
  65. input {
  66. width: 16px;
  67. height: 16px;
  68. }
  69. .nut-checkbox-label {
  70. font-size: $font-size-1;
  71. margin-left: 6px;
  72. }
  73. }
  74. &.nut-checkbox-size-large {
  75. input {
  76. width: 22px;
  77. height: 22px;
  78. }
  79. .nut-checkbox-label {
  80. font-size: $font-size-3;
  81. margin-left: 10px;
  82. }
  83. }
  84. }
  85. @keyframes nutPulse {
  86. 0% {
  87. width: 100%;
  88. height: 100%;
  89. opacity: 0.5;
  90. }
  91. 100% {
  92. width: 150%;
  93. height: 150%;
  94. opacity: 0;
  95. }
  96. }