Forms

Create a new sass file

  1. $ touch _forms.scss

Create a new forms directory

  1. $ mkdir forms
  2. $ midir forms/extends

Add the following files:

  1. $ touch forms/_manifest.scss
  2. $ touch forms/extends/_default-inputs.scss
  3. $ touch forms/extends/_display-block.scss
  4. $ touch forms/extends/_manifest.scss

Add the following to forms/extends/_manifest.scss:

  1. @import "default-inputs";
  2. @import "display-block";

Add the following to forms/extends/_default-inputs.scss:

  1. %default-inputs {
  2. width: 100%;
  3. height: 100%;
  4. padding: 2.25em 1em 1em;
  5. outline: none;
  6. font-size: 1em;
  7. }

Add the following to forms/extends/_display-block.scss:

  1. %display-block {
  2. width: 100%;
  3. display: block;
  4. }

Add the following to forms/_manifest.scss:

  1. @import "extends/manifest";

Add the following to _forms.scss:

  1. @import "forms/manifest";
  2. .form {
  3. ul {
  4. border-bottom: 1px solid $hotel-gray;
  5. background-color: $white;
  6. margin-bottom: 1em;
  7. }
  8. li {
  9. border: 1px solid $hotel-gray;
  10. border-bottom: 0;
  11. position: relative;
  12. }
  13. }
  14. label {
  15. @extend %display-block;
  16. position: absolute;
  17. font-size: em(16);
  18. top: .5em;
  19. left: 1em;
  20. color: orange;
  21. opacity: 1;
  22. transition: #{$trans} top, #{$trans} opacity;
  23. .js-hide-label & {
  24. opacity: 0;
  25. top: 1.5em;
  26. }
  27. }
  28. input[type="text"] {
  29. @extend %display-block;
  30. @extend %default-inputs;
  31. }
  32. input[type="email"] {
  33. @extend %display-block;
  34. @extend %default-inputs;
  35. }
  36. textarea {
  37. @extend %display-block;
  38. @extend %default-inputs;
  39. height: 8em;
  40. resize: none;
  41. }