Skip to content

Commit

Permalink
fix(grid-list): invalid style declaration during server-side rendering (
Browse files Browse the repository at this point in the history
#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.
  • Loading branch information
crisbeto authored and jelbourn committed Feb 26, 2018
1 parent 64ef3a8 commit a27d9df
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lib/grid-list/tile-styler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,22 +210,22 @@ export class RatioTileStyler extends TileStyler {
// Use padding-top and margin-top to maintain the given aspect ratio, as
// a percentage-based value for these properties is applied versus the *width* of the
// containing block. See http://www.w3.org/TR/CSS2/box.html#margin-properties
tile._setStyle('margin-top', this.getTilePosition(this.baseTileHeight, rowIndex));
tile._setStyle('padding-top', calc(this.getTileSize(this.baseTileHeight, tile.rowspan)));
tile._setStyle('marginTop', this.getTilePosition(this.baseTileHeight, rowIndex));
tile._setStyle('paddingTop', calc(this.getTileSize(this.baseTileHeight, tile.rowspan)));
}

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

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

list._tiles.forEach(tile => {
tile._setStyle('margin-top', null);
tile._setStyle('padding-top', null);
tile._setStyle('marginTop', null);
tile._setStyle('paddingTop', null);
});
}

Expand Down

0 comments on commit a27d9df

Please sign in to comment.