package toffee
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=9e4e90d17f9b2af1b07071fe425bc2c519c849c4f1d1ab73cde512be2d874849
sha512=06e9c4a741590942e81a27738d0b5c0413fafec8cf3b7dae047ad69f155e7b718aa4223818dc161b7d028efffcfd3365905e264d6fd31d453910ddfa91dcf9b9
doc/toffee.style/Style/Grid_template_component/index.html
Module Style.Grid_template_componentSource
Grid template component definitions.
A grid template component represents an element in a grid-template-columns or grid-template-rows definition. It is either a single track sizing function or a repeat() clause.
See MDN: grid-template-columns
Types
type t = | Single of Track_sizing_function.t(*A single non-repeated track sizing function.
*)| Repeat of Grid_repetition.t(*A
*)repeat()clause that generates multiple tracks.
Constructors
single tsf creates a component with a single track sizing function.
repeat rep creates a component with a repeat() clause.
Common Track Sizing Functions
These constructors create Single components with commonly used track sizing functions.
auto creates a component with automatic track sizing.
Equivalent to Single Track_sizing_function.auto.
min_content creates a component with min-content track sizing.
The track size is the minimum size required to fit the content with all soft line-wrapping opportunities taken.
Equivalent to Single Track_sizing_function.min_content.
max_content creates a component with max-content track sizing.
The track size is the minimum size required to fit the content with no soft line-wrapping opportunities taken.
Equivalent to Single Track_sizing_function.max_content.
zero creates a component with zero-sized track.
Equivalent to Single Track_sizing_function.zero.
fr value creates a component with flexible track sizing.
The track takes a fraction of the available space. The value is the numerator; the denominator is the sum of all fr values in the grid dimension.
See CSS Grid: fr unit.
Equivalent to Single (Track_sizing_function.fr value).
length value creates a component with fixed length track sizing.
Equivalent to Single (Track_sizing_function.length value).
percent value creates a component with percentage-based track sizing.
The value is a fraction in the range 0.0, 1.0, where 0.5 represents 50%. Equivalent to Single (Track_sizing_function.percent value).
fit_content lp creates a component with fit-content track sizing.
The track size is computed as max(min_content, min(max_content, lp)), clamping the available space by the content's min and max sizes.
Equivalent to Single (Track_sizing_function.fit_content lp).
minmax ~min ~max creates a component with minmax track sizing.
The track automatically sizes between min and max based on content and available space.
Equivalent to Single (Track_sizing_function.minmax ~min ~max).
Predicates
is_auto_repetition t returns true if t is a Repeat with automatic repetition count (Auto_fill or Auto_fit).
Returns false for Single components or Repeat components with a fixed Count.
Comparison
compare a b returns a total ordering on components.
Single components sort before Repeat components.
Conversion
to_string t returns a CSS-like string representation of the component.
pp fmt t prints the component to the formatter.