Skip to content

Commit 900c1f7

Browse files
devversionvivian-hu-zz
authored andcommitted
refactor(schematics): better margin for drag-drop schematic (#13447)
* Improves the margin of the drag-drop schematic containers. Since the component does not have any inner padding, the containers would show up at the edge of the page. This happens if someone just runs `ng add @angular/cdk` and `ng g @angular/cdk:drag-drop myComponent`. * Indents wrapped attributes in HTML template files. The goal of the schematics should be also to generate resources that can be used for learning. Right now it's not 100% clear where the child element starts (see: https://google.github.io/styleguide/htmlcssguide.html#HTML_Line-Wrapping)
1 parent 321c01d commit 900c1f7

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

src/cdk/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__styleext__

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.container {
22
width: 400px;
33
max-width: 100%;
4-
margin: 0 25px 25px 0;
4+
margin: 0 20px;
55
display: inline-block;
66
vertical-align: top;
77
}

src/lib/schematics/nav/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
<mat-sidenav-container class="sidenav-container">
2-
<mat-sidenav
3-
#drawer
4-
class="sidenav"
5-
fixedInViewport="true"
6-
[attr.role]="(isHandset$ | async) ? 'dialog' : 'navigation'"
7-
[mode]="(isHandset$ | async) ? 'over' : 'side'"
8-
[opened]="!(isHandset$ | async)">
2+
<mat-sidenav #drawer class="sidenav" fixedInViewport="true"
3+
[attr.role]="(isHandset$ | async) ? 'dialog' : 'navigation'"
4+
[mode]="(isHandset$ | async) ? 'over' : 'side'"
5+
[opened]="!(isHandset$ | async)">
96
<mat-toolbar>Menu</mat-toolbar>
107
<mat-nav-list>
118
<a mat-list-item href="#">Link 1</a>

src/lib/schematics/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
</table>
1818

1919
<mat-paginator #paginator
20-
[length]="dataSource.data.length"
21-
[pageIndex]="0"
22-
[pageSize]="50"
23-
[pageSizeOptions]="[25, 50, 100, 250]">
20+
[length]="dataSource.data.length"
21+
[pageIndex]="0"
22+
[pageSize]="50"
23+
[pageSizeOptions]="[25, 50, 100, 250]">
2424
</mat-paginator>
2525
</div>

0 commit comments

Comments
 (0)