claukiller

Untitled

Mar 2nd, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. checbox b&w
  2.  
  3. <template>
  4. <label class="epb-checkbox">
  5. <input class="epb_checkbox__input"
  6. type="checkbox">
  7. <span class="epb-checkbox__check">
  8. </span>
  9. </label>
  10. </template>
  11.  
  12. <script lang="ts">
  13.  
  14. export default {
  15. name: 'epb-checkbox',
  16. props: {
  17. label: String,
  18. value: Boolean,
  19. disabled: Boolean,
  20. checked: Boolean,
  21. position: {
  22. type: String,
  23. default: 'left'
  24. },
  25. trueValue: {
  26. default: true
  27. },
  28. falseValue: {
  29. default: false
  30. },
  31. color: {
  32. type: String,
  33. default: 'primary'
  34. }
  35. },
  36. computed: {},
  37. methods: {
  38. onClick: function (event): void {
  39. this.$emit('click', event);
  40. }
  41. }
  42. };
  43. </script>
  44.  
  45. <style lang="scss" scoped>
  46.  
  47. .epb-checkbox {
  48.  
  49. height: 24px;
  50. width: 24px;
  51. display: block;
  52. position: relative;
  53. margin: auto;
  54. cursor: pointer;
  55. font-size: 22px;
  56. line-height: 24px;
  57.  
  58. input:checked ~ .epb-checkbox__check::after {
  59. transform: rotate(45deg) scale(1);
  60. opacity: 1;
  61. left: 8px;
  62. top: 3px;
  63. width: 6px;
  64. height: 12px;
  65. border: solid white;
  66. border-width: 0 2px 2px 0;
  67. background-color: transparent;
  68. border-radius: 0;
  69. }
  70.  
  71.  
  72. &__input {
  73. position: absolute;
  74. opacity: 0;
  75. cursor: pointer;
  76. }
  77.  
  78. &__check {
  79. position: absolute;
  80. top: 0px;
  81. left: 0px;
  82. height: 24px;
  83. width: 24px;
  84. background-color: pink;
  85. border-radius: 5px;
  86. border: 2px solid pink;
  87.  
  88. &::after {
  89. position: absolute;
  90. content: "";
  91. left: 12px;
  92. top: 12px;
  93. height: 0px;
  94. width: 0px;
  95. border-radius: 5px;
  96. //border: solid black;
  97. border-width: 0 3px 3px 0;
  98. transform: rotate(0deg) scale(0);
  99. opacity: 1;
  100. }
  101. }
  102. }
  103.  
  104.  
  105. </style>
Add Comment
Please, Sign In to add comment