Using New Input classes in Forms
This commit is contained in:
		| @@ -0,0 +1,70 @@ | |||||||
|  | .LP-Form{ | ||||||
|  |     max-width: 900px; | ||||||
|  |     .LP-Form__Fieldset{ | ||||||
|  |         border: none; | ||||||
|  |  | ||||||
|  |         .LP-Form__Legend{ | ||||||
|  |             margin: 0; | ||||||
|  |             padding: 0; | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         .LP-Form__Composition{ | ||||||
|  |             display: flex; | ||||||
|  |             flex-direction: row; | ||||||
|  |             justify-content: space-between; | ||||||
|  |  | ||||||
|  |             .LP-Form__Field{ | ||||||
|  |                 flex: 3 1 100px; | ||||||
|  |                 padding: 0 15px; | ||||||
|  |  | ||||||
|  |                 &--wider{ | ||||||
|  |                     flex: 5 1 200px; | ||||||
|  |                 } | ||||||
|  |  | ||||||
|  |                 &--wide{ | ||||||
|  |                     flex: 4 1 150px; | ||||||
|  |                 } | ||||||
|  |  | ||||||
|  |                 &--narrow{ | ||||||
|  |                     flex: 2 0 50px; | ||||||
|  |                 } | ||||||
|  |  | ||||||
|  |                 &--narrower{ | ||||||
|  |                     flex: 1 0 25px; | ||||||
|  |                 } | ||||||
|  |  | ||||||
|  |                 input{ | ||||||
|  |                     width: 100%; | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | @media(max-width: $-viewport-small){ | ||||||
|  |     .LP-Form{ | ||||||
|  |         .LP-Form__Fieldset{ | ||||||
|  |             .LP-Form__Composition--breakable{ | ||||||
|  |                 display: flex; | ||||||
|  |                 flex-direction: column; | ||||||
|  |                 justify-content: space-between; | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | @media(max-width: $-viewport-extra-small){ | ||||||
|  |     .LP-Form{ | ||||||
|  |         .LP-Form__Fieldset{ | ||||||
|  |             .LP-Form__Composition{ | ||||||
|  |                 display: flex; | ||||||
|  |                 flex-direction: column; | ||||||
|  |                 justify-content: space-between; | ||||||
|  |  | ||||||
|  |                 .LP-Form__Field{ | ||||||
|  |                     flex: 3 1 100px; | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
| @@ -0,0 +1,3 @@ | |||||||
|  | { | ||||||
|  |      | ||||||
|  | } | ||||||
| @@ -1,14 +1,42 @@ | |||||||
| <form class="LP-Form"> | <form class="LP-Form"> | ||||||
|     <fieldset class="LP-Form__Fieldset"> |     <fieldset class="LP-Form__Fieldset"> | ||||||
|         <legend class="LP-Form__Legend">Basic data</legend> |         <legend class="LP-Form__Legend">Basic data</legend> | ||||||
|         <div class="LP-Form__Row"> |  | ||||||
|             <span class="LP-Form__Field"> |         <div class="LP-Form__Composition LP-Form__Composition--breakable"> | ||||||
|                 <label for="textinput123" class="LP-Input__Label">Enter your text here</label> |             <span class="LP-Form__Field LP-Input LP-Input--error"> | ||||||
|                 <input id="textinput123" type="text" class="LP-Input__Text"/> |                 <label for="input123" class="LP-Input__Label">First name</label> | ||||||
|                 <span class="LP-Input__ErrorMessage"> |                 <input type="text" id="input123" class="LP-Input__Field"/> | ||||||
|                     <p>Text is required</p> |                 <span class="LP-Input__Message">Field is required</span> | ||||||
|             </span> |             </span> | ||||||
|  |             <span class="LP-Form__Field LP-Input"> | ||||||
|  |                 <label for="input123" class="LP-Input__Label">Last name</label> | ||||||
|  |                 <input type="text" id="input123" class="LP-Input__Field"/> | ||||||
|             </span> |             </span> | ||||||
|         </div> |         </div> | ||||||
|  |  | ||||||
|  |         <div class="LP-Form__Composition"> | ||||||
|  |             <span class="LP-Form__Field LP-Form__Field--wider LP-Input"> | ||||||
|  |                 <label for="input123" class="LP-Input__Label">Street</label> | ||||||
|  |                 <input type="text" id="input123" class="LP-Input__Field"/> | ||||||
|  |                 <span class="LP-Input__Message">We won't send any stalkers, promise</span> | ||||||
|  |             </span> | ||||||
|  |             <span class="LP-Form__Field LP-Form__Field--narrower LP-Input"> | ||||||
|  |                 <label for="input123" class="LP-Input__Label">House no</label> | ||||||
|  |                 <input type="text" id="input123" class="LP-Input__Field"/> | ||||||
|  |                 <span class="LP-Input__Message">Field is required</span> | ||||||
|  |             </span> | ||||||
|  |         </div> | ||||||
|  |  | ||||||
|  |         <div class="LP-Form__Composition"> | ||||||
|  |             <span class="LP-Form__Field LP-Form__Field--narrow LP-Input"> | ||||||
|  |                 <label for="input123" class="LP-Input__Label">Postal Code</label> | ||||||
|  |                 <input type="text" id="input123" class="LP-Input__Field"/> | ||||||
|  |             </span> | ||||||
|  |             <span class="LP-Form__Field LP-Form__Field--wide LP-Input"> | ||||||
|  |                 <label for="input123" class="LP-Input__Label">Town</label> | ||||||
|  |                 <input type="text" id="input123" class="LP-Input__Field"/> | ||||||
|  |             </span> | ||||||
|  |         </div> | ||||||
|  |  | ||||||
|     </fieldset> |     </fieldset> | ||||||
| </form> | </form> | ||||||
		Reference in New Issue
	
	Block a user