Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit a4a5644

Browse files
feat(layout): support for md-layout-css directive
* implement directive to disable all conversions of Layout attributes to classnames * requires loading stylesheet `angular-material.layout.css` * generation of attribute-only layout-css using * fix css generation * layout-offset-33 -> margin-left:33% * layout-offset-34 -> margin-left:34% * layout-offset-66 -> margin-left:66% * layout-offset-67 -> margin-left:67% * support for Layout configuration * removal of useless $mdLayout service * update docs to use `.md-api-table` and bold the first-column text.
1 parent 53f2588 commit a4a5644

File tree

8 files changed

+503
-87
lines changed

8 files changed

+503
-87
lines changed

docs/app/css/style.css

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ body {
1414
}
1515

1616
.md-api-table {
17-
margin-bottom: 8px;
17+
margin-bottom: 16px;
1818
max-width: 100%;
1919
width: 100%;
2020
border-spacing: 0;
@@ -103,6 +103,7 @@ strong {
103103
background-color: #4C9EF0;
104104
color: white;
105105
}
106+
106107
blockquote {
107108
border-left: 3px solid rgba(0, 0, 0, 0.12);
108109
font-style: italic;
@@ -858,9 +859,9 @@ docs-demo .doc-demo-content {
858859
transition: none !important;
859860
}
860861

861-
table.attributes {
862+
table.attributes, table.md-api-table {
862863
padding-left:15px;
863-
margin-bottom: 10px;
864+
margin-bottom: 20px;
864865
}
865866
table.attributes tr td:first-child {
866867
font-weight: bold;
@@ -869,3 +870,7 @@ table.attributes tr td:first-child {
869870
table.attributes tr td:last-child {
870871
padding-left: 10px;
871872
}
873+
874+
table.md-api-table tr td:first-child {
875+
font-weight: bold;
876+
}

docs/app/partials/layout-alignment.tmpl.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<p>Only one word is required for the attribute. For example, <code>layout="row" layout-align="center"</code> would make the elements center horizontally and use the default behavior vertically.</p>
88

99
<p><code>layout="column" layout-align="center end"</code> would make
10-
children align along the center vertically and along the end (right) horizontally.</p>
10+
children align along the center vertically and along the end (right) horizontally. </p>
1111
<table class="md-api-table">
1212
<tr>
1313
<td>layout-align</td>

docs/app/partials/layout-grid.tmpl.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
There are additional flex values provided by Angular Material to improve flexibility and to make the API
100100
easier to understand.
101101
</p>
102-
<table class="attributes">
102+
<table class="md-api-table">
103103
<tr>
104104
<td >flex</td>
105105
<td >Will grow and shrink as needed. Starts with a size of 0%.</td>
@@ -151,7 +151,7 @@
151151
Add the <code>flex-order</code> attribute to a layout child to set its
152152
position within the layout. Any value from 0-9 is accepted.
153153
</p>
154-
<table class="attributes">
154+
<table class="md-api-table">
155155
<tr>
156156
<td>flex-order</td>
157157
<td>Sets element order.</td>
@@ -203,7 +203,7 @@
203203
offset percentage within the layout. Values must be multiples
204204
of <code>5</code>, or <code>33</code>, <code>34</code>, <code>66</code>, <code>67</code>.
205205
</p>
206-
<table class="attributes">
206+
<table class="md-api-table">
207207
<tr>
208208
<td>offset</td>
209209
<td>Sets element offset.</td>

gulp/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = {
3232
'src/core/services/layout/layout.scss'
3333
],
3434
scssStandaloneFiles: [
35-
'src/core/services/layout/layout.scss'
35+
'src/core/services/layout/layout.attributes.scss'
3636
],
3737
scssTestFiles: [
3838
'src/core/services/layout/layout.scss'

gulp/tasks/build-scss.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ exports.task = function() {
3939
gulp.src(paths)
4040
.pipe(util.filterNonCodeFiles())
4141
.pipe(filter(['**', '!**/*-theme.scss']))
42-
.pipe(filter(['**', '!**/standalone.scss']))
42+
.pipe(filter(['**', '!**/attributes.scss']))
4343
.pipe(concat('angular-material.scss'))
4444
.pipe(sass())
4545
.pipe(rename({ basename: filename }))
@@ -55,10 +55,13 @@ exports.task = function() {
5555
.pipe(insert.prepend(baseVars))
5656
.pipe(sass())
5757
.pipe(util.autoprefix())
58-
.pipe(insert.prepend(config.banner))
5958
.pipe(rename({ basename: "layouts" }))
60-
.pipe(rename({prefix: 'angular-material-'}))
61-
.pipe(gulp.dest(path.join(dest, 'modules', 'css')))
59+
.pipe(rename({ prefix: 'angular-material.'}))
60+
.pipe(insert.prepend(config.banner))
61+
.pipe(gulp.dest(dest))
62+
.pipe(gulpif(!IS_DEV, minifyCss()))
63+
.pipe(rename({extname: '.min.css'}))
64+
.pipe(gulp.dest(dest))
6265
);
6366

6467
return series(streams);

0 commit comments

Comments
 (0)