Skip to content

Commit 673ac8f

Browse files
committed
Update usage examples
1 parent 89c8787 commit 673ac8f

File tree

1 file changed

+9
-28
lines changed

1 file changed

+9
-28
lines changed

README.md

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ root element:
8888
### Controlling layout
8989

9090
`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).
9392

9493
#### Vertical spacing
9594

@@ -110,37 +109,19 @@ Can be handled by a component that controls the `<form/>` itself:
110109
</form>
111110
```
112111

113-
#### Horizontal positioning within `FormField`
112+
#### Horizontal positioning with `Grid` and `utils-size`
114113

115-
Utilities can be used to control the layout of inputs and labels:
114+
The following achieves an inline form effect
116115

117116
```html
118-
// Produces an inline form layout
119117
<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>
125121
</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>
144125
</div>
145126
</div>
146127
</div>

0 commit comments

Comments
 (0)