github.com/mithrandie/csvq@v1.18.1/docs/_sass/components/forms/_checkboxes.scss (about) 1 /* Checkboxes 2 ========================================================================== */ 3 4 /* CUSTOM CSS CHECKBOXES */ 5 form p { 6 margin-bottom: 10px; 7 text-align: left; 8 } 9 10 form p:last-child { 11 margin-bottom: 0; 12 } 13 14 /* Remove default checkbox */ 15 [type="checkbox"]:not(:checked), 16 [type="checkbox"]:checked { 17 position: absolute; 18 left: -9999px; 19 opacity: 0; 20 } 21 22 // Checkbox Styles 23 [type="checkbox"] { 24 // Text Label Style 25 + label { 26 position: relative; 27 padding-left: 35px; 28 cursor: pointer; 29 display: inline-block; 30 height: 25px; 31 line-height: 25px; 32 font-size: 1rem; 33 34 -webkit-user-select: none; /* webkit (safari, chrome) browsers */ 35 -moz-user-select: none; /* mozilla browsers */ 36 -khtml-user-select: none; /* webkit (konqueror) browsers */ 37 -ms-user-select: none; /* IE10+ */ 38 } 39 40 /* checkbox aspect */ 41 + label:before, 42 &:not(.filled-in) + label:after { 43 content: ''; 44 position: absolute; 45 top: 0; 46 left: 0; 47 width: 18px; 48 height: 18px; 49 z-index: 0; 50 border: 2px solid $radio-empty-color; 51 border-radius: 1px; 52 margin-top: 2px; 53 transition: .2s; 54 } 55 56 &:not(.filled-in) + label:after { 57 border: 0; 58 transform: scale(0); 59 } 60 61 &:not(:checked):disabled + label:before { 62 border: none; 63 background-color: $input-disabled-color; 64 } 65 66 // Focused styles 67 &.tabbed:focus + label:after { 68 transform: scale(1); 69 border: 0; 70 border-radius: 50%; 71 box-shadow: 0 0 0 10px rgba(0,0,0,.1); 72 background-color: rgba(0,0,0,.1); 73 } 74 } 75 76 [type="checkbox"]:checked { 77 + label:before { 78 top: -4px; 79 left: -5px; 80 width: 12px; 81 height: 22px; 82 border-top: 2px solid transparent; 83 border-left: 2px solid transparent; 84 border-right: $radio-border; 85 border-bottom: $radio-border; 86 transform: rotate(40deg); 87 backface-visibility: hidden; 88 transform-origin: 100% 100%; 89 } 90 91 &:disabled + label:before { 92 border-right: 2px solid $input-disabled-color; 93 border-bottom: 2px solid $input-disabled-color; 94 } 95 } 96 97 /* Indeterminate checkbox */ 98 [type="checkbox"]:indeterminate { 99 +label:before { 100 top: -11px; 101 left: -12px; 102 width: 10px; 103 height: 22px; 104 border-top: none; 105 border-left: none; 106 border-right: $radio-border; 107 border-bottom: none; 108 transform: rotate(90deg); 109 backface-visibility: hidden; 110 transform-origin: 100% 100%; 111 } 112 113 // Disabled indeterminate 114 &:disabled + label:before { 115 border-right: 2px solid $input-disabled-color; 116 background-color: transparent; 117 } 118 } 119 120 // Filled in Style 121 [type="checkbox"].filled-in { 122 // General 123 + label:after { 124 border-radius: 2px; 125 } 126 127 + label:before, 128 + label:after { 129 content: ''; 130 left: 0; 131 position: absolute; 132 /* .1s delay is for check animation */ 133 transition: border .25s, background-color .25s, width .20s .1s, height .20s .1s, top .20s .1s, left .20s .1s; 134 z-index: 1; 135 } 136 137 // Unchecked style 138 &:not(:checked) + label:before { 139 width: 0; 140 height: 0; 141 border: 3px solid transparent; 142 left: 6px; 143 top: 10px; 144 145 -webkit-transform: rotateZ(37deg); 146 transform: rotateZ(37deg); 147 -webkit-transform-origin: 20% 40%; 148 transform-origin: 100% 100%; 149 } 150 151 &:not(:checked) + label:after { 152 height: 20px; 153 width: 20px; 154 background-color: transparent; 155 border: 2px solid $radio-empty-color; 156 top: 0px; 157 z-index: 0; 158 } 159 160 // Checked style 161 &:checked { 162 + label:before { 163 top: 0; 164 left: 1px; 165 width: 8px; 166 height: 13px; 167 border-top: 2px solid transparent; 168 border-left: 2px solid transparent; 169 border-right: 2px solid $input-background; 170 border-bottom: 2px solid $input-background; 171 -webkit-transform: rotateZ(37deg); 172 transform: rotateZ(37deg); 173 174 -webkit-transform-origin: 100% 100%; 175 transform-origin: 100% 100%; 176 } 177 178 + label:after { 179 top: 0; 180 width: 20px; 181 height: 20px; 182 border: 2px solid $secondary-color; 183 background-color: $secondary-color; 184 z-index: 0; 185 } 186 } 187 188 // Focused styles 189 &.tabbed:focus + label:after { 190 border-radius: 2px; 191 border-color: $radio-empty-color; 192 background-color: rgba(0,0,0,.1); 193 } 194 195 &.tabbed:checked:focus + label:after { 196 border-radius: 2px; 197 background-color: $secondary-color; 198 border-color: $secondary-color; 199 } 200 201 // Disabled style 202 &:disabled:not(:checked) + label:before { 203 background-color: transparent; 204 border: 2px solid transparent; 205 } 206 207 &:disabled:not(:checked) + label:after { 208 border-color: transparent; 209 background-color: $input-disabled-solid-color; 210 } 211 212 &:disabled:checked + label:before { 213 background-color: transparent; 214 } 215 216 &:disabled:checked + label:after { 217 background-color: $input-disabled-solid-color; 218 border-color: $input-disabled-solid-color; 219 } 220 }