package cascade
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=c11bbdc7ab0eee8c03cd162e3e7fd1cb20de62beb13342b3b150a89264ee0056
sha512=43fd97a55c3b1dc4db5c87aa1a5a047d902e902ab2064af3a7c5bf945ebc333f8cd90ecca8013c17be5b950498eace8e0094ee4319eba408285e2bec8d7cdf7b
doc/cascade/Cascade/Container/index.html
Module Cascade.ContainerSource
CSS container query condition types
Container query condition type
Parsed CSS component values preserved inside style queries.
type t = | Min_width_rem of float(*Container min-width in rem:
*)@container (min-width:Xrem)| Min_width_px of int(*Container min-width in pixels:
*)@container (min-width:Xpx)| Named of string * t(*Named container with condition:
*)@container name (condition)| Style of {query : style_query;uppercase : bool;(*
*)truewhen the source spelled the function asSTYLE(...)(case preserved for round-trip fidelity);falsefor the canonical lowercase spelling.
}(*Style query:
*)style(--flag),style(property: value), or a custom-property range query, optionally composed withand,or, ornot.| Scroll_state of {query : scroll_state_query;uppercase : bool;(*
*)truewhen the source spelled the function asSCROLL-STATE(...).
}(*Scroll-state query:
*)scroll-state(stuck: top).| And of t * t(*
*)(A) and (B)| Or of t * t(*
*)(A) or (B)| Not of t(*
*)not (A)| Feature_query of Media.t(*Container size/range feature query, e.g.
*)(inline-size: 640px)or(inline-size > 30em).
and style_query = | Boolean of string| Declaration of {name : string;value : component_values;
}| Range of style_range| All of style_query * style_query| Any of style_query * style_query| Neg of style_query
and style_range = {lower : component_values;lower_op : range_operator;name : string;upper_op : range_operator;upper : component_values;
}and scroll_state_query = | State of {}| Both of scroll_state_query * scroll_state_query| Either of scroll_state_query * scroll_state_query| Negated of scroll_state_query
lower_for_minify t applies Media.lower_for_minify to every nested feature query, leaving the dedicated Min_width_*, style, and scroll-state forms untouched.
to_string t converts a container condition to its CSS string representation. Typed Min_width_* shorthands keep their historical compact form; stylesheet printing uses to_stylesheet_string when pretty spacing is required.
to_stylesheet_string t converts a container condition for stylesheet printing. Non-minified output keeps optional whitespace in typed shorthand feature queries.
of_string s parses a container condition. Raises Failure for malformed conditions.
feature name value is the typed container feature query constructed via Media.feature.
style ?value prop is a style() query. With no value, prop must be a custom property and the query matches the boolean form style(--prop). With a value it matches style(prop: value). Constructs the canonical lowercase form.
scroll_state prop value is the canonical lowercase Scroll_state query, matching scroll-state(prop: value).