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

Function setColStyles

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

Sets the horizontal placement of the tile in the list.

(tile: MatGridTile, colIndex: number, percentWidth: number, gutterWidth: number)

Source from the content-addressed store, hash-verified

109
110 /** Sets the horizontal placement of the tile in the list. */
111 setColStyles(tile: MatGridTile, colIndex: number, percentWidth: number, gutterWidth: number) {
112 // Base horizontal size of a column.
113 let baseTileWidth = this.getBaseTileSize(percentWidth, gutterWidth);
114
115 // The width and horizontal position of each tile is always calculated the same way, but the
116 // height and vertical position depends on the rowMode.
117 let side = this._direction === 'rtl' ? 'right' : 'left';
118 tile._setStyle(side, this.getTilePosition(baseTileWidth, colIndex));
119 tile._setStyle('width', calc(this.getTileSize(baseTileWidth, tile.colspan)));
120 }
121
122 /**
123 * Calculates the total size taken up by gutters across one axis of a list.

Callers

nothing calls this directly

Calls 2

calcFunction · 0.85
_setStyleMethod · 0.80

Tested by

no test coverage detected