Struct Grid.TrackSize
Represents a single CSS grid track sizing value such as a length, fr unit,
auto, min-content, max-content, minmax(), or fit-content().
public readonly struct Grid.TrackSize
- Inherited Members
Fields
Auto
The track sizes to content automatically. Equivalent to CSS auto.
public static readonly Grid.TrackSize Auto
Field Value
MaxContent
The track is sized to the largest max-content contribution of its items. Equivalent to CSS max-content.
public static readonly Grid.TrackSize MaxContent
Field Value
MinContent
The track is sized to the smallest size that fits its content without overflow. Equivalent to CSS min-content.
public static readonly Grid.TrackSize MinContent
Field Value
Properties
Kind
The kind of track sizing function.
public Grid.TrackSizeKind Kind { get; }
Property Value
MaxValue
Maximum value for MinMax and FitContent tracks.
public NFloat MaxValue { get; }
Property Value
MinValue
Minimum value for MinMax tracks.
public NFloat MinValue { get; }
Property Value
Value
Pixel length for the track.
public NFloat Value { get; }
Property Value
Methods
FitContent(NFloat)
Creates a fit-content(max) track clamped to the given pixel maximum.
public static Grid.TrackSize FitContent(NFloat max)
Parameters
maxNFloat
Returns
Fr(NFloat)
Creates a fractional track. Fr(1) = CSS 1fr.
public static Grid.TrackSize Fr(NFloat fr)
Parameters
frNFloat
Returns
MinMax(NFloat, NFloat)
Creates a minmax(min, max) track with pixel min and max values.
public static Grid.TrackSize MinMax(NFloat min, NFloat max)
Parameters
Returns
Px(NFloat)
Creates a track of an exact pixel length.
public static Grid.TrackSize Px(NFloat px)
Parameters
pxNFloat
Returns
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
Operators
implicit operator TrackSize(double)
Implicitly converts a pixel value to a Length track.
public static implicit operator Grid.TrackSize(double px)
Parameters
pxdouble
Returns
implicit operator TrackSize(int)
Implicitly converts a pixel value to a Length track.
public static implicit operator Grid.TrackSize(int px)
Parameters
pxint
Returns
implicit operator TrackSize(NFloat)
Implicitly converts a pixel value to a Length track.
public static implicit operator Grid.TrackSize(NFloat px)
Parameters
pxNFloat
Returns
implicit operator TrackSize(float)
Implicitly converts a pixel value to a Length track.
public static implicit operator Grid.TrackSize(float px)
Parameters
pxfloat