Skip to content

Commit 4063dc4

Browse files
crisbetoannieyw
authored andcommitted
docs: fix form field example styles (#21124)
* Fixes an example that was referring to the `example-container` class, but wasn't actually using it. * Uses flexbox to layout the example, instead of `br` tags which are an anti-pattern. Fixes angular/material.angular.io#889. (cherry picked from commit 154ef43)
1 parent 4175091 commit 4063dc4

File tree

3 files changed

+21
-18
lines changed

3 files changed

+21
-18
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
:host {
2+
display: flex;
3+
flex-direction: column;
4+
align-items: flex-start;
5+
}
Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
<div class="example-container">
2-
<mat-form-field appearance="fill">
3-
<mat-label>Input</mat-label>
4-
<input matInput>
5-
</mat-form-field>
6-
<br>
7-
<mat-form-field appearance="fill">
8-
<mat-label>Select</mat-label>
9-
<mat-select>
10-
<mat-option value="option">Option</mat-option>
11-
</mat-select>
12-
</mat-form-field>
13-
<br>
14-
<mat-form-field appearance="fill">
15-
<mat-label>Textarea</mat-label>
16-
<textarea matInput></textarea>
17-
</mat-form-field>
18-
</div>
1+
<mat-form-field appearance="fill">
2+
<mat-label>Input</mat-label>
3+
<input matInput>
4+
</mat-form-field>
5+
<mat-form-field appearance="fill">
6+
<mat-label>Select</mat-label>
7+
<mat-select>
8+
<mat-option value="one">First option</mat-option>
9+
<mat-option value="two">Second option</mat-option>
10+
</mat-select>
11+
</mat-form-field>
12+
<mat-form-field appearance="fill">
13+
<mat-label>Textarea</mat-label>
14+
<textarea matInput></textarea>
15+
</mat-form-field>

src/components-examples/material/form-field/form-field-overview/form-field-overview-example.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ import {Component} from '@angular/core';
44
@Component({
55
selector: 'form-field-overview-example',
66
templateUrl: 'form-field-overview-example.html',
7+
styleUrls: ['form-field-overview-example.css']
78
})
89
export class FormFieldOverviewExample {}

0 commit comments

Comments
 (0)