MCPcopy Create free account
hub / github.com/angular/components / setStyle

Function setStyle

src/material/grid-list/tile-styler.ts:98–108  ·  view source on GitHub ↗

* Sets the style properties to be applied to a tile for the given row and column index. * @param tile Tile to which to apply the styling. * @param rowIndex Index of the tile's row. * @param colIndex Index of the tile's column.

(tile: MatGridTile, rowIndex: number, colIndex: number)

Source from the content-addressed store, hash-verified

96 * @param colIndex Index of the tile's column.
97 */
98 setStyle(tile: MatGridTile, rowIndex: number, colIndex: number): void {
99 // Percent of the available horizontal space that one column takes up.
100 let percentWidthPerTile = 100 / this._cols;
101
102 // Fraction of the vertical gutter size that each column takes up.
103 // For example, if there are 5 columns, each column uses 4/5 = 0.8 times the gutter width.
104 let gutterWidthFractionPerTile = (this._cols - 1) / this._cols;
105
106 this.setColStyles(tile, colIndex, percentWidthPerTile, gutterWidthFractionPerTile);
107 this.setRowStyles(tile, rowIndex, percentWidthPerTile, gutterWidthFractionPerTile);
108 }
109
110 /** Sets the horizontal placement of the tile in the list. */
111 setColStyles(tile: MatGridTile, colIndex: number, percentWidth: number, gutterWidth: number) {

Callers

nothing calls this directly

Calls 1

setRowStylesMethod · 0.45

Tested by

no test coverage detected