Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file stylesheet_intf.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318(** CSS stylesheet interface types *)(** {1 Core Types} *)(** {2 Import Rule} *)typeimport_rule={url:string;(** URL or string to import *)layer:stringoption;(** Optional layer name *)supports:Supports.toption;(** Optional supports condition *)media:Media.toption;(** Optional media query *)}(** A CSS [\@import] rule *)(** {2 Property Rule} *)type'aproperty_rule={name:string;syntax:'aVariables.syntax;inherits:bool;initial_value:'aoption;}(** Type-safe CSS [@property] rule with typed syntax and initial value *)(** {2 Cascade Origins} *)typecascade_origin=|User_agent|User|Author_presentational_hint|Author|Animation|Transition(** Cascade origins from CSS Cascading and Inheritance. [Animation] and
[Transition] represent generated virtual rules. *)typecascade_layer_candidate={layer:stringoption;(** Explicit layer name, or [None] for the implicit unlayered layer. *)important:bool;(** Whether this candidate comes from an important declaration. *)source_order:int;(** Later source-order values win after layer precedence ties. *)value:string;(** Test/API payload representing the cascaded value. *)}(** A minimal same-origin/same-specificity cascade candidate used to model the
layer and source-order parts of the cascade sorting order. *)typecascade_origin_candidate={origin:cascade_origin;(** Origin bucket that contributes this same-property candidate. *)important:bool;(** Whether this candidate comes from an important declaration. *)source_order:int;(** Later source-order values win after origin/importance ties. *)value:string;(** Test/API payload representing the cascaded value. *)}(** A minimal same-specificity cascade candidate used to model origin,
importance, and source-order sorting. *)typedeclared_value={property:string;value:string;important:bool;source_order:int;}(** A declared value contributed by one property declaration before cascade
sorting. The value is the declaration's minified CSS value string. *)typevalue_source=|Cascaded|Initial_default|Inherited_default|Initial_keyword|Inherit_keyword|Unset_initial|Unset_inherited(** Why a specified value was selected during defaulting. *)typevalue={value:string;value_source:value_source}(** Result of applying the non-layout parts of specified-value defaulting. *)typevalue_processing_stage=|Declared_value|Cascaded_value|Specified_value|Computed_value|Used_value|Actual_value(** CSS Cascade value-processing stages. *)(** [@namespace] prelude URI form. CSS Namespaces 3 1: [<string>] and
[url(<string>)] are spec-equivalent; [url_form] further distinguishes
whether the [url()] body itself quoted its argument so the pretty-printer
can round-trip the source spelling. Under [--minify] the printer collapses
every form to the bare quoted string (the shortest spelling). *)typeurl_form=Bare|Quotedofchartypenamespace_url=Urlofstring*url_form|Quotedofstringtypecascade_candidate={origin:cascade_origin;layer:stringoption;important:bool;specificity:int;scope_hops:intoption;source_order:int;value:string;}(** A same-property cascade candidate covering the cascade ordering criteria
this library can model without a DOM: origin/importance, layer, specificity,
scoping proximity, and source order. *)(** {2 Basic Rules} *)typerule={selector:Selector.t;declarations:Declaration.declarationlist;nested:statementlist;merge_key:stringoption;}(** A CSS rule with a selector, declarations, optional nested rules/at-rules,
and an optional merge key for combining rules with identical declarations.
When [merge_key] is [Some key], rules with the same key and identical
declarations can be combined into a single rule with a selector list. *)(** {2 Statements and Blocks} *)(** A CSS statement - either a rule or an at-rule *)andstatement=|Ruleofrule|DeclarationsofDeclaration.declarationlist(** Bare declarations for CSS nesting (no selector) *)|Bang_commentofstring(** Preserved [/*! ... */] comment (license header convention). The body
excludes the surrounding [/*!] / [*/] delimiters. *)|Charsetofstring(** [@charset "UTF-8";] *)|Importofimport_rule(** [@import url(...) layer(...) supports(...);] *)|Namespaceofstringoption*namespace_url(** [@namespace prefix? url;] *)|Property:'aproperty_rule->statement(** [@property --name { ... }] *)|Layer_declofstringlist(** [@layer theme, base, utilities;] *)|Layerofstringoption*block(** [@layer name? { ... }] *)|MediaofMedia.t*block(** [@media (...) { ... }] *)|Containerofstringoption*Container.toption*block(** [@container name? (...) { ... }] *)|SupportsofSupports.t*block(** [@supports (...) { ... }] *)|Moz_documentofmoz_document_conditionlist*block(** [@-moz-document url-prefix(...) { ... }] *)|Starting_styleofblock(** [@starting-style { ... }] *)|Whenofconditional*block(** [@when media(...) { ... }] *)|Elseofconditionaloption*block(** [@else supports(...)? { ... }] *)|Supports_conditionofstring*Declaration.declarationlist(** [@supports-condition --name { ... }] *)|Originofcascade_origin*block(** API-level wrapper recording the cascade origin of a stylesheet block.
It has no CSS surface syntax, but lets optimizers and tests preserve
origin boundaries. *)|ScopeofSelector.toption*Selector.toption*block(** [@scope (start)? to (end)? { ... }] *)|Keyframesofstring*keyframelist(** [@keyframes name { ... }] *)|Webkit_keyframesofstring*keyframelist(** [@-webkit-keyframes name { ... }] *)|Moz_keyframesofstring*keyframelist(** [@-moz-keyframes name { ... }] *)|Font_faceoffont_face_descriptorlist(** [@font-face { ... }] *)|Counter_styleofstring*counter_style_descriptorlist(** [@counter-style name { ... }] *)|Pageofpage_selectorlist*Declaration.declarationlist(** [@page :first { ... }]; empty list is a bare [@page] *)|Page_with_marginsofpage_selectorlist*page_descriptorlist*page_margin_rulelist(** [@page :first { margin: 1cm; @top-left { content: ... } }] *)|Font_palette_valuesofstring*font_palette_descriptorlist(** [@font-palette-values --name { ... }] *)|Font_feature_valuesofProperties.font_familylist*font_feature_values_blocklist(** [@font-feature-values <family-name># { @styleset { nice: 1 } }] *)|View_transitionofview_transition_descriptorlist(** [@view-transition { navigation: auto }] *)|Position_tryofstring*Declaration.declarationlist(** [@position-try --name { top: anchor(...) }] *)|Viewportofviewport_prefix*viewport_descriptorlist(** [@viewport { ... }] / [@-ms-viewport { ... }] (CSS Device Adaptation
1, deprecated but still emitted by minifiers for legacy IE). *)|Unknown_at_ruleof{name:string;prelude:string;block:stringoption;}(** CSS Syntax 3 sec. 5.4.2 "consume an at-rule" preserves any
unrecognised at-rule as raw text so authors can ship unknown vendor or
future at-rules without dropping the whole stylesheet. *)andblock=statementlist(** A block contains a list of statements *)andconditional=|Media_conditionofMedia.t|Supports_condition_testofSupports.t|Andofconditional*conditional|Orofconditional*conditionalandmoz_document_condition=Url_prefixofstringoptionandviewport_prefix=Standard|Ms_prefixedandviewport_descriptor={name:string;value:string}(** Raw [<name>:<value>] pair inside [@viewport] / [@-ms-viewport]; viewport
descriptors share names with regular CSS properties (e.g., [width]) but take
a viewport-specific value grammar that includes [device-width],
[device-height], so they aren't typed against the property reader. *)andkeyframe={selector:Keyframe.selector;(** e.g., [From], [To], [Percent 50.] *)declarations:Declaration.declarationlist;}(** A single keyframe within [\@keyframes] *)andpage_pseudo=First|Left|Right|Blankandpage_selector={name:stringoption;pseudos:page_pseudolist}(** [@page] selector: an optional page name and zero or more pseudo-pages, e.g.
[invoice:blank:first] *)andpage_descriptor=Declaration.declarationandfont_palette_base=Light|Dark|Indexofint|Palette_identofstringandfont_palette_descriptor=|Palette_font_familyofProperties.font_familylist|Base_paletteoffont_palette_base|Override_colorsof(int*Values.color)listandfont_feature_values_block=string*(string*intlist)listandcounter_style_system=|Cyclic|Numeric|Alphabetic|Symbolic|Fixedofintoption|Additive|Extendsofstringandcounter_style_descriptor=|Systemofcounter_style_system|Symbolsofstringlist|Suffixofstring|Prefixofstring|Fallbackofstring|Rangeofstring|Padofstring|Negativeofstring|Additive_symbolsofstring|Speak_asofstringandview_transition_descriptor=|Navigationof[`Auto|`None]|Typesofstringlistoptionandfont_variant_descriptor=|Normal|None|Valuesoffont_variant_descriptor_valuelistandfont_variant_descriptor_value=|LigatureofProperties.font_variant_ligature|CapsofProperties.font_variant_caps|NumericofProperties.font_variant_numeric_token|East_asianofProperties.east_asian_featureandpage_margin_rule={name:string;descriptors:Declaration.declarationlist;}(** CSS page margin at-rule inside [@page]. *)(** Font-face descriptors per CSS Fonts spec *)andfont_face_descriptor=|Font_familyofProperties.font_familylist(** Font family name *)|SrcofFont_face.src(** Font source (url(), local(), etc.) *)|Font_styleofProperties.font_style(** normal, italic, oblique *)|Font_style_rangeofProperties.font_style*Properties.font_style(** variable font style range, e.g. [normal italic] *)|Font_weightofProperties.font_weight(** normal, bold, 100-900 *)|Font_weight_rangeofProperties.font_weight*Properties.font_weight(** variable font weight range, e.g. [100 900] *)|Font_stretchofProperties.font_stretch(** normal, condensed, expanded, etc. *)|Font_stretch_rangeofstring(** variable font stretch range *)|Font_displayofProperties.font_display(** auto, block, swap, fallback, optional *)|Unicode_rangeofProperties.unicode_rangelist(** CSS Fonts 4 sec. 4.5 comma-separated [unicode-range] list. *)|Font_variantoffont_variant_descriptor(** [font-variant] descriptor *)|Font_feature_settingsofProperties.font_feature_settings(** OpenType feature settings *)|Font_variation_settingsofProperties.font_variation_settings(** Variable font settings *)|Font_techofstring(** [font-tech] descriptor *)|Size_adjustofFont_face.size_adjust(** Size adjustment percentage *)|Ascent_overrideofFont_face.metric_override(** Ascent metric override *)|Descent_overrideofFont_face.metric_override(** Descent metric override *)|Line_gap_overrideofFont_face.metric_override(** Line gap metric override *)(** {1 Stylesheet Structure} *)typestylesheet=statementlist(** A CSS stylesheet is a list of statements *)typet=stylesheet(** Alias for backwards compatibility *)(** {1 Rendering} *)typemode=Variables|Inline(** Rendering mode for CSS output *)letequal_cascade_origin(a:cascade_origin)b=a=bletequal(a:stylesheet)b=a=b