index.scss 2.1 KB

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