|
| 1 | +$checkbox-line-height: 17px !default; |
| 2 | +$checkbox-input-type-height: 17px !default; |
| 3 | +$checkbox-input-type-width: 17px !default; |
| 4 | +$checkbox-border: solid 1px !default; |
| 5 | +$checkbox-border-radius: $global-radius !default; |
| 6 | +$checkbox-input-margin-top: 0 !default; |
| 7 | +$checkbox-input-margin-right: -1rem !default; |
| 8 | +$checkbox-input-margin-bottom: -1rem !default; |
| 9 | +$checkbox-input-margin-left: 0 !default; |
| 10 | +$checkbox-mark-height: $checkbox-input-type-height !default; |
| 11 | +$checkbox-mark-width: $checkbox-input-type-width !default; |
| 12 | + |
| 13 | +$checkbox-unchecked-color: $white !default; |
| 14 | +$checkbox-unchecked-border-color: $medium-gray !default; |
| 15 | +$checkbox-unchecked-background-color: $white !default; |
| 16 | + |
| 17 | +$checkbox-checked-color: $white !default; |
| 18 | +$checkbox-checked-border-color: $primary-color !default; |
| 19 | +$checkbox-checked-background-color: $primary-color !default; |
| 20 | + |
| 21 | +$checkbox-indeterminate-color: $dark-gray !default; |
| 22 | +$checkbox-indeterminate-border-color: $medium-gray !default; |
| 23 | +$checkbox-indeterminate-background-color: $white !default; |
| 24 | + |
| 25 | +$checkbox-disabled-color: $medium-gray !default; |
| 26 | +$checkbox-disabled-border-color: $medium-gray !default; |
| 27 | +$checkbox-disabled-background-color: $light-gray !default; |
| 28 | + |
| 29 | +$checkbox-focus-border-color: rgba(0,0,0,0.3) !default; |
| 30 | + |
| 31 | +.ff-checkbox { |
| 32 | + display: inline-block; |
| 33 | + position: relative; |
| 34 | + |
| 35 | + line-height: $checkbox-line-height; |
| 36 | + |
| 37 | + input[type="checkbox"] { |
| 38 | + height: $checkbox-input-type-height; |
| 39 | + width: $checkbox-input-type-width; |
| 40 | + |
| 41 | + margin-top: $checkbox-input-margin-top; |
| 42 | + margin-right: $checkbox-input-margin-right; |
| 43 | + margin-bottom: $checkbox-input-margin-bottom; |
| 44 | + margin-left: $checkbox-input-margin-left; |
| 45 | + |
| 46 | + position: absolute; |
| 47 | + overflow: hidden; |
| 48 | + padding: 0; |
| 49 | + border: 0; |
| 50 | + opacity: 0.001; |
| 51 | + z-index: 1; |
| 52 | + vertical-align: top; |
| 53 | + outline: none; |
| 54 | + |
| 55 | + &:hover { |
| 56 | + cursor: pointer; |
| 57 | + } |
| 58 | + } |
| 59 | + |
| 60 | + .ff-checkbox-mark { |
| 61 | + box-sizing: border-box; |
| 62 | + height: $checkbox-mark-height; |
| 63 | + width: $checkbox-mark-width; |
| 64 | + display: inline-block; |
| 65 | + vertical-align: top; |
| 66 | + border-radius: $checkbox-border-radius; |
| 67 | + border: $checkbox-border; |
| 68 | + |
| 69 | + border-color: $checkbox-unchecked-border-color; |
| 70 | + background-color: $checkbox-unchecked-background-color; |
| 71 | + |
| 72 | + &::after { |
| 73 | + content: ''; |
| 74 | + display: block; |
| 75 | + position: absolute; |
| 76 | + } |
| 77 | + } |
| 78 | + |
| 79 | + input[type="checkbox"] { |
| 80 | + &:checked { |
| 81 | + + .ff-checkbox-mark { |
| 82 | + border-color: $checkbox-checked-border-color; |
| 83 | + background-color: $checkbox-checked-background-color; |
| 84 | + |
| 85 | + &::after { |
| 86 | + top: 4px; |
| 87 | + left: 2.4px; |
| 88 | + height: 7px; |
| 89 | + width: 12px; |
| 90 | + |
| 91 | + transform: rotate(-45deg) skew(0,1deg); |
| 92 | + |
| 93 | + border-bottom: solid 2px; |
| 94 | + border-left: solid 2px; |
| 95 | + border-color: $checkbox-checked-color; |
| 96 | + |
| 97 | + } |
| 98 | + } |
| 99 | + } |
| 100 | + |
| 101 | + &:indeterminate { |
| 102 | + + .ff-checkbox-mark { |
| 103 | + border-color: $checkbox-indeterminate-border-color; |
| 104 | + background-color: $checkbox-indeterminate-background-color; |
| 105 | + |
| 106 | + &::after { |
| 107 | + top: 7.75px; |
| 108 | + left: 3px; |
| 109 | + width: 11px; |
| 110 | + |
| 111 | + border-bottom: solid 1.5px; |
| 112 | + border-color: $checkbox-indeterminate-color; |
| 113 | + } |
| 114 | + } |
| 115 | + } |
| 116 | + |
| 117 | + &:disabled { |
| 118 | + cursor: default; |
| 119 | + |
| 120 | + + .ff-checkbox-mark { |
| 121 | + border-color: $checkbox-disabled-border-color; |
| 122 | + background-color: $checkbox-disabled-background-color; |
| 123 | + |
| 124 | + &::after { |
| 125 | + border-color: $checkbox-disabled-color; |
| 126 | + } |
| 127 | + } |
| 128 | + } |
| 129 | + |
| 130 | + &:focus { |
| 131 | + + .ff-checkbox-mark { |
| 132 | + border-color: $checkbox-focus-border-color; |
| 133 | + } |
| 134 | + } |
| 135 | + } |
| 136 | +} |
0 commit comments