github.com/bosssauce/ponzu@v0.11.1-0.20200102001432-9bc41b703131/system/admin/static/editor/sass/components/_form.scss (about) 1 /* Remove Focus Boxes */ 2 select:focus { 3 outline: 1px solid lighten($secondary-color, 47%); 4 } 5 button:focus { 6 outline: none; 7 background-color: lighten($button-color, 4%); 8 } 9 10 label { 11 font-size: $label-font-size; 12 color: $input-border-color; 13 } 14 15 /*************************** 16 Text Inputs + Textarea 17 ****************************/ 18 19 // Style Placeholders 20 ::-webkit-input-placeholder { 21 color: lighten($input-border-color, 20%); 22 } 23 24 :-moz-placeholder { /* Firefox 18- */ 25 color: lighten($input-border-color, 20%); 26 } 27 28 ::-moz-placeholder { /* Firefox 19+ */ 29 color: lighten($input-border-color, 20%); 30 } 31 32 :-ms-input-placeholder { 33 color: lighten($input-border-color, 20%); 34 } 35 36 // Text inputs 37 input[type=text], 38 input[type=password], 39 input[type=email], 40 input[type=url], 41 input[type=time], 42 input[type=date], 43 input[type=datetime-local], 44 input[type=tel], 45 input[type=number], 46 input[type=search], 47 textarea.materialize-textarea { 48 49 // General Styles 50 background-color: transparent; 51 border: none; 52 border-bottom: 1px solid $input-border-color; 53 border-radius: 0; 54 outline: none; 55 height: 3rem; 56 width: 100%; 57 58 font-size: 1rem; 59 margin: 0 0 15px 0; 60 padding: 0; 61 box-shadow: none; 62 @include box-sizing(content-box); 63 transition: all .3s; 64 65 66 // Disabled input style 67 &:disabled, &[readonly="readonly"] { 68 color: $input-disabled-color; 69 border-bottom: 1px dotted $input-disabled-color; 70 } 71 // Disabled label style 72 &:disabled+label, &[readonly="readonly"]+label { 73 color: $input-disabled-color; 74 } 75 // Focused input style 76 &:focus:not([readonly]) { 77 border-bottom: 1px solid $input-focus-color; 78 box-shadow: 0 1px 0 0 $input-focus-color; 79 } 80 // Focused label style 81 &:focus:not([readonly])+label { 82 color: $input-focus-color; 83 } 84 // Valid Input Style 85 &.valid, 86 &:focus.valid { 87 border-bottom: 1px solid $input-success-color; 88 box-shadow: 0 1px 0 0 $input-success-color; 89 } 90 // Custom Success Message 91 &.valid + label:after, 92 &:focus.valid + label:after { 93 content: attr(data-success); 94 color: $input-success-color; 95 opacity: 1; 96 } 97 // Invalid Input Style 98 &.invalid, 99 &:focus.invalid { 100 border-bottom: 1px solid $input-error-color; 101 box-shadow: 0 1px 0 0 $input-error-color; 102 } 103 // Custom Error message 104 &.invalid + label:after, 105 &:focus.invalid + label:after { 106 content: attr(data-error); 107 color: $input-error-color; 108 opacity: 1; 109 } 110 111 // Form Message Shared Styles 112 & + label:after { 113 display: block; 114 content: ""; 115 position: absolute; 116 top: 65px; 117 opacity: 0; 118 transition: .2s opacity ease-out, .2s color ease-out; 119 } 120 } 121 122 // Styling for input field wrapper 123 .input-field { 124 position: relative; 125 margin-top: 1rem; 126 127 label { 128 color: $input-border-color; 129 position: absolute; 130 top: 0.8rem; 131 left: $gutter-width / 2; 132 font-size: 1rem; 133 cursor: text; 134 @include transition(.2s ease-out); 135 } 136 label.active { 137 font-size: $label-font-size; 138 @include transform(translateY(-140%)); 139 } 140 141 // Prefix Icons 142 .prefix { 143 position: absolute; 144 width: 3rem; 145 font-size: 2rem; 146 @include transition(color .2s); 147 148 &.active { color: $input-focus-color; } 149 } 150 .prefix ~ input, 151 .prefix ~ textarea { 152 margin-left: 3rem; 153 width: 92%; 154 width: calc(100% - 3rem); 155 } 156 .prefix ~ textarea { padding-top: .8rem; } 157 .prefix ~ label { margin-left: 3rem; } 158 159 @media #{$medium-and-down} { 160 .prefix ~ input { 161 width: 86%; 162 width: calc(100% - 3rem); 163 } 164 } 165 @media #{$small-and-down} { 166 .prefix ~ input { 167 width: 80%; 168 width: calc(100% - 3rem); 169 } 170 } 171 } 172 173 174 // Search Field 175 176 177 .input-field input[type=search] { 178 display: block; 179 line-height: inherit; 180 padding-left: 4rem; 181 width: calc(100% - 4rem); 182 183 &:focus { 184 background-color: $input-bg-color; 185 border: 0; 186 box-shadow: none; 187 color: #444; 188 189 & + label i, 190 & ~ .mdi-navigation-close { 191 color: #444; 192 } 193 } 194 195 & + label { 196 left: 1rem; 197 } 198 199 & ~ .mdi-navigation-close { 200 position: absolute; 201 top: 0; 202 right: 1rem; 203 color: transparent; 204 cursor: pointer; 205 font-size: 2rem; 206 transition: .3s color; 207 } 208 } 209 210 211 // Default textarea 212 textarea { 213 width: 100%; 214 height: 3rem; 215 background-color: transparent; 216 217 &.materialize-textarea { 218 overflow-y: hidden; /* prevents scroll bar flash */ 219 padding: 1.6rem 0; /* prevents text jump on Enter keypress */ 220 resize: none; 221 min-height: 3rem; 222 } 223 } 224 225 226 // For textarea autoresize 227 .hiddendiv { 228 display: none; 229 white-space: pre-wrap; 230 word-wrap: break-word; 231 overflow-wrap: break-word; /* future version of deprecated 'word-wrap' */ 232 padding-top: 1.2rem; /* prevents text jump on Enter keypress */ 233 } 234 235 236 /*************** 237 Radio Buttons 238 ***************/ 239 240 /* Remove default Radio Buttons */ 241 [type="radio"]:not(:checked), 242 [type="radio"]:checked { 243 position: absolute; 244 left: -9999px; 245 visibility: hidden; 246 } 247 248 [type="radio"]:not(:checked) + label, 249 [type="radio"]:checked + label { 250 position: relative; 251 padding-left: 35px; 252 cursor: pointer; 253 display: inline-block; 254 height: 25px; 255 line-height: 25px; 256 font-size: 1rem; 257 @include transition(.28s ease); 258 259 -webkit-user-select: none; /* webkit (safari, chrome) browsers */ 260 -moz-user-select: none; /* mozilla browsers */ 261 -khtml-user-select: none; /* webkit (konqueror) browsers */ 262 -ms-user-select: none; /* IE10+ */ 263 } 264 265 [type="radio"] + label:before, 266 [type="radio"] + label:after { 267 content: ''; 268 position: absolute; 269 left: 0; 270 top: 0; 271 margin: 4px; 272 width: 16px; 273 height: 16px; 274 z-index: 0; 275 @include transition(.28s ease); 276 } 277 278 279 /* Unchecked styles */ 280 [type="radio"]:not(:checked) + label:before { 281 border-radius: 50%; 282 border: 2px solid $radio-empty-color; 283 } 284 [type="radio"]:not(:checked) + label:after { 285 border-radius: 50%; 286 border: 2px solid $radio-empty-color; 287 z-index: -1; 288 289 @include transform(scale(0)); 290 } 291 292 /* Checked styles */ 293 [type="radio"]:checked + label:before { 294 border-radius: 50%; 295 border: 2px solid transparent; 296 } 297 [type="radio"]:checked + label:after { 298 border-radius: 50%; 299 border: 2px solid $radio-fill-color; 300 background-color: $radio-fill-color; 301 z-index: 0; 302 @include transform(scale(1.02)); 303 } 304 305 /* Radio With gap */ 306 [type="radio"].with-gap:checked + label:before { 307 border-radius: 50%; 308 border: 2px solid $radio-fill-color; 309 } 310 [type="radio"].with-gap:checked + label:after { 311 border-radius: 50%; 312 border: 2px solid $radio-fill-color; 313 background-color: $radio-fill-color; 314 z-index: 0; 315 @include transform(scale(.5)); 316 } 317 318 /* Disabled Radio With gap */ 319 [type="radio"].with-gap:disabled:checked + label:before { 320 border: 2px solid $input-disabled-color; 321 } 322 [type="radio"].with-gap:disabled:checked + label:after { 323 border: none; 324 background-color: $input-disabled-color; 325 } 326 327 /* Disabled style */ 328 [type="radio"]:disabled:not(:checked) + label:before, 329 [type="radio"]:disabled:checked + label:before { 330 background-color: transparent; 331 border-color: $input-disabled-color; 332 } 333 [type="radio"]:disabled + label { 334 color: $input-disabled-color; 335 } 336 [type="radio"]:disabled:not(:checked) + label:before { 337 border-color: $input-disabled-color; 338 } 339 [type="radio"]:disabled:checked + label:after { 340 background-color: $input-disabled-color; 341 border-color: $input-disabled-solid-color; 342 } 343 344 345 /*************** 346 Checkboxes 347 ***************/ 348 349 /* CUSTOM CSS CHECKBOXES */ 350 form p { 351 margin-bottom: 10px; 352 text-align: left; 353 } 354 form p:last-child { 355 margin-bottom: 0; 356 } 357 358 /* Remove default checkbox */ 359 [type="checkbox"]:not(:checked), 360 [type="checkbox"]:checked { 361 position: absolute; 362 left: -9999px; 363 visibility: hidden; 364 } 365 366 367 // Checkbox Styles 368 [type="checkbox"] { 369 370 // Text Label Style 371 + label { 372 position: relative; 373 padding-left: 35px; 374 cursor: pointer; 375 display: inline-block; 376 height: 25px; 377 line-height: 25px; 378 font-size: 1rem; 379 380 -webkit-user-select: none; /* webkit (safari, chrome) browsers */ 381 -moz-user-select: none; /* mozilla browsers */ 382 -khtml-user-select: none; /* webkit (konqueror) browsers */ 383 -ms-user-select: none; /* IE10+ */ 384 } 385 386 /* checkbox aspect */ 387 + label:before { 388 content: ''; 389 position: absolute; 390 top: 0; 391 left: 0; 392 width: 18px; 393 height: 18px; 394 z-index: 0; 395 border: 2px solid $radio-empty-color; 396 border-radius: 1px; 397 margin-top: 2px; 398 @include transition(.2s); 399 } 400 401 &:not(:checked):disabled + label:before { 402 border: none; 403 background-color: $input-disabled-color; 404 } 405 406 } 407 408 [type="checkbox"]:checked { 409 + label:before { 410 top: -4px; 411 left: -3px; 412 width: 12px; height: 22px; 413 border-top: 2px solid transparent; 414 border-left: 2px solid transparent; 415 border-right: 2px solid $radio-fill-color; 416 border-bottom: 2px solid $radio-fill-color; 417 @include transform(rotate(40deg)); 418 -webkit-backface-visibility: hidden; 419 @include transform-origin(100% 100%); 420 } 421 422 &:disabled + label:before { 423 border-right: 2px solid $input-disabled-color; 424 border-bottom: 2px solid $input-disabled-color; 425 } 426 427 } 428 429 /* Indeterminate checkbox */ 430 [type="checkbox"]:indeterminate { 431 +label:before { 432 left: -10px; 433 top: -11px; 434 width: 10px; height: 22px; 435 border-top: none; 436 border-left: none; 437 border-right: 2px solid $radio-fill-color; 438 border-bottom: none; 439 @include transform(rotate(90deg)); 440 -webkit-backface-visibility: hidden; 441 @include transform-origin(100% 100%); 442 } 443 444 // Disabled indeterminate 445 &:disabled + label:before { 446 border-right: 2px solid $input-disabled-color; 447 background-color: transparent; 448 } 449 } 450 451 452 // Filled in Style 453 [type="checkbox"].filled-in { 454 // General 455 + label:after { 456 border-radius: 2px; 457 } 458 + label:before, 459 + label:after { 460 content: ''; 461 left: 0; 462 position: absolute; 463 /* .1s delay is for check animation */ 464 transition: border .25s, background-color .25s, width .20s .1s, height .20s .1s, top .20s .1s, left .20s .1s; 465 z-index: 1; 466 } 467 // Unchecked style 468 &:not(:checked) + label:before { 469 width: 0; 470 height: 0; 471 border: 3px solid transparent; 472 left: 6px; 473 top: 10px; 474 475 -webkit-transform: rotateZ(37deg); 476 transform: rotateZ(37deg); 477 -webkit-transform-origin: 20% 40%; 478 transform-origin: 100% 100%; 479 } 480 &:not(:checked) + label:after { 481 height: 20px; 482 width: 20px; 483 background-color: transparent; 484 border: 2px solid $radio-empty-color; 485 top: 0px; 486 z-index: 0; 487 } 488 // Checked style 489 &:checked { 490 + label:before { 491 top: 0; 492 left: 1px; 493 width: 8px; 494 height: 13px; 495 border-top: 2px solid transparent; 496 border-left: 2px solid transparent; 497 border-right: 2px solid $input-bg-color; 498 border-bottom: 2px solid $input-bg-color; 499 -webkit-transform: rotateZ(37deg); 500 transform: rotateZ(37deg); 501 502 -webkit-transform-origin: 100% 100%; 503 transform-origin: 100% 100%; 504 } 505 + label:after { 506 top: 0px; 507 width: 20px; 508 height: 20px; 509 border: 2px solid $secondary-color; 510 background-color: $secondary-color; 511 z-index: 0; 512 } 513 } 514 // Disabled style 515 &:disabled:not(:checked) + label:before { 516 517 background-color: transparent; 518 border: 2px solid transparent; 519 } 520 &:disabled:not(:checked) + label:after { 521 border-color: transparent; 522 background-color: $input-disabled-solid-color; 523 } 524 &:disabled:checked + label:before { 525 background-color: transparent; 526 527 } 528 &:disabled:checked + label:after { 529 background-color: $input-disabled-solid-color; 530 border-color: $input-disabled-solid-color; 531 } 532 533 } 534 535 /*************** 536 Switch 537 ***************/ 538 .switch, 539 .switch * { 540 -webkit-user-select: none; 541 -moz-user-select: none; 542 -khtml-user-select: none; 543 -ms-user-select: none; 544 } 545 .switch label { 546 cursor: pointer; 547 } 548 .switch label input[type=checkbox]{ 549 opacity: 0; 550 width: 0; 551 height: 0; 552 } 553 .switch label input[type=checkbox]:checked + .lever { 554 background-color: $switch-checked-lever-bg; 555 } 556 .switch label input[type=checkbox]:checked + .lever:after { 557 background-color: $switch-bg-color; 558 } 559 .switch label .lever { 560 content: ""; 561 display: inline-block; 562 position: relative; 563 width: 40px; 564 height: 15px; 565 background-color: $switch-unchecked-lever-bg; 566 border-radius: 15px; 567 margin-right: 10px; 568 transition: background 0.3s ease; 569 vertical-align: middle; 570 margin: 0 16px; 571 } 572 .switch label .lever:after { 573 content: ""; 574 position: absolute; 575 display: inline-block; 576 width: 21px; 577 height: 21px; 578 background-color: $switch-unchecked-bg; 579 border-radius: 21px; 580 box-shadow: 0 1px 3px 1px rgba(0,0,0,.4); 581 left: -5px; 582 top: -3px; 583 transition: left 0.3s ease, background .3s ease, box-shadow 0.1s ease; 584 } 585 // Switch active style 586 input[type=checkbox]:checked:not(:disabled) ~ .lever:active:after { 587 box-shadow: 0 1px 3px 1px rgba(0,0,0,.4), 0 0 0 15px transparentize($switch-bg-color, .9); 588 } 589 input[type=checkbox]:not(:disabled) ~ .lever:active:after { 590 box-shadow: 0 1px 3px 1px rgba(0,0,0,.4), 0 0 0 15px rgba(0, 0, 0, .08); 591 } 592 .switch label input[type=checkbox]:checked + .lever:after { 593 left: 24px; 594 } 595 596 // Disabled Styles 597 598 .switch input[type=checkbox][disabled] + .lever{ 599 cursor: default; 600 } 601 .switch label input[type=checkbox][disabled] + .lever:after, 602 .switch label input[type=checkbox][disabled]:checked + .lever:after { 603 background-color: $input-disabled-solid-color; 604 } 605 606 607 608 609 /*************** 610 Select Field 611 ***************/ 612 613 .select-label { 614 position: absolute; 615 } 616 617 .select-wrapper { 618 position: relative; 619 620 input.select-dropdown { 621 position: relative; 622 cursor: pointer; 623 // color: #444; 624 background-color: transparent; 625 border: none; 626 border-bottom: 1px solid $input-border-color; 627 outline: none; 628 height: 3rem; 629 line-height: 3rem; 630 width: 100%; 631 font-size: 1rem; 632 margin: 0 0 15px 0; 633 padding: 0; 634 display: block; 635 } 636 span.caret { 637 color: initial; 638 position: absolute; 639 right: 0; 640 top: 16px; 641 font-size: 10px; 642 &.disabled { 643 color: $input-disabled-color; 644 } 645 } 646 & + label { 647 position: absolute; 648 top: -14px; 649 font-size: $label-font-size; 650 } 651 } 652 653 select { display: none; } 654 select.browser-default { display: block; } 655 656 657 // Disabled styles 658 select:disabled { 659 color: rgba(0,0,0,.3); 660 } 661 .select-wrapper input.select-dropdown:disabled { 662 color: rgba(0,0,0,.3); 663 cursor: default; 664 -webkit-user-select: none; /* webkit (safari, chrome) browsers */ 665 -moz-user-select: none; /* mozilla browsers */ 666 -ms-user-select: none; /* IE10+ */ 667 border-bottom: 1px solid rgba(0,0,0,.3); 668 } 669 .select-wrapper i { 670 color: rgba(0,0,0,.3); 671 } 672 .select-dropdown li.disabled { 673 color: rgba(0,0,0,.3); 674 background-color: transparent; 675 } 676 677 678 /********************* 679 File Input 680 **********************/ 681 .file-field { 682 position: relative; 683 684 .file-path-wrapper { 685 overflow: hidden; 686 padding-left: 10px; 687 } 688 input.file-path { width: 100%; } 689 690 .btn { 691 float: left; 692 height: 3rem; 693 line-height: 3rem; 694 } 695 696 span { 697 cursor: pointer; 698 } 699 700 input[type=file] { 701 position: absolute; 702 top: 0; 703 right: 0; 704 left: 0; 705 bottom: 0; 706 width: 100%; 707 margin: 0; 708 padding: 0; 709 font-size: 20px; 710 cursor: pointer; 711 opacity: 0; 712 filter: alpha(opacity=0); 713 } 714 } 715 716 717 718 /*************** 719 Range 720 ***************/ 721 722 .range-field { 723 position: relative; 724 } 725 726 input[type=range], input[type=range] + .thumb { 727 @extend .no-select; 728 cursor: pointer; 729 } 730 731 input[type=range] { 732 position: relative; 733 background-color: transparent; 734 border: none; 735 outline: none; 736 width: 100%; 737 margin: 15px 0px; 738 padding: 0; 739 } 740 input[type=range] + .thumb { 741 position: absolute; 742 border: none; 743 height: 0; 744 width: 0; 745 border-radius: 50%; 746 background-color: $radio-fill-color; 747 top: 10px; 748 margin-left: -6px; 749 750 @include transform-origin(50% 50%); 751 @include transform(rotate(-45deg)); 752 753 .value { 754 display: block; 755 width: 30px; 756 text-align: center; 757 color: $radio-fill-color; 758 font-size: 0; 759 @include transform(rotate(45deg)); 760 } 761 762 &.active { 763 border-radius: 50% 50% 50% 0; 764 765 .value { 766 color: $input-bg-color; 767 margin-left: -1px; 768 margin-top: 8px; 769 font-size: 10px; 770 } 771 } 772 } 773 774 775 input[type=range]:focus { 776 outline: none; 777 } 778 779 780 781 // WebKit 782 input[type=range]{ 783 -webkit-appearance: none; 784 } 785 786 input[type=range]::-webkit-slider-runnable-track { 787 height: 3px; 788 background: #c2c0c2; 789 border: none; 790 } 791 792 input[type=range]::-webkit-slider-thumb { 793 -webkit-appearance: none; 794 border: none; 795 height: 14px; 796 width: 14px; 797 border-radius: 50%; 798 background-color: $radio-fill-color; 799 transform-origin: 50% 50%; 800 margin: -5px 0 0 0; 801 @include transition(.3s); 802 } 803 804 input[type=range]:focus::-webkit-slider-runnable-track { 805 background: #ccc; 806 } 807 808 // FireFox 809 input[type=range]{ 810 /* fix for FF unable to apply focus style bug */ 811 border: 1px solid white; 812 813 /*required for proper track sizing in FF*/ 814 } 815 816 input[type=range]::-moz-range-track { 817 height: 3px; 818 background: #ddd; 819 border: none; 820 } 821 822 input[type=range]::-moz-range-thumb { 823 border: none; 824 height: 14px; 825 width: 14px; 826 border-radius: 50%; 827 background: $radio-fill-color; 828 margin-top: -5px; 829 } 830 831 /*hide the outline behind the border*/ 832 input[type=range]:-moz-focusring{ 833 outline: 1px solid white; 834 outline-offset: -1px; 835 } 836 837 input[type=range]:focus::-moz-range-track { 838 background: #ccc; 839 } 840 841 // IE 10+ 842 input[type=range]::-ms-track { 843 height: 3px; 844 845 /*remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead */ 846 background: transparent; 847 848 /*leave room for the larger thumb to overflow with a transparent border */ 849 border-color: transparent; 850 border-width: 6px 0; 851 852 /*remove default tick marks*/ 853 color: transparent; 854 } 855 input[type=range]::-ms-fill-lower { 856 background: #777; 857 } 858 input[type=range]::-ms-fill-upper { 859 background: #ddd; 860 } 861 input[type=range]::-ms-thumb { 862 border: none; 863 height: 14px; 864 width: 14px; 865 border-radius: 50%; 866 background: $radio-fill-color; 867 } 868 input[type=range]:focus::-ms-fill-lower { 869 background: #888; 870 } 871 input[type=range]:focus::-ms-fill-upper { 872 background: #ccc; 873 } 874 875 /*************************** 876 Text Inputs + Textarea 877 ****************************/ 878 879 select { 880 background-color: rgba(255, 255, 255, 0.90); 881 width: 100%; 882 padding: 5px; 883 border: 1px solid #f2f2f2; 884 border-radius: 2px; 885 height: 3rem; 886 }