github.com/mithrandie/csvq@v1.18.1/docs/_sass/components/forms/_input-fields.scss (about) 1 /* Text Inputs + Textarea 2 ========================================================================== */ 3 4 /* Style Placeholders */ 5 6 ::-webkit-input-placeholder { 7 color: $placeholder-text-color; 8 } 9 10 :-moz-placeholder { /* Firefox 18- */ 11 color: $placeholder-text-color; 12 } 13 14 ::-moz-placeholder { /* Firefox 19+ */ 15 color: $placeholder-text-color; 16 } 17 18 :-ms-input-placeholder { 19 color: $placeholder-text-color; 20 } 21 22 /* Text inputs */ 23 24 input:not([type]), 25 input[type=text], 26 input[type=password], 27 input[type=email], 28 input[type=url], 29 input[type=time], 30 input[type=date], 31 input[type=datetime], 32 input[type=datetime-local], 33 input[type=tel], 34 input[type=number], 35 input[type=search], 36 textarea.materialize-textarea { 37 38 // General Styles 39 background-color: transparent; 40 border: none; 41 border-bottom: $input-border; 42 border-radius: 0; 43 outline: none; 44 height: $input-height; 45 width: 100%; 46 font-size: $input-font-size; 47 margin: $input-margin; 48 padding: $input-padding; 49 box-shadow: none; 50 box-sizing: content-box; 51 transition: $input-transition; 52 53 // Disabled input style 54 &:disabled, 55 &[readonly="readonly"] { 56 color: $input-disabled-color; 57 border-bottom: $input-disabled-border; 58 } 59 60 // Disabled label style 61 &:disabled+label, 62 &[readonly="readonly"]+label { 63 color: $input-disabled-color; 64 } 65 66 // Focused input style 67 &:focus:not([readonly]) { 68 border-bottom: 1px solid $input-focus-color; 69 box-shadow: 0 1px 0 0 $input-focus-color; 70 } 71 72 // Focused label style 73 &:focus:not([readonly])+label { 74 color: $input-focus-color; 75 } 76 77 // Valid Input Style 78 &.valid, 79 &:focus.valid { 80 border-bottom: 1px solid $input-success-color; 81 box-shadow: 0 1px 0 0 $input-success-color; 82 } 83 84 // Custom Success Message 85 &.valid + label:after, 86 &:focus.valid + label:after { 87 content: attr(data-success); 88 color: $input-success-color; 89 opacity: 1; 90 } 91 92 // Invalid Input Style 93 &.invalid, 94 &:focus.invalid { 95 border-bottom: $input-invalid-border; 96 box-shadow: 0 1px 0 0 $input-error-color; 97 } 98 99 // Custom Error message 100 &.invalid + label:after, 101 &:focus.invalid + label:after { 102 content: attr(data-error); 103 color: $input-error-color; 104 opacity: 1; 105 } 106 107 // Full width label when using validate for error messages 108 &.validate + label { 109 width: 100%; 110 pointer-events: none; 111 } 112 113 // Form Message Shared Styles 114 & + label:after { 115 display: block; 116 content: ""; 117 position: absolute; 118 top: 60px; 119 opacity: 0; 120 transition: .2s opacity ease-out, .2s color ease-out; 121 } 122 } 123 124 // Styling for input field wrapper 125 .input-field { 126 // Inline styles 127 &.inline { 128 display: inline-block; 129 vertical-align: middle; 130 margin-left: 5px; 131 132 input, 133 .select-dropdown { 134 margin-bottom: 1rem; 135 } 136 } 137 138 // Gutter spacing 139 &.col { 140 label { 141 left: $gutter-width / 2; 142 } 143 144 .prefix ~ label, 145 .prefix ~ .validate ~ label { 146 width: calc(100% - 3rem - #{$gutter-width}); 147 } 148 } 149 150 position: relative; 151 margin-top: 1rem; 152 153 label { 154 color: $input-border-color; 155 position: absolute; 156 top: 0.8rem; 157 left: 0; 158 font-size: 1rem; 159 cursor: text; 160 transition: .2s ease-out; 161 text-align: initial; 162 163 &:not(.label-icon).active { 164 font-size: $label-font-size; 165 transform: translateY(-140%); 166 } 167 } 168 169 // Prefix Icons 170 .prefix { 171 position: absolute; 172 width: $input-height; 173 font-size: 2rem; 174 transition: color .2s; 175 176 &.active { color: $input-focus-color; } 177 } 178 179 .prefix ~ input, 180 .prefix ~ textarea, 181 .prefix ~ label, 182 .prefix ~ .validate ~ label, 183 .prefix ~ .autocomplete-content { 184 margin-left: 3rem; 185 width: 92%; 186 width: calc(100% - 3rem); 187 } 188 189 .prefix ~ label { margin-left: 3rem; } 190 191 @media #{$medium-and-down} { 192 .prefix ~ input { 193 width: 86%; 194 width: calc(100% - 3rem); 195 } 196 } 197 198 @media #{$small-and-down} { 199 .prefix ~ input { 200 width: 80%; 201 width: calc(100% - 3rem); 202 } 203 } 204 } 205 206 207 /* Search Field */ 208 209 .input-field input[type=search] { 210 display: block; 211 line-height: inherit; 212 padding-left: 4rem; 213 width: calc(100% - 4rem); 214 215 &:focus { 216 background-color: $input-background; 217 border: 0; 218 box-shadow: none; 219 color: #444; 220 221 & + label i, 222 & ~ .mdi-navigation-close, 223 & ~ .material-icons { 224 color: #444; 225 } 226 } 227 228 & + label { 229 left: 1rem; 230 } 231 232 & ~ .mdi-navigation-close, 233 & ~ .material-icons { 234 position: absolute; 235 top: 0; 236 right: 1rem; 237 color: transparent; 238 cursor: pointer; 239 font-size: 2rem; 240 transition: .3s color; 241 } 242 } 243 244 245 /* Textarea */ 246 247 // Default textarea 248 textarea { 249 width: 100%; 250 height: $input-height; 251 background-color: transparent; 252 253 &.materialize-textarea { 254 overflow-y: hidden; /* prevents scroll bar flash */ 255 padding: .8rem 0 1.6rem 0; /* prevents text jump on Enter keypress */ 256 resize: none; 257 min-height: $input-height; 258 } 259 } 260 261 // For textarea autoresize 262 .hiddendiv { 263 display: none; 264 white-space: pre-wrap; 265 word-wrap: break-word; 266 overflow-wrap: break-word; /* future version of deprecated 'word-wrap' */ 267 padding-top: 1.2rem; /* prevents text jump on Enter keypress */ 268 269 // Reduces repaints 270 position: absolute; 271 top: 0; 272 } 273 274 275 /* Autocomplete */ 276 .autocomplete-content { 277 margin-top: -1 * $input-margin-bottom; 278 display: block; 279 opacity: 1; 280 position: static; 281 282 li { 283 .highlight { color: #444; } 284 285 img { 286 height: $dropdown-item-height - 10; 287 width: $dropdown-item-height - 10; 288 margin: 5px 15px; 289 } 290 } 291 }