12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091(** Overscroll behavior utilities for controlling scroll chaining.
What's included:
- `overscroll-auto` - Default scroll chaining behavior.
- `overscroll-contain` - Prevent scroll chaining to parent.
- `overscroll-none` - Prevent scroll chaining and overscroll effects.
- `overscroll-x-*`, `overscroll-y-*` - Axis-specific overscroll behavior.
Parsing contract ([of_class]):
- Accepts ["overscroll"; value] and ["overscroll"; axis; value].
- Unknown tokens yield [Error (`Msg "Not an overscroll utility")]. *)moduleCss=Cascade.CssmoduleHandler=structopenStyleopenCsstypet=|Auto|Contain|None_|X_auto|X_contain|X_none|Y_auto|Y_contain|Y_noneletname="overscroll"(* Same priority as overflow (18) - these are related utilities *)letpriority_=18(* Class suffix, style and cascade suborder of one utility. Written as a
match, not a lookup table: a constructor added to [t] without an entry here
is a compile error rather than a [Not_found] raised out of [to_class]
halfway through rendering a sheet. *)letdata:t->string*Style.t*int=function|Auto->("auto",style[overscroll_behavior[Auto]],600)|Contain->("contain",style[overscroll_behavior[Contain]],601)|None_->("none",style[overscroll_behavior[None]],602)|X_auto->("x-auto",style[overscroll_behavior_xAuto],603)|X_contain->("x-contain",style[overscroll_behavior_xContain],604)|X_none->("x-none",style[overscroll_behavior_xNone],605)|Y_auto->("y-auto",style[overscroll_behavior_yAuto],606)|Y_contain->("y-contain",style[overscroll_behavior_yContain],607)|Y_none->("y-none",style[overscroll_behavior_yNone],608)(* Every constructor, for the class-name lookup. A missing entry costs a class
that no longer parses, which the round-trip test reports. *)letall=[Auto;Contain;None_;X_auto;X_contain;X_none;Y_auto;Y_contain;Y_none;]letto_classt=letsuffix,_,_=datatin"overscroll-"^suffixletto_style_themet=let_,s,_=datatinsletsubordert=let_,_,o=datatinoletof_class_map=List.map(funt->(to_classt,t))allletof_class_themecls=matchList.assoc_optclsof_class_mapwith|Somet->Okt|None->Error(`Msg"Not an overscroll utility")letexamples=[Auto;X_auto;Y_auto]endopenHandlermoduleUtility_factory=Utility.Make(Handler)letutility=Utility_factory.vletoverscroll_auto=utilityAutoletoverscroll_contain=utilityContainletoverscroll_none=utilityNone_letoverscroll_x_auto=utilityX_autoletoverscroll_x_contain=utilityX_containletoverscroll_x_none=utilityX_noneletoverscroll_y_auto=utilityY_autoletoverscroll_y_contain=utilityY_containletoverscroll_y_none=utilityY_none