Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file overflow.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119(** Overflow utilities for controlling element overflow behavior.
These utilities are in their own module to get correct ordering - they
should appear after display, sizing, flex, alignment, and gap utilities but
before borders. *)moduleCss=Cascade.CssmoduleHandler=structopenStyleopenCsstypet=|Auto|Hidden|Clip|Visible|Scroll|X_auto|X_clip|X_hidden|X_visible|X_scroll|Y_auto|Y_clip|Y_hidden|Y_visible|Y_scrollletname="overflow"(* Overflow comes after alignment (17) in Tailwind's utility ordering. *)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[overflowAuto],550)|Clip->("clip",style[overflowClip],551)|Hidden->("hidden",style[overflowHidden],552)|Scroll->("scroll",style[overflowScroll],553)|Visible->("visible",style[overflowVisible],554)|X_auto->("x-auto",style[overflow_xAuto],555)|X_clip->("x-clip",style[overflow_xClip],556)|X_hidden->("x-hidden",style[overflow_xHidden],557)|X_scroll->("x-scroll",style[overflow_xScroll],558)|X_visible->("x-visible",style[overflow_xVisible],559)|Y_auto->("y-auto",style[overflow_yAuto],560)|Y_clip->("y-clip",style[overflow_yClip],561)|Y_hidden->("y-hidden",style[overflow_yHidden],562)|Y_scroll->("y-scroll",style[overflow_yScroll],563)|Y_visible->("y-visible",style[overflow_yVisible],564)(* 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;Clip;Hidden;Scroll;Visible;X_auto;X_clip;X_hidden;X_scroll;X_visible;Y_auto;Y_clip;Y_hidden;Y_scroll;Y_visible;]letto_classt=letsuffix,_,_=datatin"overflow-"^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 overflow utility")letexamples=[Auto;X_auto;Y_auto]endopenHandlermoduleUtility_factory=Utility.Make(Handler)(** {1 Public API} *)letutility=Utility_factory.vletoverflow_auto=utilityAutoletoverflow_hidden=utilityHiddenletoverflow_clip=utilityClipletoverflow_visible=utilityVisibleletoverflow_scroll=utilityScrollletoverflow_x_auto=utilityX_autoletoverflow_x_clip=utilityX_clipletoverflow_x_hidden=utilityX_hiddenletoverflow_x_visible=utilityX_visibleletoverflow_x_scroll=utilityX_scrollletoverflow_y_auto=utilityY_autoletoverflow_y_clip=utilityY_clipletoverflow_y_hidden=utilityY_hiddenletoverflow_y_visible=utilityY_visibleletoverflow_y_scroll=utilityY_scroll