Skip to content

Commit a27d9df

Browse files
crisbetojelbourn
authored andcommitted
fix(grid-list): invalid style declaration during server-side rendering (#10131)
A while ago in #6052, we switched the grid list inline styles to be assigned through the dash-cased properties in order for them to be valid when using the old renderer with parse5. These changes go back to the camel-cased properties, because the dash-cased ones don't work with Domino. Relates to #6048.
1 parent 64ef3a8 commit a27d9df

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/lib/grid-list/tile-styler.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,22 +210,22 @@ export class RatioTileStyler extends TileStyler {
210210
// Use padding-top and margin-top to maintain the given aspect ratio, as
211211
// a percentage-based value for these properties is applied versus the *width* of the
212212
// containing block. See http://www.w3.org/TR/CSS2/box.html#margin-properties
213-
tile._setStyle('margin-top', this.getTilePosition(this.baseTileHeight, rowIndex));
214-
tile._setStyle('padding-top', calc(this.getTileSize(this.baseTileHeight, tile.rowspan)));
213+
tile._setStyle('marginTop', this.getTilePosition(this.baseTileHeight, rowIndex));
214+
tile._setStyle('paddingTop', calc(this.getTileSize(this.baseTileHeight, tile.rowspan)));
215215
}
216216

217217
getComputedHeight(): [string, string] {
218218
return [
219-
'padding-bottom', calc(`${this.getTileSpan(this.baseTileHeight)} + ${this.getGutterSpan()}`)
219+
'paddingBottom', calc(`${this.getTileSpan(this.baseTileHeight)} + ${this.getGutterSpan()}`)
220220
];
221221
}
222222

223223
reset(list: MatGridList) {
224-
list._setListStyle(['padding-bottom', null]);
224+
list._setListStyle(['paddingBottom', null]);
225225

226226
list._tiles.forEach(tile => {
227-
tile._setStyle('margin-top', null);
228-
tile._setStyle('padding-top', null);
227+
tile._setStyle('marginTop', null);
228+
tile._setStyle('paddingTop', null);
229229
});
230230
}
231231

0 commit comments

Comments
 (0)