Skip to content

Commit 22ce1da

Browse files
crisbetoandrewseguin
authored andcommitted
fix(grid-list): invalid inline styles when rendering server-side (#6052)
Fixes issue in the grid list that was causing it to set invalid styles when it is rendered on the server-side. It's because the browser converts the camelCased styles to dash-case automatically, but that doesn't happen on the server. Fixes #6048.
1 parent 0409707 commit 22ce1da

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,16 +190,16 @@ export class RatioTileStyler extends TileStyler {
190190
let percentHeightPerTile = percentWidth / this.rowHeightRatio;
191191
this.baseTileHeight = this.getBaseTileSize(percentHeightPerTile, gutterWidth);
192192

193-
// Use paddingTop and marginTop to maintain the given aspect ratio, as
193+
// Use padding-top and margin-top to maintain the given aspect ratio, as
194194
// a percentage-based value for these properties is applied versus the *width* of the
195195
// containing block. See http://www.w3.org/TR/CSS2/box.html#margin-properties
196-
tile._setStyle('marginTop', this.getTilePosition(this.baseTileHeight, rowIndex));
197-
tile._setStyle('paddingTop', calc(this.getTileSize(this.baseTileHeight, tile.rowspan)));
196+
tile._setStyle('margin-top', this.getTilePosition(this.baseTileHeight, rowIndex));
197+
tile._setStyle('padding-top', calc(this.getTileSize(this.baseTileHeight, tile.rowspan)));
198198
}
199199

200200
getComputedHeight(): [string, string] {
201201
return [
202-
'paddingBottom', calc(`${this.getTileSpan(this.baseTileHeight)} + ${this.getGutterSpan()}`)
202+
'padding-bottom', calc(`${this.getTileSpan(this.baseTileHeight)} + ${this.getGutterSpan()}`)
203203
];
204204
}
205205

0 commit comments

Comments
 (0)