@@ -88,8 +88,7 @@ root element:
88
88
### Controlling layout
89
89
90
90
` FormField ` leaves the layout concerns to another component or utility, for
91
- example [ suitcss-components-grid] ( https://github.com/suitcss/components-grid ) or
92
- [ suitcss-utils-flex] ( https://github.com/suitcss/utils-flex ) .
91
+ example [ suitcss-components-grid] ( https://github.com/suitcss/components-grid ) .
93
92
94
93
#### Vertical spacing
95
94
@@ -110,37 +109,19 @@ Can be handled by a component that controls the `<form/>` itself:
110
109
</form >
111
110
```
112
111
113
- #### Horizontal positioning within ` FormField `
112
+ #### Horizontal positioning with ` Grid ` and ` utils-size `
114
113
115
- Utilities can be used to control the layout of inputs and labels:
114
+ The following achieves an inline form effect
116
115
117
116
``` html
118
- // Produces an inline form layout
119
117
<div class =" FormField" >
120
- <div class =" u-flex u-flexAlignItemsCenter" >
121
- <label class =" FormField-label u-mr40" >Surname</label >
122
- <div class =" u-flexGrow1" >
123
- <input class =" FormField-input" type =" text" placeholder =" Enter your surname" >
124
- <p class =" FormField-text" >Some text to the user about the input field</p >
118
+ <div class =" Grid Grid--alignMiddle" >
119
+ <div class =" Grid-cell u-size2of12" >
120
+ <label class =" FormField-label u-textBold" >Username</label >
125
121
</div >
126
- </div >
127
- </div >
128
- ```
129
-
130
- #### Horizontal positioning of ` FormField ` components
131
-
132
- A ` Grid ` component can be used for a column based layout:
133
-
134
- ``` html
135
- <div class =" Grid Grid--withGutter" >
136
- <div class =" Grid-cell u-size1of2" >
137
- <div class =" FormField" >
138
- // ...
139
- </div >
140
- </div >
141
- <div class =" Grid-cell u-size1of2" >
142
- <div class =" FormField" >
143
- // ...
122
+ <div class =" Grid-cell u-sizeFill" >
123
+ <input class =" FormField-input" type =" text" value =" SomeCoolUsername" >
124
+ <p class =" FormField-text" >That username is already taken!</p >
144
125
</div >
145
126
</div >
146
127
</div >
0 commit comments