Module Cascade.CssSource

Typed CSS construction.

This library provides types and functions to construct CSS declarations, rules and stylesheets. It avoids stringly-typed CSS by keeping close to the CSS syntax and specifications.

Cascade is scoped to CSS text and CSS ASTs: parsing, printing, minification, structural traversal, structural transforms, structural diffs, and safe optimizations. When a transform needs information beyond CSS text, that information is passed as an explicit closed context record. Theme/default based var() output is part of the current API; Context contains context records for value-oriented transforms.

The main notions are:

Minimal example:

open Cascade.Css

(* Build a ".btn" rule and render a stylesheet from it. *)
let button =
  rule ~selector:(Selector.class_ "btn")
    [
      display Inline_block;
      background_color (hex "#3b82f6");
      color (hex "#ffffff");
      padding [ Rem 0.5 ];
      border_radius (radius (Rem 0.375));
    ]

let css = to_string (v [ button ])

Custom properties:

open Cascade.Css

let def, primary = var "primary-color" Color (hex "#3b82f6")
let root = rule ~selector:(Selector.of_string ":root") [ def ]
let card = rule ~selector:(Selector.class_ "card") [ color (Var primary) ]
let css = to_string (v [ root; card ])

Start with rule, media, container, supports, v, and to_string. Property helpers are grouped by CSS feature below. Parser building blocks such as cursors, tokens and component values are available from the library root, for example Cascade.Cursor and Cascade.Parser, not through Css.

See https://www.w3.org/Style/CSS/specs.en.html W3C CSS Specifications and https://developer.mozilla.org/en-US/docs/Web/CSS MDN CSS Documentation.

Core Concepts

Core CSS system setup and construction tools for building stylesheets.

Feature Modules

The facade re-exports the CSS-facing modules users normally combine with the top-level helpers. These are aliases, so odoc links to the focused module page instead of duplicating each full signature here.

Sourcemodule Selector = Selector

Selector syntax, matching and specificity.

Sourcemodule Selector_summary = Selector_summary
Sourcemodule Aria = Aria
Sourcemodule Color_space = Color_space
Sourcemodule Context = Context
Sourcemodule Pp = Pp
Sourcemodule Values = Values
Sourcemodule Declaration = Declaration
Sourcemodule Properties = Properties
Sourcemodule Variables = Variables
Sourcemodule Optimize = Optimize
Sourcemodule Stylesheet = Stylesheet
Sourcemodule Source = Stylesheet.Source
Sourcemodule Media = Media
Sourcemodule Container = Container
Sourcemodule Supports = Supports
Sourcemodule Keyframe = Keyframe
Sourcemodule Font_face = Font_face
Sourcemodule Nest = Nest

Parser building blocks live at the library root (Cascade.Cursor, Cascade.Parser, Cascade.Token, ...), not under Css.

Per-type value parsers

Sourcemodule Gradient_direction : sig ... end

CSS Rules and Stylesheets

Core building blocks for CSS rules and stylesheet construction.

See https://www.w3.org/TR/css-syntax-3/ CSS Syntax Module Level 3 and https://www.w3.org/TR/css-nesting-1/ CSS Nesting Module Level 1.

type declaration = Declaration.declaration

The type for CSS declarations (property-value pairs).

type statement = Stylesheet.statement

The type for CSS statements.

type cascade_origin = Stylesheet.cascade_origin =
  1. | User_agent
  2. | User
  3. | Author_presentational_hint
  4. | Author
  5. | Animation
  6. | Transition

Cascade origins from CSS Cascading and Inheritance.

Sourceval rule : selector:Selector.t -> ?nested:statement list -> ?merge_key:string -> declaration list -> statement

rule ~selector ?nested ?merge_key declarations creates a CSS rule statement with the given selector and declarations. When merge_key is provided, the optimizer can combine this rule with other rules sharing the same key and identical declarations.

Sourceval statement_selector : statement -> Selector.t option

statement_selector stmt returns Some selector if the statement is a rule, None otherwise.

Sourceval as_rule : statement -> (Selector.t * declaration list * statement list) option

as_rule stmt returns Some (selector, declarations, nested) if the statement is a rule, None otherwise. The declarations are the run written before the first nested statement; a run written after one is a nested declarations rule inside nested, at the position it was written.

Sourceval as_layer : statement -> (Stylesheet.layer_name option * statement list) option

as_layer stmt returns Some (name, statements) if the statement is a layer, None otherwise.

Sourceval as_media : statement -> (Media.t * statement list) option

as_media stmt returns Some (condition, statements) if the statement is a media query, None otherwise.

Sourceval as_container : statement -> (string option * Container.t option * statement list) option

as_container stmt returns Some (name, condition, statements) if the statement is a container query, None otherwise.

Sourceval as_supports : statement -> (Supports.t * statement list) option

as_supports stmt returns Some (condition, statements) if the statement is a supports query, None otherwise.

Sourceval is_nested_media : statement -> bool

is_nested_media stmt returns true if the statement is a media query containing bare declarations (CSS nesting style), false otherwise.

Sourceval is_nested_supports : statement -> bool

is_nested_supports stmt returns true if the statement is a supports query containing bare declarations (CSS nesting style), false otherwise.

Sourceval as_declarations : statement -> declaration list option

as_declarations stmt returns Some decls if the statement is a bare declarations block (used in CSS nesting), None otherwise.

Sourceval unknown_at_rule : name:string -> prelude:string -> ?block:string -> unit -> (statement, Error.t) result

unknown_at_rule ~name ~prelude ?block () is the at-rule \@name prelude with block as its body, or the reason its parts cannot make one. It is the way to emit an at-rule cascade has no grammar for, such as one a tool of the caller's own defines. Omitting block gives the statement form, \@name prelude;.

name is the at-keyword without its @. block is the text between the at-rule's braces, since an unknown at-rule has no grammar to re-serialise a body from; to_string ~minify:true statements is that text for a block cascade does model, so placing one needs no re-read of a printed sheet.

A part that would not read back as that part is refused rather than printed, and the refusal names one at-rule rather than the sheet it sits in: building each at-rule on its own loses the malformed one, where re-reading an assembled sheet loses every at-rule in it.

Sourceval with_origin : cascade_origin -> statement list -> statement

with_origin cascade_origin statements records the cascade origin for a stylesheet block. This is an API-level wrapper with no CSS syntax.

Sourceval as_origin : statement -> (cascade_origin * statement list) option

as_origin stmt returns Some (origin, statements) if the statement is an origin wrapper, None otherwise.

Sourceval origin_importance_rank : important:bool -> cascade_origin -> int

origin_importance_rank ~important origin returns the cascade precedence rank for the origin/importance criterion. Larger ranks have higher precedence.

Sourceval eval_declaration : ?layer_order:string list -> ?layer:string -> Context.t -> declaration -> declaration

eval_declaration ctx decl rewrites decl to a more-defined declaration under ctx, preserving unresolved subtrees as CSS syntax.

Sourceval eval_value : ?layer_order:string list -> ?layer:string -> Context.t -> 'a Properties.property -> 'a -> declaration

eval_value ctx property value evaluates value in the CSS declaration context of property, returning the evaluated declaration.

Sourceval eval_rule : ?layer_order:string list -> ?layer:string -> Context.t -> Stylesheet.rule -> Stylesheet.rule

eval_rule ctx rule evaluates every declaration in rule and its nested statements.

Sourceval eval_stylesheet : ?layer_order:string list -> ?layer:string -> Context.t -> Stylesheet.t -> Stylesheet.t

eval_stylesheet ctx stylesheet evaluates every declaration in stylesheet.

Sourceval import_layer_name : Stylesheet.import_rule -> Stylesheet.layer_name option

import_layer_name rule returns the layer name declared by an @import rule: None means no layer, Some [] means an anonymous layer, and Some name is a named layer.

Sourceval layer_block_name : statement -> Stylesheet.layer_name option

layer_block_name stmt returns the declared name of an @layer block rule. Anonymous layer blocks return Some [].

Sourceval layer_statement_name_list : statement -> Stylesheet.layer_name list option

layer_statement_name_list stmt returns the declared name list for statement-form @layer rules.

Sourceval cascade_layer_precedence_rank : layer_order:string list -> important:bool -> string option -> int

cascade_layer_precedence_rank returns the same-origin layer precedence rank for a layer. Larger ranks have higher precedence.

Sourceval compare_cascade_layer_candidate : layer_order:string list -> Stylesheet.cascade_layer_candidate -> Stylesheet.cascade_layer_candidate -> int

compare_cascade_layer_candidate compares same-origin/same-specificity candidates by importance, layer precedence, then source order.

Sourceval winning_cascade_layer_candidate : layer_order:string list -> Stylesheet.cascade_layer_candidate list -> Stylesheet.cascade_layer_candidate option

winning_cascade_layer_candidate returns the winning candidate using compare_cascade_layer_candidate.

Sourceval cascade_revert_layer_candidates : layer_order:string list -> important:bool -> current_layer:string option -> Stylesheet.cascade_layer_candidate list -> Stylesheet.cascade_layer_candidate list

cascade_revert_layer_candidates returns same-importance candidates in lower-priority layers than the current revert-layer declaration.

compare_cascade_origin_candidate compares same-specificity candidates by origin/importance precedence, then source order.

Sourceval winning_cascade_origin_candidate : Stylesheet.cascade_origin_candidate list -> Stylesheet.cascade_origin_candidate option

winning_cascade_origin_candidate returns the winning candidate using compare_cascade_origin_candidate.

Sourceval cascade_revert_origin_candidates : important:bool -> current_origin:cascade_origin -> Stylesheet.cascade_origin_candidate list -> Stylesheet.cascade_origin_candidate list

cascade_revert_origin_candidates returns same-importance candidates in the origins exposed by a revert declaration from current_origin.

Sourceval declared_values : ?property:string -> declaration list -> Stylesheet.declared_value list

declared_values ?property declarations returns declared values in source order, optionally filtered to one property.

Sourceval cascaded_value : Stylesheet.cascade_origin_candidate list -> string option

cascaded_value candidates returns the winning cascaded value payload, or None when no candidate contributes a value.

Sourceval compare_cascade_candidate : layer_order:string list -> Stylesheet.cascade_candidate -> Stylesheet.cascade_candidate -> int

compare_cascade_candidate ~layer_order a b compares full same-property cascade candidates by origin/importance, layer, specificity, scoping proximity, and source order.

Sourceval winning_cascade_candidate : layer_order:string list -> Stylesheet.cascade_candidate list -> Stylesheet.cascade_candidate option

winning_cascade_candidate ~layer_order candidates returns the highest priority full cascade candidate.

Sourceval value : inherits:bool -> initial:string -> inherited:string option -> cascaded:string option -> Stylesheet.value

value ~inherits ~initial ~inherited ~cascaded models the defaulting step from cascaded value to specified value for the non-layout cases represented by this library.

Sourceval specified_value_after_revert : inherits:bool -> initial:string -> inherited:string option -> Stylesheet.cascade_origin_candidate list -> Stylesheet.value

specified_value_after_revert chains revert rollbacks through the origin stack until a non-revert winner remains, then defaults.

Sourceval specified_value_after_revert_layer : inherits:bool -> initial:string -> inherited:string option -> layer_order:string list -> Stylesheet.cascade_layer_candidate list -> Stylesheet.value

specified_value_after_revert_layer is the revert-layer analogue, chained through the layer stack.

Sourceval value_processing_requires_document_context : Stylesheet.value_processing_stage -> bool

value_processing_requires_document_context stage reports whether stage needs caller-supplied document, layout, rendering, or device context rather than CSS text alone.

Sourceval map : (Selector.t -> declaration list -> statement) -> statement list -> statement list

map f stmts applies f to every rule in stmts: the ones at the top level, the ones inside a conditional group at-rule such as @media, @supports, @layer, @container, @scope or @starting-style, however deeply nested, and the ones nested inside a rule.

  • Traversal is depth-first, and a statement that is not a rule is kept with its block rewritten.
  • Non-rule statements maintain their relative order.
  • When f returns a rule holding no nested statements, the original nested tree is kept with map applied to it; one holding its own replaces it.
Sourceval sort : ((Selector.t * declaration list) -> (Selector.t * declaration list) -> int) -> statement list -> statement list

sort cmp stmts reorders the rules of stmts with cmp, and the rules of every block below them: inside a conditional group at-rule such as @media, @supports, @layer, @container, @scope or @starting-style, however deeply nested, and inside the nested statements of a rule.

  • Each block is sorted on its own, so a rule never leaves the block it sits in.
  • Sort is stable: rules cmp calls equal maintain their relative order.
  • Non-rule statements sort after the rules of their block and maintain their relative order among themselves, so an @else still follows the @when it answers.
Sourcetype property_info =
  1. | Property_info : {
    1. name : string;
    2. syntax : 'a Variables.syntax;
    3. inherits : bool;
    4. initial_value : 'a option;
    } -> property_info

Existential type for property information that preserves type safety

Sourceval as_property : statement -> property_info option

as_property stmt returns Some (Property_info {...}) if the statement is a @property declaration, None otherwise. The existential type preserves the relationship between syntax type and initial value type.

type keyframe = Stylesheet.keyframe

Type for keyframe selectors and their declarations

Sourceval keyframe : selector:string -> declarations:declaration list -> keyframe

keyframe ~selector ~declarations is a single keyframe whose selector is parsed via Keyframe.selector_of_string (e.g. "from", "to", "50%", "50%, 100%"). Raises Invalid_argument if selector is not a valid keyframe selector.

Sourceval keyframes : string -> keyframe list -> statement

keyframes name frames creates a @keyframes rule.

Example:

open Cascade.Css

let pulse =
  keyframes "pulse"
    [
      keyframe ~selector:"50%"
        ~declarations:[ opacity (Opacity_number 0.5) ];
    ]

produces @keyframes pulse { 50% { opacity: 0.5 } }.

Sourceval as_keyframes : statement -> (string * keyframe list) option

as_keyframes stmt returns Some (name, frames) if the statement is a @keyframes animation, None otherwise.

Sourceval as_font_face : statement -> Stylesheet.font_face_descriptor list option

as_font_face stmt returns Some descriptors if the statement is a @font-face rule, None otherwise.

Sourceval as_import : statement -> Stylesheet.import_rule option

as_import stmt returns Some import_rule if the statement is an @import rule, None otherwise.

At-Rules

At-rules are CSS statements that instruct CSS how to behave. They begin with an at sign (@) followed by an identifier and include everything up to the next semicolon or CSS block.

See https://www.w3.org/TR/css-conditional-5/ CSS Conditional Rules Module Level 5 and https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule MDN At-rules.

Stylesheet Construction

Tools for building complete CSS stylesheets from rules and declarations.

See https://www.w3.org/TR/css-cascade-5/ CSS Cascading and Inheritance Level 5, which gives the origins, the @layer ordering and the CSS-wide keywords the builders below write.

The type for CSS stylesheets.

Sourceval empty : t

empty is an empty stylesheet.

Sourceval concat : t list -> t

concat stylesheets concatenates multiple stylesheets into one.

Sourceval v : statement list -> t

v statements creates a stylesheet from a list of statements.

Sourceval rule_statements : t -> statement list

rule_statements t returns the top-level rule statements from the stylesheet.

Sourceval statements : t -> statement list

statements t returns all top-level statements from the stylesheet.

Sourceval equal_statement : statement -> statement -> bool

equal_statement a b is Stylesheet.equal_statement: whether a and b are the same statement, each part read through the equality its own module states.

Sourceval hash_statement : statement -> int

hash_statement stmt is Stylesheet.hash_statement: a fingerprint consistent with equal_statement, for keying a statement in a hash table without rendering it to CSS text.

Sourceval fold : ('a -> statement -> 'a) -> 'a -> t -> 'a

fold f acc css folds f over every statement in css and over every statement reachable from one, in source order: a rule nested in a rule, a block at-rule inside a group, and whatever those hold in turn. The walk descends through Stylesheet.statement_children, so it reaches every statement the AST can hold rather than a listed set of at-rules.

Example: Collect all selectors from all rules (including nested ones):

open Cascade

let selectors css =
  Css.fold
    (fun acc stmt ->
      match Css.as_rule stmt with
      | Some (sel, _, _) -> Css.Selector.to_string sel :: acc
      | None -> acc)
    [] css
Sourceval media_queries : t -> (Media.t * statement list) list

media_queries t is every @media in t, at any depth, paired with the rule statements below its brace. A query inside a group at-rule counts, and a rule nested in another rule or held by an inner group is one of the query's rules; a nested rule keeps the relative selector it was written with.

Sourceval layers : t -> Stylesheet.layer_name list

layers t is every cascade layer t declares, one path per layer (a.b is the sublayer b of a, however it was written), in the order the sheet first names them. Each path is its idents, so a . one ident carries is not the separator between two. A layer named inside a conditional group counts: the group decides whether its contents apply, not whether the layer exists. A sublayer of an anonymous @layer { ... } has no name to report.

This is what a sheet declares, not the order a cascade resolves in. Resolve.layer_order answers that, and leaves out a layer named inside any block the resolver does not enter: a conditional group rule, @starting-style, @scope or an origin wrapper.

AST Introspection Helpers

Sourceval layer_block : Stylesheet.layer_name -> t -> statement list option

layer_block name sheet is the statements of the layer name, wherever it is declared and whatever form declares it: a dotted name, a nested block, or a block inside a conditional group. It is None when no @layer block opens that layer, so a name only an @layer a, b; statement declares is None as well.

Sourceval rules_of_statements : statement list -> (Selector.t * declaration list) list

rules_of_statements stmts extracts all CSS rules (selector + declarations) from a list of statements, filtering out at-rules and other non-rule statements.

Sourceval custom_prop_names : declaration list -> string list

custom_prop_names decls extracts all custom property names from a list of declarations.

Sourceval theme_guarded : var_name:string -> declaration -> declaration

theme_guarded ~var_name decl wraps decl so it is only emitted when var_name is present in the theme.

Sourceval as_theme_guarded : declaration -> (string * declaration) option

as_theme_guarded decl returns Some (var_name, inner_decl) if decl is a theme-guarded declaration, None otherwise.

Sourceval custom_props_of_rules : (Selector.t * declaration list) list -> string list

custom_props_of_rules rules extracts all custom property names from the declarations in the rules.

Sourceval custom_props : ?layer:Stylesheet.layer_name -> t -> string list

custom_props ?layer sheet is the name of every custom property sheet declares for an element: the ones in a style rule or a bare nesting block, at the top level and inside a conditional group at-rule such as @media, @supports, @container, @scope or @starting-style, however deeply nested. A name declared in @keyframes, @page, @position-try or @supports-condition belongs to another cascade origin or to no element at all (CSS Cascading 5 sec. 6.1) and is not among them. When layer is given, the names are those declared inside the @layer of that name.

Sourceval media : condition:Media.t -> statement list -> statement

media ~condition statements creates a @media statement with the given condition.

Sourceval media_nested : condition:Media.t -> declaration list -> statement

media_nested ~condition declarations creates a @media statement for CSS nesting, containing bare declarations (no selector). Used inside rules where the selector is inherited from the parent.

Sourceval declarations : declaration list -> statement

declarations decls creates a bare declarations block (used in CSS nesting).

Sourceval layer : ?name:Stylesheet.layer_name -> statement list -> statement

layer ?name statements creates a @layer statement with the given statements.

Sourceval layer_decl : Stylesheet.layer_name list -> statement

layer_decl names creates a @layer declaration statement that declares layer names without any content (e.g., @layer theme, base, components, utilities;).

Sourceval layer_of : ?name:Stylesheet.layer_name -> t -> t

layer_of ?name stylesheet wraps an entire stylesheet in @layer, preserving @supports and other at-rules within it.

Sourceval container : ?name:string -> ?condition:Container.t -> statement list -> statement

container ?name ~condition statements creates a @container statement with the given statements.

Sourceval supports : condition:Supports.t -> statement list -> statement

supports ~condition statements creates a @supports statement with the given condition.

Sourceval starting_style : statement list -> statement

starting_style statements creates a @starting-style statement with the given statements. Used for CSS entry animations.

Sourceval starting_style_nested : declaration list -> statement

starting_style_nested declarations creates a @starting-style statement for CSS nesting, containing bare declarations (no selector). Used inside rules where the selector is inherited from the parent.

Declarations

Core value types and declaration building blocks.

Custom Properties (Variables)

See https://www.w3.org/TR/css-variables-1/ CSS Custom Properties for Cascading Variables Module Level 1 for var() and https://www.w3.org/TR/css-properties-values-api-1/ CSS Properties and Values API Level 1 for the @property registration.

type 'a var = 'a Values.var

The type of CSS variable holding values of type 'a.

type 'a env = 'a Values.env = {
  1. name : string;
  2. indices : int list;
  3. fallback : 'a option;
}

CSS env() reference.

Sourceval var_name : 'a var -> string

var_name v is v's variable name (without --).

Sourceval var_layer : 'a var -> string option

var_layer v is the optional layer where v is defined.

Sourceval with_fallback : 'a var -> 'a -> 'a var

with_fallback var_ref fallback_value creates a new variable reference with the same variable name but a different fallback value. This is useful when you need to reference a variable from another module with a specific fallback, without creating a declaration.

type any_var = Variables.any_var =
  1. | V : 'a var -> any_var

The type of CSS variables.

Sourceval vars_of_rules : statement list -> any_var list

vars_of_rules statements is vars_of_stylesheet of statements: a statement list is a stylesheet, and the two answer the same question.

Sourceval vars_of_declarations : declaration list -> any_var list

vars_of_declarations decls extracts all CSS variables referenced in the declarations list.

Sourceval vars_of_stylesheet : t -> any_var list

vars_of_stylesheet stylesheet is every variable stylesheet references, from the declarations of every statement it holds: a rule nested in a rule, a rule inside any grouping at-rule, and an at-rule carrying declarations of its own such as @keyframes or @page. Deduplicated, in source order.

Sourceval any_var_name : any_var -> string

any_var_name v is the name of a CSS variable (with -- prefix).

Sourceval custom_declarations : ?layer:string -> declaration list -> declaration list

custom_declarations ?layer decls is only the custom property declarations from decls. If layer is provided, only declarations from that layer are returned.

all v is the all shorthand. It resets every longhand to v but the two writing-mode ones CSS Cascading 5 sec. 3.3 excepts.

Core Types & Calculations

Fundamental types for CSS values, variables, and calculations that underpin the entire CSS system.

See https://www.w3.org/TR/css-variables-1/ CSS Custom Properties for Cascading Variables Module Level 1 and https://www.w3.org/TR/css-values-4/ CSS Values and Units Module Level 4.

type calc_op = Values.calc_op =
  1. | Add
  2. | Sub
  3. | Mul
  4. | Div

CSS calc operations.

type math_const = Values.math_const =
  1. | Pi
  2. | E
  3. | Infinity
  4. | Neg_infinity
  5. | Nan

CSS Values 4 sec. 10.7 math constants - emitted at the source byte sequence so pretty pp preserves calc(2 * pi) instead of writing calc(6.28318530718).

type math_arg = Values.math_arg =
  1. | Lit of float
  2. | Dim of float * string
    (*

    A dimension argument (e.g. 1vw, 1%).

    *)
  3. | Const of math_const
  4. | Var_arg of math_arg var
  5. | Op of math_arg * calc_op * math_arg
  6. | Parens_arg of math_arg
  7. | Math_call of math_fn

CSS Values 4 (ED) sec. 9.1 numeric math function arguments.

and math_fn = Values.math_fn =
  1. | Sin of angle_arg
  2. | Cos of angle_arg
  3. | Tan of angle_arg
  4. | Asin of math_arg
  5. | Acos of math_arg
  6. | Atan of math_arg
  7. | Atan2 of math_arg * math_arg
  8. | Sqrt of math_arg
  9. | Exp of math_arg
  10. | Log of math_arg * math_arg option
  11. | Pow of math_arg * math_arg
  12. | Hypot of math_arg list
  13. | Sign_n of math_arg
  14. | Abs_n of math_arg
  15. | Round_n of string * math_arg * math_arg
    (*

    Sec. 10.9 round(<rounding-strategy>?, A, B).

    *)
  16. | Mod_n of math_arg * math_arg
  17. | Rem_n of math_arg * math_arg

CSS Values 4 (ED) sec. 9.1 numeric math functions.

and angle_arg = Values.angle_arg =
  1. | Deg of float
  2. | Rad of float
  3. | Turn of float
  4. | Grad of float
  5. | Numeric_arg of math_arg
  6. | Operation of angle_arg * calc_op * angle_arg
  7. | Grouped of angle_arg

sin / cos / tan arg: an <angle> or unitless <number> (radians). Operation and Grouped support arithmetic over angles.

type 'a calc = 'a Values.calc =
  1. | Var of 'a var
    (*

    CSS variable

    *)
  2. | Val of 'a
  3. | Num of float
    (*

    Unitless number

    *)
  4. | Math_const of math_const
    (*

    CSS Values 4 sec. 10.7 math constant (pi, e, infinity, -infinity, NaN) preserved verbatim through pretty pp.

    *)
  5. | Sibling_index
    (*

    CSS sibling-index() math function.

    *)
  6. | Sibling_count
    (*

    CSS sibling-count() math function.

    *)
  7. | Expr of 'a calc * calc_op * 'a calc
  8. | Nested of 'a calc
    (*

    Explicitly nested calc()

    *)
  9. | Parens of 'a calc
    (*

    Parenthesized expression

    *)
  10. | Math_fn of math_fn
    (*

    CSS Values 4 (ED) sec. 9.1 numeric math function call.

    *)

CSS calc values.

type component_values = Component.t list

Parsed CSS component values preserved for fallback and invalid-value round-tripping. Prefer typed values in normal user code.

type invalid_value = component_values

Spec-invalid value fragments preserved until optimization decides whether to drop the containing declaration.

type custom_value = component_values

CSS custom-property token stream.

type 'a fallback = 'a Values.fallback =
  1. | Empty
    (*

    Empty fallback: var(--name,)

    *)
  2. | Empty2
    (*

    2-char empty fallback: var(--name, ) -- matches tailwindcss output, likely a bug in tailwindcss

    *)
  3. | None
    (*

    No fallback: var(--name)

    *)
  4. | Fallback of 'a
    (*

    Value fallback: var(--name, value)

    *)
  5. | Syntax_fallback of component_values
    (*

    Syntactic declaration-value fallback when it is not a typed value.

    *)
  6. | Var_fallback of string
    (*

    Nested var fallback: var(--name, var(--fallback))

    *)
type attr_syntax = Values.attr_syntax =
  1. | Length
  2. | Length_percentage
  3. | Color
  4. | Number
  5. | Percentage
type attr_type = Values.attr_type =
  1. | Type of attr_syntax
  2. | Unit of string
  3. | Raw_string
  4. | Number_type
type 'a attr_fallback = 'a Values.attr_fallback =
  1. | No_fallback
  2. | Empty_fallback
  3. | Attr_fallback of 'a
type 'a attr_call = 'a Values.attr_call = {
  1. name : string;
  2. type_ : attr_type option;
  3. fallback : 'a attr_fallback;
}

CSS Values & Units

Core value types used across CSS properties.

See https://www.w3.org/TR/css-values-4/ CSS Values and Units Module Level 4.

type length = Values.length =
  1. | Px of float
  2. | Cm of float
  3. | Mm of float
  4. | Q of float
  5. | In of float
  6. | Pt of float
  7. | Pc of float
  8. | Rem of float
  9. | Em of float
  10. | Ex of float
  11. | Cap of float
  12. | Ic of float
  13. | Ric of float
  14. | Rlh of float
  15. | Pct of float
  16. | Vw of float
  17. | Vh of float
  18. | Vmin of float
  19. | Vmax of float
  20. | Vi of float
  21. | Vb of float
  22. | Dvh of float
  23. | Dvw of float
  24. | Dvmin of float
  25. | Dvmax of float
  26. | Lvh of float
  27. | Lvw of float
  28. | Lvmin of float
  29. | Lvmax of float
  30. | Svh of float
  31. | Svw of float
  32. | Svmin of float
  33. | Svmax of float
  34. | Cqw of float
    (*

    Container query width units

    *)
  35. | Cqh of float
    (*

    Container query height units

    *)
  36. | Cqi of float
    (*

    Container query inline-size units

    *)
  37. | Cqb of float
    (*

    Container query block-size units

    *)
  38. | Cqmin of float
    (*

    Smaller container query dimension units

    *)
  39. | Cqmax of float
    (*

    Larger container query dimension units

    *)
  40. | Ch of float
    (*

    Character units

    *)
  41. | Lh of float
    (*

    Line height units

    *)
  42. | Dimension of {
    1. value : float;
    2. unit : string;
    3. repr : string;
    }
    (*

    Dimension with authored numeric spelling preserved for pretty printing.

    *)
  43. | Size
    (*

    size keyword inside calc-size().

    *)
  44. | Auto
  45. | None
    (*

    none keyword (e.g., for max-width)

    *)
  46. | Normal
    (*

    normal keyword (letter-spacing, word-spacing, line-height)

    *)
  47. | Zero
  48. | Inherit
  49. | Initial
  50. | Unset
  51. | Revert
  52. | Revert_layer
  53. | Fit_content
    (*

    fit-content keyword

    *)
  54. | Fit_content_arg of length
    (*

    fit-content(<length-percentage>); the argument is stored via length because that type already has a Pct of float case for the percentage form.

    *)
  55. | Content
    (*

    content keyword

    *)
  56. | Contain
    (*

    contain keyword (intrinsic sizing)

    *)
  57. | Max_content
    (*

    max-content keyword

    *)
  58. | Min_content
    (*

    min-content keyword

    *)
  59. | Webkit_max_content
    (*

    -webkit-max-content (legacy intrinsic sizing)

    *)
  60. | Webkit_min_content
    (*

    -webkit-min-content (legacy intrinsic sizing)

    *)
  61. | Webkit_fit_content
    (*

    -webkit-fit-content (legacy intrinsic sizing)

    *)
  62. | Moz_max_content
    (*

    -moz-max-content (legacy intrinsic sizing)

    *)
  63. | Moz_min_content
    (*

    -moz-min-content (legacy intrinsic sizing)

    *)
  64. | Moz_fit_content
    (*

    -moz-fit-content (legacy intrinsic sizing)

    *)
  65. | From_font
    (*

    from-font keyword for text-decoration-thickness

    *)
  66. | Hairline
    (*

    hairline line-width keyword for text-decoration-thickness

    *)
  67. | Thin
    (*

    thin line-width keyword for text-decoration-thickness

    *)
  68. | Medium
    (*

    medium line-width keyword for text-decoration-thickness

    *)
  69. | Thick
    (*

    thick line-width keyword for text-decoration-thickness

    *)
  70. | Stretch
    (*

    stretch keyword (intrinsic sizing)

    *)
  71. | Clamp of length * length * length
    (*

    CSS clamp(min, val, max).

    *)
  72. | Min of length list
    (*

    CSS min(a, b, ...).

    *)
  73. | Max of length list
    (*

    CSS max(a, b, ...).

    *)
  74. | Minmax of length * length
    (*

    CSS minmax(min, max) (grid).

    *)
  75. | Round of string * length * length
    (*

    CSS round() math function

    *)
  76. | Mod of length * length
    (*

    CSS mod() math function

    *)
  77. | Rem_fn of length * length
    (*

    CSS rem() math function

    *)
  78. | Hypot of length list
    (*

    CSS hypot() math function

    *)
  79. | Abs of length
    (*

    CSS abs() math function

    *)
  80. | Calc_size of length * length calc
    (*

    CSS calc-size() function

    *)
  81. | Anchor_size of string
    (*

    CSS anchor-size() function, from CSS Anchor Positioning Level 1.

    *)
  82. | Anchor of string option * string * length option
    (*

    CSS anchor() function: optional anchor name, side, and fallback.

    *)
  83. | Attr of length attr_call
    (*

    CSS attr() in typed value contexts (CSS Values 5 sec. 8.7).

    *)
  84. | Env of length env
    (*

    CSS env() reference.

    *)
  85. | Var of length var
    (*

    CSS variable reference

    *)
  86. | Calc of length calc
    (*

    Calculated expressions

    *)

CSS length values.

Supports absolute, relative, viewport (including dynamic/large/small), character-based units, keywords, and calculated expressions.

Sourcemodule Calc : sig ... end

Builder functions for calc() expressions.

type 'a property = 'a Properties.property

GADT for typed CSS properties.

type color_space = Values.color_space =
  1. | Srgb
  2. | Srgb_linear
  3. | Display_p3
  4. | A98_rgb
  5. | Prophoto_rgb
  6. | Rec2020
  7. | Lab
  8. | Oklab
  9. | Xyz
  10. | Xyz_d50
  11. | Xyz_d65
  12. | Lch
  13. | Oklch
  14. | Hsl
  15. | Hwb

CSS color spaces for color-mix()

type color_name = Values.color_name =
  1. | Red
  2. | Blue
  3. | Green
  4. | White
  5. | Black
  6. | Yellow
  7. | Cyan
  8. | Magenta
  9. | Gray
  10. | Grey
  11. | Orange
  12. | Purple
  13. | Pink
  14. | Silver
  15. | Maroon
  16. | Fuchsia
  17. | Lime
  18. | Olive
  19. | Navy
  20. | Teal
  21. | Aqua
  22. | Alice_blue
  23. | Antique_white
  24. | Aquamarine
  25. | Azure
  26. | Beige
  27. | Bisque
  28. | Blanched_almond
  29. | Blue_violet
  30. | Brown
  31. | Burlywood
  32. | Cadet_blue
  33. | Chartreuse
  34. | Chocolate
  35. | Coral
  36. | Cornflower_blue
  37. | Cornsilk
  38. | Crimson
  39. | Dark_blue
  40. | Dark_cyan
  41. | Dark_goldenrod
  42. | Dark_gray
  43. | Dark_green
  44. | Dark_grey
  45. | Dark_khaki
  46. | Dark_magenta
  47. | Dark_olive_green
  48. | Dark_orange
  49. | Dark_orchid
  50. | Dark_red
  51. | Dark_salmon
  52. | Dark_sea_green
  53. | Dark_slate_blue
  54. | Dark_slate_gray
  55. | Dark_slate_grey
  56. | Dark_turquoise
  57. | Dark_violet
  58. | Deep_pink
  59. | Deep_sky_blue
  60. | Dim_gray
  61. | Dim_grey
  62. | Dodger_blue
  63. | Firebrick
  64. | Floral_white
  65. | Forest_green
  66. | Gainsboro
  67. | Ghost_white
  68. | Gold
  69. | Goldenrod
  70. | Green_yellow
  71. | Honeydew
  72. | Hot_pink
  73. | Indian_red
  74. | Indigo
  75. | Ivory
  76. | Khaki
  77. | Lavender
  78. | Lavender_blush
  79. | Lawn_green
  80. | Lemon_chiffon
  81. | Light_blue
  82. | Light_coral
  83. | Light_cyan
  84. | Light_goldenrod_yellow
  85. | Light_gray
  86. | Light_green
  87. | Light_grey
  88. | Light_pink
  89. | Light_salmon
  90. | Light_sea_green
  91. | Light_sky_blue
  92. | Light_slate_gray
  93. | Light_slate_grey
  94. | Light_steel_blue
  95. | Light_yellow
  96. | Lime_green
  97. | Linen
  98. | Medium_aquamarine
  99. | Medium_blue
  100. | Medium_orchid
  101. | Medium_purple
  102. | Medium_sea_green
  103. | Medium_slate_blue
  104. | Medium_spring_green
  105. | Medium_turquoise
  106. | Medium_violet_red
  107. | Midnight_blue
  108. | Mint_cream
  109. | Misty_rose
  110. | Moccasin
  111. | Navajo_white
  112. | Old_lace
  113. | Olive_drab
  114. | Orange_red
  115. | Orchid
  116. | Pale_goldenrod
  117. | Pale_green
  118. | Pale_turquoise
  119. | Pale_violet_red
  120. | Papaya_whip
  121. | Peach_puff
  122. | Peru
  123. | Plum
  124. | Powder_blue
  125. | Rebecca_purple
  126. | Rosy_brown
  127. | Royal_blue
  128. | Saddle_brown
  129. | Salmon
  130. | Sandy_brown
  131. | Sea_green
  132. | Sea_shell
  133. | Sienna
  134. | Sky_blue
  135. | Slate_blue
  136. | Slate_gray
  137. | Slate_grey
  138. | Snow
  139. | Spring_green
  140. | Steel_blue
  141. | Tan
  142. | Thistle
  143. | Tomato
  144. | Turquoise
  145. | Violet
  146. | Wheat
  147. | White_smoke
  148. | Yellow_green

CSS named colors as defined in the CSS Color Module specification.

type channel = Values.channel =
  1. | Int of int
  2. | Num of float
  3. | Pct of float
  4. | Var of channel var
  5. | None

CSS channel values (for RGB)

type rgb = Values.rgb =
  1. | Channels of {
    1. r : channel;
    2. g : channel;
    3. b : channel;
    }
  2. | Var of rgb var
type alpha = Values.alpha =
  1. | None
  2. | Num of float
  3. | Pct of float
  4. | Var of alpha var
  5. | Calc of alpha calc

CSS alpha values (for HSL/HWB/etc)

type hue = Values.hue =
  1. | Unitless of float
  2. | Angle of Values.angle
  3. | Var of hue var
  4. | Hue_none

CSS hue values (for HSL/HWB)

type component = Values.component =
  1. | Num of float
  2. | Pct of float
  3. | Angle of hue
  4. | Var of component var
  5. | Calc of component calc
  6. | Component_none

CSS color component values

type percentage = Values.percentage =
  1. | Pct of float
  2. | Num of float
  3. | Var of percentage var
  4. | Calc of percentage calc

CSS percentage values

type length_percentage = Values.length_percentage =
  1. | Length of length
  2. | Pct of float
  3. | Env of length_percentage env
  4. | Var of length_percentage var
  5. | Calc of length_percentage calc
  6. | Invalid of invalid_value
    (*

    Spec-invalid input preserved verbatim.

    *)

CSS length or percentage values.

type number_percentage = Values.number_percentage =
  1. | Num of float
  2. | Pct of float
  3. | Var of number_percentage var
  4. | Calc of number_percentage calc

CSS number or percentage values (for properties like scale, brightness)

type hue_interpolation = Values.hue_interpolation =
  1. | Shorter
  2. | Longer
  3. | Increasing
  4. | Decreasing
  5. | Specified
  6. | Default

CSS hue interpolation options

type system_color = Values.system_color =
  1. | Accent_color
    (*

    Background of accented user interface controls

    *)
  2. | Accent_color_text
    (*

    Text of accented user interface controls

    *)
  3. | Active_text
    (*

    Text of active links

    *)
  4. | Button_border
    (*

    Base border color of controls

    *)
  5. | Button_face
    (*

    Background color of controls

    *)
  6. | Button_text
    (*

    Text color of controls

    *)
  7. | Canvas
    (*

    Background of application content or documents

    *)
  8. | Canvas_text
    (*

    Text color in application content or documents

    *)
  9. | Field
    (*

    Background of input fields

    *)
  10. | Field_text
    (*

    Text in input fields

    *)
  11. | Gray_text
    (*

    Text color for disabled items

    *)
  12. | Highlight
    (*

    Background of selected items

    *)
  13. | Highlight_text
    (*

    Text color of selected items

    *)
  14. | Mark
    (*

    Background of specially marked text

    *)
  15. | Mark_text
    (*

    Text that has been specially marked

    *)
  16. | Selected_item
    (*

    Background of selected items (e.g., selected checkbox)

    *)
  17. | Selected_item_text
    (*

    Text of selected items

    *)
  18. | Visited_text
    (*

    Text of visited links

    *)
  19. | Webkit_focus_ring_color
    (*

    WebKit-specific focus ring color

    *)

CSS system colors - case-insensitive keywords that map to OS/browser colors. These are semantic colors that adapt to user preferences and system settings.

type color = Values.color =
  1. | Hex of {
    1. r : int;
    2. g : int;
    3. b : int;
    4. a : int;
    }
    (*

    Hex colour decoded to sRGB byte components (a = 255 when opaque).

    *)
  2. | Authored_hex of {
    1. value : string;
    2. r : int;
    3. g : int;
    4. b : int;
    5. a : int;
    }
    (*

    Parsed hex colour preserving the source spelling without the leading #. Optimisation folds this to the canonical semantic colour.

    *)
  3. | Rgb of rgb
  4. | Rgba of {
    1. rgb : rgb;
    2. a : alpha;
    }
  5. | Hsl of {
    1. h : hue;
    2. s : percentage;
    3. l : percentage;
    4. a : alpha;
    }
  6. | Hwb of {
    1. h : hue;
    2. w : percentage;
    3. b : percentage;
    4. a : alpha;
    }
  7. | Color of {
    1. space : color_space;
    2. components : component list;
    3. alpha : alpha;
    }
  8. | Relative_rgb of color * string
    (*

    rgb(from <origin> <channels> [/ <alpha>]?) with a parsed origin and an opaque channel-expression tail.

    *)
  9. | Relative_color of string * color * string
    (*

    <fn>(from <origin> <c1> <c2> <c3> [/ <alpha>]?) for relative color functions other than rgb().

    *)
  10. | Contrast_color of color
  11. | Light_dark of color * color
  12. | Attribute of string * color option
  13. | Lab of {
    1. l : percentage option;
    2. a : float option;
    3. b : float option;
    4. alpha : alpha;
    }
    (*

    Lab color space. l, a and b can be None to represent CSS none.

    *)
  14. | Oklch of {
    1. l : percentage option;
    2. c : float option;
    3. h : hue;
    4. alpha : alpha;
    }
    (*

    OKLCH color space. l and c can be None to represent CSS none.

    *)
  15. | Oklab of {
    1. l : percentage option;
    2. a : float option;
    3. b : float option;
    4. alpha : alpha;
    }
    (*

    Oklab color space. l, a and b can be None to represent CSS 'none' keyword.

    *)
  16. | Lch of {
    1. l : percentage option;
    2. c : float option;
    3. h : hue;
    4. alpha : alpha;
    }
    (*

    LCH color space. l and c can be None to represent CSS none.

    *)
  17. | Named of color_name
    (*

    Named colors like Red, Blue, etc.

    *)
  18. | System of system_color
    (*

    CSS system colors like Button_text, Canvas, etc.

    *)
  19. | Var of color var
  20. | Current
  21. | Transparent
  22. | Auto
    (*

    auto keyword, e.g. accent-color: auto, caret-color: auto.

    *)
  23. | Inherit
  24. | Initial
  25. | Unset
  26. | Revert
  27. | Revert_layer
  28. | Mix of {
    1. in_space : color_space option;
    2. hue : hue_interpolation;
    3. color1 : color;
    4. percent1 : percentage option;
    5. color2 : color;
    6. percent2 : percentage option;
    }

CSS color values.

Sourceval hex : string -> color

hex s is a hexadecimal color. Accepts with or without leading #. Examples: hex "#3b82f6", hex "ffffff". Raises Invalid_argument when s is not one of #rgb, #rrggbb, #rgba or #rrggbbaa; see hex_opt to decide.

Sourceval hex_opt : string -> color option

hex_opt s is hex without the exception: the colour when s is a hex spelling, and nothing otherwise.

Sourceval rgb : ?alpha:float -> int -> int -> int -> color

rgb ?alpha r g b is an RGB color (0-255 components) with optional alpha.

Sourceval hsl : float -> float -> float -> color

hsl h s l is an HSL color with h in degrees, s and l in percentages (0-100).

Sourceval hsla : float -> float -> float -> float -> color

hsla h s l a is an HSLA color with alpha in 0., 1..

Sourceval hwb : float -> float -> float -> color

hwb h w b is an HWB color with h in degrees, w and b in percentages (0-100).

Sourceval hwba : float -> float -> float -> float -> color

hwba h w b a is an HWB color with alpha in 0., 1..

Sourceval oklch : float -> float -> float -> color

oklch l c h is an OKLCH color. L in percentage (0-100), h in degrees.

Sourceval oklcha : float -> float -> float -> float -> color

oklcha l c h a is an OKLCH color with alpha in 0., 1..

Sourceval oklch_none_hue : float -> float -> color

oklch_none_hue l c is an OKLCH color whose hue is none. The hue of an achromatic color is powerless, and none keeps the component missing, so interpolation takes the other color's hue rather than 0.

Sourceval oklab : float -> float -> float -> color

oklab l a b is an OKLAB color. L in percentage (0-100).

Sourceval oklaba : float -> float -> float -> float -> color

oklaba l a b alpha is an OKLAB color with alpha in 0., 1..

Sourceval oklaba_none_zeros : float -> float -> float -> float -> color

oklaba_none_zeros l a b alpha is like oklaba but uses none for zero a/b components.

Sourceval lch : float -> float -> float -> color

lch l c h is an LCH color. L in percentage (0-100), h in degrees.

Sourceval lcha : float -> float -> float -> float -> color

lcha l c h a is an LCH color with alpha in 0., 1..

Sourceval color_name : color_name -> color

color_name n is a named color as defined in the CSS Color specification.

Sourceval current_color : color

current_color is the CSS currentcolor value.

Sourceval transparent : color

transparent is the CSS transparent value.

Sourceval color_mix : ?in_space:color_space -> ?hue:hue_interpolation -> ?percent1:float -> ?percent2:float -> color -> color -> color

color_mix ?in_space ?percent1 ?percent2 c1 c2 is a color-mix value. Defaults: in_space = Srgb, percent1 = None, percent2 = None.

Sourceval color_mix_var_percent : ?in_space:color_space -> ?hue:hue_interpolation -> var_name:string -> color -> color -> color

color_mix_var_percent ?in_space ?hue ~var_name c1 c2 is like color_mix but uses a CSS var reference for the first percentage.

Sourceval color_mix_var_pct_fallback : ?in_space:color_space -> ?hue:hue_interpolation -> var_name:string -> fallback:percentage fallback -> color -> color -> color

color_mix_var_pct_fallback ?in_space ?hue ~var_name ~fallback c1 c2 is like color_mix_var_percent but with an explicit fallback on the percentage variable. Used for named opacity modifiers.

type angle = Values.angle =
  1. | Deg of float
  2. | Rad of float
  3. | Turn of float
  4. | Grad of float
  5. | Round of string * angle * angle
  6. | Mod of angle * angle
  7. | Rem of angle * angle
  8. | Calc of angle calc
    (*

    Calculated angle expressions

    *)
  9. | Var of angle var
  10. | Invalid of invalid_value
    (*

    Spec-invalid input the parser keeps verbatim; Optimize.drop_invalid drops the declaration on every serialisation.

    *)

CSS angle values

type number = Values.number =
  1. | Num of float
    (*

    Number value

    *)
  2. | Var of number var
    (*

    CSS variable reference

    *)
  3. | Calc of number calc
  4. | Round of string * number * number
    (*

    CSS round() math function

    *)
  5. | Mod of number * number
    (*

    CSS mod() math function

    *)
  6. | Rem of number * number
    (*

    CSS rem() math function

    *)
  7. | Hypot of number * number
    (*

    CSS hypot() math function

    *)
  8. | Pow of number * number
    (*

    CSS pow() math function

    *)
  9. | Sqrt of number
    (*

    CSS sqrt() math function

    *)
  10. | Abs of number
    (*

    CSS abs() math function

    *)
  11. | Sign of number
    (*

    CSS sign() math function

    *)
  12. | Sin of angle
    (*

    CSS sin() math function

    *)

CSS number values (unitless numbers for filters, transforms, etc.)

type aspect_ratio = Properties.aspect_ratio =
  1. | Auto
  2. | Auto_ratio of float * float
  3. | Ratio of float * float
  4. | Auto_ratio_calc of number * number
  5. | Ratio_calc of number * number
  6. | Inherit
  7. | Initial
  8. | Unset
  9. | Revert
  10. | Revert_layer
  11. | Var of aspect_ratio var

CSS aspect-ratio values

Sourceval ratio : float -> float -> aspect_ratio

ratio width height is an aspect-ratio value such as 16 / 9.

Sourceval auto_ratio : float -> float -> aspect_ratio

auto_ratio width height is an aspect-ratio value such as auto 16 / 9.

type blend_mode = Properties.blend_mode =
  1. | Normal
  2. | Multiply
  3. | Screen
  4. | Overlay
  5. | Darken
  6. | Lighten
  7. | Color_dodge
  8. | Color_burn
  9. | Hard_light
  10. | Soft_light
  11. | Difference
  12. | Exclusion
  13. | Hue
  14. | Saturation
  15. | Color
  16. | Luminosity
  17. | Plus_darker
  18. | Plus_lighter
  19. | Inherit
  20. | Initial
  21. | Unset
  22. | Revert
  23. | Revert_layer
  24. | Var of blend_mode var

CSS blend-mode values

type font_feature_value = Properties.font_feature_value =
  1. | On
  2. | Off
  3. | Index of int

The optional value paired with an OpenType feature tag.

type font_feature_setting = Properties.font_feature_setting = {
  1. tag : string;
  2. value : font_feature_value option;
}

One OpenType feature tag and its optional value.

type font_feature_settings = Properties.font_feature_settings =
  1. | Normal
  2. | Feature_list of font_feature_setting list
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of font_feature_settings var

CSS font-feature-settings values.

type font_variation_setting = Properties.font_variation_setting = {
  1. tag : string;
  2. value : float;
}

One OpenType variation axis and its numeric value.

type font_variation_settings = Properties.font_variation_settings =
  1. | Normal
  2. | Axis_list of font_variation_setting list
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of font_variation_settings var

CSS font-variation-settings values.

Sourceval important : declaration -> declaration

important decl is decl marked as !important.

Sourceval declaration_is_important : declaration -> bool

declaration_is_important decl returns true if decl has the !important flag.

Sourceval declaration_name : declaration -> string

declaration_name decl returns the property name of decl.

Sourceval declaration_value : ?minify:bool -> ?inline:bool -> declaration -> string

declaration_value ~minify ~inline decl returns the value of decl as a string. If minify is true (default: false), the output is minified. If inline is true (default: false), variables are resolved to their default values.

Sourceval declaration_value_for_equivalence : declaration -> string

declaration_value_for_equivalence decl is the minified value of decl, so a structural diff keys a typed property on its shortest spelling and padding: 0.50px and padding: .5px compare equal.

A custom-property token stream, whose bytes declaration_value keeps verbatim, also loses the whitespace CSS reads as nothing: the whitespace CSS Values 4 (ED) sec. 10.8 leaves optional around a math * and /, and the whitespace a closing bracket already accounts for. So --r: 16 / 9 and --r: 16/9 compare equal, while the space sec. 10.8 requires around a math + or -, and the space beside a var(), env() or attr() that sec. 2.5 substitutes textually into its neighbour, keep two spellings apart.

A quoted family name in that stream is rewritten as the equivalent unquoted <ident> sequence, one word or several, when a generic family in the stream proves the stream is a font-family list, where CSS Fonts 4 sec. 2.1.1 spells the one name both ways: --font: ui-sans-serif,"Noto Color Emoji" and --font: ui-sans-serif,Noto Color Emoji compare equal, as do --font: "Arial",sans-serif and --font: Arial,sans-serif. Without that proof the stream is arbitrary tokens, in which one <string> is not an <ident> sequence, and the two spellings keep distinct keys.

Not for emission, where every one of these forms stays verbatim.

Property Categories

CSS properties organized by functionality and usage patterns.

Box Model & Sizing

The CSS Box Model defines how element dimensions are calculated and how space is distributed around content. This includes width/height properties, padding, margins, and box sizing behavior.

type box_sizing = Properties.box_sizing =
  1. | Border_box
  2. | Content_box
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of box_sizing var

CSS box sizing values.

type field_sizing = Properties.field_sizing =
  1. | Content
  2. | Fixed
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of field_sizing var

CSS field sizing values.

type caption_side = Properties.caption_side =
  1. | Top
  2. | Bottom
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of caption_side var

CSS caption side values.

Sourceval width : length -> declaration

width len is the width property.

Sourceval height : length -> declaration

height len is the height property.

Sourceval min_width : length -> declaration

min_width len is the min-width property.

Sourceval max_width : length -> declaration

max_width len is the max-width property.

Sourceval min_height : length -> declaration

min_height len is the min-height property.

Sourceval max_height : length -> declaration

max_height len is the max-height property.

Sourceval inline_size : length -> declaration

inline_size len is the inline-size logical property.

Sourceval min_inline_size : length -> declaration

min_inline_size len is the min-inline-size logical property.

Sourceval max_inline_size : length -> declaration

max_inline_size len is the max-inline-size logical property.

Sourceval block_size : length -> declaration

block_size len is the block-size logical property.

Sourceval min_block_size : length -> declaration

min_block_size len is the min-block-size logical property.

Sourceval max_block_size : length -> declaration

max_block_size len is the max-block-size logical property.

Sourceval padding : length list -> declaration

padding values is the padding shorthand property. Accepts 1-4 values.

Sourceval padding_top : length -> declaration

padding_top len is the padding-top property.

Sourceval padding_right : length -> declaration

padding_right len is the padding-right property.

Sourceval padding_bottom : length -> declaration

padding_bottom len is the padding-bottom property.

Sourceval padding_left : length -> declaration

padding_left len is the padding-left property.

Sourceval margin : length list -> declaration

margin values is the margin shorthand property. Accepts 1-4 values.

Sourceval margin_top : length -> declaration

margin_top len is the margin-top property.

Sourceval margin_right : length -> declaration

margin_right len is the margin-right property.

Sourceval margin_bottom : length -> declaration

margin_bottom len is the margin-bottom property.

Sourceval margin_left : length -> declaration

margin_left len is the margin-left property.

Sourceval box_sizing : box_sizing -> declaration

box_sizing sizing is the box-sizing property.

Sourceval field_sizing : field_sizing -> declaration

field_sizing sizing is the field-sizing property.

Sourceval caption_side : caption_side -> declaration

caption_side side is the caption-side property.

Sourceval aspect_ratio : aspect_ratio -> declaration

aspect_ratio ratio is the aspect-ratio property.

Logical Properties

CSS Logical Properties provide writing-mode-relative property equivalents for physical properties. These adapt to different writing directions and text orientations.

type border_width = Properties.border_width =
  1. | Thin
  2. | Medium
  3. | Thick
  4. | Px of float
  5. | Cm of float
  6. | Mm of float
  7. | Q of float
  8. | In of float
  9. | Pt of float
  10. | Pc of float
  11. | Rem of float
  12. | Em of float
  13. | Ex of float
  14. | Cap of float
  15. | Ic of float
  16. | Ric of float
  17. | Rlh of float
  18. | Ch of float
  19. | Lh of float
  20. | Vh of float
  21. | Vw of float
  22. | Vmin of float
  23. | Vmax of float
  24. | Pct of float
  25. | Dimension of {
    1. value : float;
    2. unit : string;
    3. repr : string;
    }
    (*

    A length in a unit border_width does not name, carrying the authored spelling in repr the way length does.

    *)
  26. | Zero
  27. | Auto
  28. | Max_content
  29. | Min_content
  30. | Fit_content
  31. | From_font
  32. | Calc of border_width calc
  33. | Min of border_width calc list
  34. | Max of border_width calc list
  35. | Clamp of border_width calc * border_width calc * border_width calc
  36. | Inherit
  37. | Initial
  38. | Unset
  39. | Revert
  40. | Revert_layer
  41. | Var of border_width var
Sourceval border_inline_start_width : border_width -> declaration

border_inline_start_width len is the border-inline-start-width property.

Sourceval border_inline_end_width : border_width -> declaration

border_inline_end_width len is the border-inline-end-width property.

Sourceval border_block_start_width : border_width -> declaration

border_block_start_width len is the border-block-start-width property.

Sourceval border_block_end_width : border_width -> declaration

border_block_end_width len is the border-block-end-width property.

Sourceval border_inline_start_color : color -> declaration

border_inline_start_color c is the border-inline-start-color property.

Sourceval border_inline_end_color : color -> declaration

border_inline_end_color c is the border-inline-end-color property.

Sourceval border_block_start_color : color -> declaration

border_block_start_color c is the border-block-start-color property.

Sourceval border_block_end_color : color -> declaration

border_block_end_color c is the border-block-end-color property.

Sourceval padding_inline_start : length -> declaration

padding_inline_start len is the padding-inline-start property.

Sourceval padding_inline_end : length -> declaration

padding_inline_end len is the padding-inline-end property.

Sourceval padding_inline : length list -> declaration

padding_inline lens is the padding-inline shorthand property.

Sourceval padding_block : length list -> declaration

padding_block lens is the padding-block shorthand property.

Sourceval padding_block_start : length -> declaration

padding_block_start len is the padding-block-start property.

Sourceval padding_block_end : length -> declaration

padding_block_end len is the padding-block-end property.

Sourceval margin_inline : length -> declaration

margin_inline len is the margin-inline property with a length value.

Sourceval margin_inline_start : length -> declaration

margin_inline_start len is the margin-inline-start property.

Sourceval margin_inline_end : length -> declaration

margin_inline_end len is the margin-inline-end property.

Sourceval margin_block : length -> declaration

margin_block len is the margin-block property with a length value.

Sourceval margin_block_start : length -> declaration

margin_block_start len is the margin-block-start property.

Sourceval margin_block_end : length -> declaration

margin_block_end len is the margin-block-end property.

Display & Positioning

Controls how elements are displayed and positioned in the document flow. This includes the display model, positioning schemes, and stacking context.

type display = Properties.display =
  1. | Block
  2. | Inline
  3. | Inline_block
  4. | Flex
  5. | Inline_flex
  6. | Grid
  7. | Inline_grid
  8. | Grid_lanes
  9. | Inline_grid_lanes
  10. | None
  11. | Flow_root
  12. | Table
  13. | Table_row
  14. | Table_cell
  15. | Table_caption
  16. | Table_column
  17. | Table_column_group
  18. | Table_header_group
  19. | Table_row_group
  20. | Inline_table
  21. | List_item
  22. | Contents
  23. | Run_in
  24. | Ruby
  25. | Ruby_base
  26. | Ruby_text
  27. | Ruby_base_container
  28. | Ruby_text_container
  29. | Math
  30. | Webkit_flex
  31. | Webkit_inline_flex
  32. | Ms_flexbox
  33. | Webkit_box
  34. | Moz_box
  35. | Moz_inline_box
  36. | Inherit
  37. | Initial
  38. | Unset
  39. | Revert
  40. | Revert_layer
  41. | Multi of display * display
    (*

    Two-value <display-outside> <display-inside> syntax per CSS Display 3 sec. 2.1, e.g. inline flow-root or list-item flow-root.

    *)
  42. | Var of display var

CSS display values.

type position = Properties.position =
  1. | Static
  2. | Relative
  3. | Absolute
  4. | Fixed
  5. | Sticky
  6. | Webkit_sticky
  7. | Initial
  8. | Inherit
  9. | Unset
  10. | Revert
  11. | Revert_layer
  12. | Var of position var

CSS position values.

type visibility = Properties.visibility =
  1. | Visible
  2. | Hidden
  3. | Collapse
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of visibility var

CSS visibility values.

type z_index = Properties.z_index =
  1. | Auto
  2. | Index of int
  3. | Calc of z_index calc
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of z_index var

CSS z-index values.

type opacity = Properties.opacity =
  1. | Opacity_number of float
  2. | Calc of opacity calc
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of opacity var

CSS opacity values.

type order = Properties.order =
  1. | Int of int
  2. | Calc of order calc
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of order var

CSS order values (flexbox order).

type overflow = Properties.overflow =
  1. | Visible
  2. | Hidden
  3. | Scroll
  4. | Auto
  5. | Clip
  6. | Initial
  7. | Inherit
  8. | Unset
  9. | Revert
  10. | Revert_layer
  11. | Overflow_pair of overflow * overflow
  12. | Var of overflow var

CSS overflow values.

type border_spacing = Properties.border_spacing =
  1. | Lengths of length list
  2. | Var of border_spacing var
Sourceval display : display -> declaration

display d is the display property.

Sourceval position : position -> declaration

position p is the position property.

Sourceval inset : length list -> declaration

inset len is the inset property for positioned elements.

Sourceval inset_inline : length list -> declaration

inset_inline len is the inset-inline logical property.

Sourceval inset_inline_start : length -> declaration

inset_inline_start len is the inset-inline-start logical property.

Sourceval inset_inline_end : length -> declaration

inset_inline_end len is the inset-inline-end logical property.

Sourceval inset_block : length list -> declaration

inset_block len is the inset-block logical property.

Sourceval inset_block_start : length -> declaration

inset_block_start len is the inset-block-start logical property.

Sourceval inset_block_end : length -> declaration

inset_block_end len is the inset-block-end logical property.

top len is the top property for positioned elements.

Sourceval right : length -> declaration

right len is the right property for positioned elements.

Sourceval bottom : length -> declaration

bottom len is the bottom property for positioned elements.

left len is the left property for positioned elements.

Sourceval z_index : z_index -> declaration

z_index z is the z-index property.

Sourceval z_index_auto : declaration

z_index_auto is the z-index property set to auto.

type isolation = Properties.isolation =
  1. | Auto
  2. | Isolate
  3. | Initial
  4. | Inherit
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of isolation var

CSS isolation values

Sourceval isolation : isolation -> declaration

isolation iso is the isolation property for stacking context control.

type break_value = Properties.break_value =
  1. | Auto
  2. | Avoid
  3. | All
  4. | Avoid_page
  5. | Page
  6. | Left
  7. | Right
  8. | Recto
  9. | Verso
  10. | Avoid_column
  11. | Column
  12. | Avoid_region
  13. | Region
  14. | Initial
  15. | Inherit
  16. | Unset
  17. | Revert
  18. | Revert_layer
  19. | Var of break_value var

CSS break-before/break-after values for page/column/region breaks.

Sourceval break_before : break_value -> declaration

break_before v is the break-before property.

Sourceval break_after : break_value -> declaration

break_after v is the break-after property.

type break_inside_value = Properties.break_inside_value =
  1. | Auto
  2. | Avoid
  3. | Avoid_page
  4. | Avoid_column
  5. | Initial
  6. | Inherit
  7. | Unset
  8. | Revert
  9. | Revert_layer
  10. | Var of break_inside_value var

CSS break-inside values.

break_inside v is the break-inside property.

type page_break_value = Properties.page_break_value =
  1. | Auto
  2. | Always
  3. | Avoid
  4. | Left
  5. | Right
  6. | Initial
  7. | Inherit
  8. | Unset
  9. | Revert
  10. | Revert_layer
  11. | Var of page_break_value var
    (*

    CSS Fragmentation 3 sec. 3.4 deprecated page-break-inside vocabulary.

    *)

CSS Fragmentation 3 sec. 3.4 deprecated page-break-before / -after alias vocabulary; the shorter value list makes these their own type rather than overload break_value.

type page_break_inside_value = Properties.page_break_inside_value =
  1. | Auto
  2. | Avoid
  3. | Initial
  4. | Inherit
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of page_break_inside_value var
Sourceval page_break_before : page_break_value -> declaration

page_break_before v is the legacy page-break-before property.

Sourceval page_break_after : page_break_value -> declaration

page_break_after v is the legacy page-break-after property.

Sourceval page_break_inside : page_break_inside_value -> declaration

page_break_inside v is the legacy page-break-inside property.

type page_size_name = Properties.page_size_name =
  1. | A5
  2. | A4
  3. | A3
  4. | B5
  5. | B4
  6. | Jis_b5
  7. | Jis_b4
  8. | Letter
  9. | Legal
  10. | Ledger
  11. | Var of page_size_name var
type page_size_orientation = Properties.page_size_orientation =
  1. | Portrait
  2. | Landscape
  3. | Var of page_size_orientation var
type page_size = Properties.page_size =
  1. | Auto
  2. | Single of length
  3. | Pair of length * length
  4. | Named of page_size_name
  5. | Named_oriented of page_size_name * page_size_orientation
  6. | Oriented of page_size_orientation
  7. | Initial
  8. | Inherit
  9. | Unset
  10. | Revert
  11. | Revert_layer
  12. | Var of page_size var

CSS paged-media size descriptor values.

type columns_value = Properties.columns_value =
  1. | Auto
  2. | Count of int
  3. | Width of length
  4. | Both of length * int
  5. | Auto_count of int
  6. | Count_calc of columns_value calc
    (*

    A count given as a math function, with no width beside it

    *)
  7. | Inherit
  8. | Initial
  9. | Unset
  10. | Revert
  11. | Revert_layer
  12. | Var of columns_value var

CSS columns values for multi-column layout.

Sourceval columns_count : int -> columns_value

columns_count count is a column-count value for the columns shorthand.

Sourceval columns_width : length -> columns_value

columns_width width is a column-width value for the columns shorthand.

Sourceval columns_both : length -> int -> columns_value

columns_both width count is a combined columns shorthand value.

type column_span = Properties.column_span =
  1. | None
  2. | All
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of column_span var

columns v is the columns property for multi-column layout.

Sourceval column_span : column_span -> declaration

column_span v is the column-span property.

type column_width = Properties.column_width =
  1. | Auto
  2. | Width of length
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of column_width var

CSS Multicol 2 column-width: auto | <length [0,inf]>.

Sourceval column_width : column_width -> declaration

column_width v is the column-width longhand of columns.

type column_count = Properties.column_count =
  1. | Auto
  2. | Count of int
  3. | Calc of column_count calc
    (*

    A math function answering an <integer>

    *)
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of column_count var

CSS Multicol 2 column-count: auto | <integer [1,inf]>.

Sourceval column_count : column_count -> declaration

column_count v is the column-count longhand of columns.

type column_height = Properties.column_height =
  1. | Auto
  2. | Height of length
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of column_height var

CSS Multicol 2 column-height: auto | <length [0,inf]>.

Sourceval column_height : column_height -> declaration

column_height v is the column-height property.

type column_wrap = Properties.column_wrap =
  1. | Auto
  2. | Nowrap
  3. | Wrap
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of column_wrap var

CSS Multicol 2 column-wrap: auto | nowrap | wrap.

Sourceval column_wrap : column_wrap -> declaration

column_wrap v is the column-wrap property.

Sourceval visibility : visibility -> declaration

visibility v is the visibility property.

type float_side = Properties.float_side =
  1. | None
  2. | Left
  3. | Right
  4. | Inline_start
  5. | Inline_end
  6. | Initial
  7. | Inherit
  8. | Unset
  9. | Revert
  10. | Revert_layer
  11. | Var of float_side var

CSS float side values.

float side is the float property.

type clear = Properties.clear =
  1. | None
  2. | Left
  3. | Right
  4. | Both
  5. | Inline_start
  6. | Inline_end
  7. | Initial
  8. | Inherit
  9. | Unset
  10. | Revert
  11. | Revert_layer
  12. | Var of clear var

CSS clear values.

Sourceval clear : clear -> declaration

clear clr is the clear property.

Sourceval overflow : overflow -> declaration

overflow ov is the overflow property.

Sourceval overflow_x : overflow -> declaration

overflow_x ov is the overflow-x property.

Sourceval overflow_y : overflow -> declaration

overflow_y ov is the overflow-y property.

type content = Properties.content =
  1. | String of string
  2. | Quoted of {
    1. value : string;
    2. quote : char;
    3. repr : string option;
    }
  3. | Image of Properties.background_image
    (*

    The <image> of background_image, aliased below.

    *)
  4. | None
  5. | Normal
  6. | Open_quote
  7. | Close_quote
  8. | Attr of content attr_call
  9. | Counter of string
  10. | Counters of string * string
  11. | String_ref of string
  12. | Content_list of content list
  13. | Inherit
  14. | Initial
  15. | Unset
  16. | Revert
  17. | Revert_layer
  18. | Var of content var

CSS content values

Sourceval content_string : string -> content

content_string value is a quoted string content item.

Sourceval content_attr : string -> content

content_attr name is an attr(name) content item.

Sourceval content_counter : string -> content

content_counter name is a counter(name) content item.

Sourceval content_counters : string -> string -> content

content_counters name separator is a counters(name, separator) content item.

Sourceval content_list : content list -> content

content_list items is a space-separated content value.

type counter_item = Properties.counter_item = {
  1. name : string;
  2. value : int option;
}
Sourceval counter_item : ?value:int -> string -> counter_item

counter_item ?value name is one named counter item.

type counter_set = Properties.counter_set =
  1. | None
  2. | Counters of counter_item list
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of counter_set var
Sourceval counter_set : counter_item list -> counter_set

counter_set items is a counter-reset/increment/set list.

Sourceval content : content -> declaration

content c is the content property.

Sourceval counter_reset : counter_set -> declaration

counter_reset c is the CSS counter-reset property.

Sourceval counter_increment : counter_set -> declaration

counter_increment c is the CSS counter-increment property.

type object_fit = Properties.object_fit =
  1. | Fill
  2. | Contain
  3. | Cover
  4. | None
  5. | Scale_down
  6. | Inherit
  7. | Initial
  8. | Unset
  9. | Revert
  10. | Revert_layer
  11. | Var of object_fit var

CSS object-fit values

Sourceval object_fit : object_fit -> declaration

object_fit fit is the object-fit property.

type position_value = Properties.position_value =
  1. | Center
  2. | Top
  3. | Bottom
  4. | Left
  5. | Right
  6. | Left_top
  7. | Left_center
  8. | Left_bottom
  9. | Right_top
  10. | Right_center
  11. | Right_bottom
  12. | Center_top
  13. | Center_bottom
  14. | Top_left
  15. | Top_right
  16. | Bottom_left
  17. | Bottom_right
  18. | XY of length * length
  19. | Single of length
    (*

    Single length/percentage value for background-position

    *)
  20. | Inherit
  21. | Initial
  22. | Unset
  23. | Revert
  24. | Revert_layer
  25. | Edge_offset_axis of string * length_percentage * string
  26. | Axis_edge_offset of string * string * length_percentage
  27. | Edge_offset_edge_offset of string * length_percentage * string * length_percentage
  28. | Var of position_value var
Sourceval object_position : position_value -> declaration

object_position pos is the object-position property.

type text_overflow = Properties.text_overflow =
  1. | Clip
  2. | Ellipsis
  3. | String of string
  4. | Pair of text_overflow * text_overflow
  5. | Inherit
  6. | Initial
  7. | Unset
  8. | Revert
  9. | Revert_layer
  10. | Var of text_overflow var

CSS text-overflow values

Sourceval position_xy : length -> length -> position_value

position_xy x y is a two-axis position value.

Sourceval position_length : length -> position_value

position_length value is a one-value position.

Sourceval text_overflow_string : string -> text_overflow

text_overflow_string value is a custom text-overflow marker.

Sourceval text_overflow_pair : text_overflow -> text_overflow -> text_overflow

text_overflow_pair start end_ is the two-value text-overflow form.

Sourceval text_overflow : text_overflow -> declaration

text_overflow ov is the text-overflow property.

type text_wrap = Properties.text_wrap =
  1. | Wrap
  2. | No_wrap
  3. | Auto
  4. | Balance
  5. | Stable
  6. | Pretty
  7. | Mode_style of [ `Wrap | `No_wrap ] * [ `Auto | `Balance | `Stable | `Pretty ]
    (*

    both components, printed mode-first

    *)
  8. | Inherit
  9. | Initial
  10. | Unset
  11. | Revert
  12. | Revert_layer
  13. | Var of text_wrap var

CSS text-wrap values

type text_wrap_mode = Properties.text_wrap_mode =
  1. | Wrap
  2. | No_wrap
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of text_wrap_mode var
type text_wrap_style = Properties.text_wrap_style =
  1. | Auto
  2. | Balance
  3. | Pretty
  4. | Stable
  5. | Inherit
  6. | Initial
  7. | Unset
  8. | Revert
  9. | Revert_layer
  10. | Var of text_wrap_style var
type text_box_trim = Properties.text_box_trim =
  1. | None
  2. | Trim_start
  3. | Trim_end
  4. | Trim_both
  5. | Inherit
  6. | Initial
  7. | Unset
  8. | Revert
  9. | Revert_layer
  10. | Var of text_box_trim var
type text_underline_position_keyword = Properties.text_underline_position_keyword =
  1. | Under
  2. | Left
  3. | Right
type text_underline_position = Properties.text_underline_position =
  1. | Auto
  2. | From_font
  3. | Position of text_underline_position_keyword list
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of text_underline_position var
type text_box_edge_keyword = Properties.text_box_edge_keyword =
  1. | Text
  2. | Cap
  3. | Ex
  4. | Alphabetic
  5. | Ideographic
  6. | Ideographic_ink
type text_box_edge = Properties.text_box_edge =
  1. | Auto
  2. | Edge of text_box_edge_keyword * text_box_edge_keyword option
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of text_box_edge var
type inline_sizing = Properties.inline_sizing =
  1. | Normal
  2. | Stretch
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of inline_sizing var
type line_fit_edge_keyword = Properties.line_fit_edge_keyword =
  1. | Leading
  2. | Text
  3. | Cap
  4. | Ex
  5. | Alphabetic
  6. | Ideographic
  7. | Ideographic_ink
type line_fit_edge = Properties.line_fit_edge =
  1. | Edge of line_fit_edge_keyword * line_fit_edge_keyword option
  2. | Inherit
  3. | Initial
  4. | Unset
  5. | Revert
  6. | Revert_layer
  7. | Var of line_fit_edge var
type interpolate_size = Properties.interpolate_size =
  1. | Numeric_only
  2. | Allow_keywords
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of interpolate_size var
type min_intrinsic_sizing_keyword = Properties.min_intrinsic_sizing_keyword =
  1. | Legacy
  2. | Zero_if_scroll
  3. | Zero_if_extrinsic
type min_intrinsic_sizing = Properties.min_intrinsic_sizing =
  1. | Sizing of min_intrinsic_sizing_keyword list
  2. | Inherit
  3. | Initial
  4. | Unset
  5. | Revert
  6. | Revert_layer
  7. | Var of min_intrinsic_sizing var
type ruby_merge = Properties.ruby_merge =
  1. | Separate
  2. | Merge
  3. | Auto
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of ruby_merge var
type ruby_align = Properties.ruby_align =
  1. | Start
  2. | Center
  3. | Space_between
  4. | Space_around
  5. | Inherit
  6. | Initial
  7. | Unset
  8. | Revert
  9. | Revert_layer
  10. | Var of ruby_align var
type ruby_overhang = Properties.ruby_overhang =
  1. | Auto
  2. | Spaces
  3. | None
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of ruby_overhang var
type ruby_position_keyword = Properties.ruby_position_keyword =
  1. | Alternate
  2. | Over
  3. | Under
  4. | Inter_character
type ruby_position = Properties.ruby_position =
  1. | Position of ruby_position_keyword list
  2. | Inherit
  3. | Initial
  4. | Unset
  5. | Revert
  6. | Revert_layer
  7. | Var of ruby_position var
type text_spacing_trim = Properties.text_spacing_trim =
  1. | Normal
  2. | Space_all
  3. | Trim_start
  4. | Space_first
  5. | Inherit
  6. | Initial
  7. | Unset
  8. | Revert
  9. | Revert_layer
  10. | Var of text_spacing_trim var
type hyphenate_limit_chars_item = Properties.hyphenate_limit_chars_item =
  1. | Auto
  2. | Chars of number
type initial_letter = Properties.initial_letter =
  1. | Normal
  2. | Drop
  3. | Raise
  4. | Size of float
  5. | Size_sink of float * int
  6. | Calc of initial_letter calc * int option
    (*

    A math function in the size slot

    *)
  7. | Inherit
  8. | Initial
  9. | Unset
  10. | Revert
  11. | Revert_layer
  12. | Var of initial_letter var
Sourceval text_wrap : text_wrap -> declaration

text_wrap wrap is the text-wrap property.

Sourceval text_wrap_mode : text_wrap_mode -> declaration

text_wrap_mode wrap is the CSS text-wrap-mode property.

Sourceval text_underline_position : text_underline_position -> declaration

text_underline_position position is the CSS text-underline-position property.

Sourceval text_box_edge : text_box_edge -> declaration

text_box_edge edge is the CSS text-box-edge property.

Sourceval inline_sizing : inline_sizing -> declaration

inline_sizing sizing is the CSS inline-sizing property.

Sourceval line_fit_edge : line_fit_edge -> declaration

line_fit_edge edge is the CSS line-fit-edge property.

Sourceval interpolate_size : interpolate_size -> declaration

interpolate_size sizing is the CSS interpolate-size property.

Sourceval min_intrinsic_sizing : min_intrinsic_sizing -> declaration

min_intrinsic_sizing sizing is the CSS min-intrinsic-sizing property.

Sourceval ruby_align : ruby_align -> declaration

ruby_align align is the CSS ruby-align property.

Sourceval ruby_merge : ruby_merge -> declaration

ruby_merge merge is the CSS ruby-merge property.

Sourceval ruby_overhang : ruby_overhang -> declaration

ruby_overhang overhang is the CSS ruby-overhang property.

Sourceval ruby_position : ruby_position -> declaration

ruby_position position is the CSS ruby-position property.

type backface_visibility = Properties.backface_visibility =
  1. | Visible
  2. | Hidden
  3. | Initial
  4. | Inherit
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of backface_visibility var

CSS backface-visibility values

Sourceval backface_visibility : backface_visibility -> declaration

backface_visibility vis is the backface-visibility property (3D transforms).

type content_visibility = Properties.content_visibility =
  1. | Visible
    (*

    Content is visible and rendered

    *)
  2. | Hidden
    (*

    Content is hidden from rendering

    *)
  3. | Auto
    (*

    Browser determines visibility based on relevance

    *)
  4. | Initial
  5. | Inherit
    (*

    Inherit from parent

    *)
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of content_visibility var

CSS content-visibility values.

Sourceval content_visibility : content_visibility -> declaration

content_visibility vis is the content-visibility property.

type quotes = Properties.quotes =
  1. | Auto
    (*

    Browser default based on language

    *)
  2. | None
    (*

    No quotation marks

    *)
  3. | Pairs of (string * string) list
    (*

    One or more open/close quote pairs

    *)
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of quotes var

CSS quotes property values - defines quotation marks for q and blockquote.

Sourceval quotes : quotes -> declaration

quotes q is the quotes property.

type list_style_position = Properties.list_style_position =
  1. | Inside
  2. | Outside
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of list_style_position var

CSS list-style-position values

Sourceval list_style_position : list_style_position -> declaration

list_style_position pos is the list-style-position property.

Colors & Backgrounds

Properties for controlling foreground colors, background colors, images, and related visual styling for element backgrounds.

type forced_color_adjust = Properties.forced_color_adjust =
  1. | Auto
  2. | None
  3. | Preserve_parent_color
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of forced_color_adjust var

CSS forced-color-adjust values.

type background_repeat = Properties.background_repeat =
  1. | Repeat
  2. | Space
  3. | Round
  4. | No_repeat
  5. | Repeat_x
  6. | Repeat_y
  7. | Layers of background_repeat list
  8. | Repeat_repeat
  9. | Repeat_space
  10. | Repeat_round
  11. | Repeat_no_repeat
  12. | Space_repeat
  13. | Space_space
  14. | Space_round
  15. | Space_no_repeat
  16. | Round_repeat
  17. | Round_space
  18. | Round_round
  19. | Round_no_repeat
  20. | No_repeat_repeat
  21. | No_repeat_space
  22. | No_repeat_round
  23. | No_repeat_no_repeat
  24. | Inherit
  25. | Initial
  26. | Unset
  27. | Revert
  28. | Revert_layer
  29. | Var of background_repeat var

CSS background-repeat values.

type background_size = Properties.background_size =
  1. | Auto
  2. | Cover
  3. | Contain
  4. | Length of length
  5. | Size of length * length
  6. | Layers of background_size list
  7. | Inherit
  8. | Initial
  9. | Unset
  10. | Revert
  11. | Revert_layer
  12. | Var of background_size var

CSS background-size values.

Sourceval background_size_pair : length -> length -> background_size

background_size_pair width height is a two-value background-size.

type background_attachment = Properties.background_attachment =
  1. | Scroll
  2. | Fixed
  3. | Local
  4. | Layers of background_attachment list
  5. | Initial
  6. | Inherit
  7. | Unset
  8. | Revert
  9. | Revert_layer
  10. | Var of background_attachment var

CSS background-attachment values.

type hue_interpolation_method = Properties.hue_interpolation_method =
  1. | Shorter
  2. | Longer
  3. | Increasing
  4. | Decreasing

CSS Color 5 section 9.1: hue-interpolation method for polar color spaces (lch / oklch / hsl / hwb).

type color_interpolation = Properties.color_interpolation =
  1. | In of color_space * hue_interpolation_method option
  2. | Var of color_interpolation var

Colour interpolation for gradients. CSS Color 5 sec. 9 spells one <color-interpolation-method> wherever one appears, over the same fifteen spaces color-mix() takes, so the space is carried rather than named in a constructor of its own. Sec. 9.1 puts the <hue-interpolation-method> after a polar space only.

type gradient_direction = Properties.gradient_direction =
  1. | Default_direction
  2. | To_top
  3. | To_top_right
  4. | To_right
  5. | To_bottom_right
  6. | To_bottom
  7. | To_bottom_left
  8. | To_left
  9. | To_top_left
  10. | Angle of angle
  11. | With_interpolation of gradient_direction * color_interpolation
  12. | Var of gradient_direction var

Gradient direction values

type radial_shape = Properties.radial_shape =
  1. | Circle
  2. | Ellipse
  3. | Var of radial_shape var

Shape of a radial gradient

type radial_size = Properties.radial_size =
  1. | Closest_side
  2. | Farthest_side
  3. | Closest_corner
  4. | Farthest_corner
  5. | Circle_radius of length
  6. | Ellipse_radii of length_percentage * length_percentage
  7. | Var of radial_size var

Size of a radial gradient

type radial_gradient_config = Properties.radial_gradient_config = {
  1. shape : radial_shape option;
  2. size : radial_size option;
  3. position : position_value option;
  4. interpolation : color_interpolation option;
}

Configuration for radial-gradient prefix: shape, size, position, and optional in <color-interpolation-method> clause.

type conic_gradient_config = Properties.conic_gradient_config = {
  1. angle : angle option;
    (*

    from <angle> starting angle

    *)
  2. position : position_value option;
    (*

    at <position> center

    *)
  3. interpolation : color_interpolation option;
    (*

    Optional in <color-interpolation-method> clause.

    *)
}

Configuration for conic-gradient prefix: starting angle, center, and optional in <color-interpolation-method> clause.

type gradient_position = Properties.gradient_position =
  1. | Linear_position of gradient_direction
  2. | Radial_position of radial_gradient_config
  3. | Conic_position of conic_gradient_config
  4. | Var of gradient_position var
type gradient_stop = Properties.gradient_stop =
  1. | Color_percentage of color * length_percentage option * length_percentage option
    (*

    Color with optional percentage positions

    *)
  2. | Color_length of color * length option * length option
    (*

    Color with optional length positions

    *)
  3. | Length of length
    (*

    Interpolation hint with length, e.g., "50px"

    *)
  4. | Channel of channel
    (*

    Residual numeric channel token from custom-property substitution.

    *)
  5. | List of gradient_stop list
    (*

    Multiple gradient stops - used for var fallbacks

    *)
  6. | Percentage of percentage
    (*

    Interpolation hint with percentage, e.g., "50%"

    *)
  7. | Position of gradient_position
  8. | Direction of gradient_direction
    (*

    Gradient direction for stops, e.g., "to right" or Var

    *)
  9. | Var of gradient_stop var

Gradient stop values

Sourceval gradient_stops : gradient_stop list -> gradient_stop

gradient_stops stops groups multiple gradient stops, usually for variable fallbacks.

Sourceval gradient_hint_length : length -> gradient_stop

gradient_hint_length value is a length interpolation hint.

Sourceval gradient_hint_percentage : percentage -> gradient_stop

gradient_hint_percentage value is a percentage interpolation hint.

Sourceval radial_gradient_config : ?shape:radial_shape -> ?size:radial_size -> ?position:position_value -> ?interpolation:color_interpolation -> unit -> radial_gradient_config

radial_gradient_config ?shape ?size ?position ?interpolation () builds a radial-gradient prefix.

Sourceval conic_gradient_config : ?angle:angle -> ?position:position_value -> ?interpolation:color_interpolation -> unit -> conic_gradient_config

conic_gradient_config ?angle ?position ?interpolation () builds a conic-gradient prefix.

type border_radius = Properties.border_radius =
  1. | Radius of {
    1. horizontal : length_percentage list;
      (*

      1-4 horizontal radii (top-left, top-right, bottom-right, bottom-left).

      *)
    2. vertical : length_percentage list option;
      (*

      Optional 1-4 vertical radii after /; when None the horizontal values are used for both axes.

      *)
    }
  2. | Inherit
  3. | Initial
  4. | Unset
  5. | Revert
  6. | Revert_layer
  7. | Var of border_radius var

Per CSS Backgrounds and Borders 3 sec. 4.1.

Sourceval radius : length -> border_radius

radius len is a one-value border-radius shorthand value.

For example, border_radius (radius (Rem 0.375)) renders border-radius: 0.375rem.

type object_view_box = Properties.object_view_box =
  1. | None
  2. | Inset of length * length option * length option * length option
  3. | Xywh of {
    1. x : length_percentage;
    2. y : length_percentage;
    3. width : length_percentage;
    4. height : length_percentage;
    5. rounded : border_radius option;
    }
  4. | Rect of {
    1. top : length_percentage;
    2. right : length_percentage;
    3. bottom : length_percentage;
    4. left : length_percentage;
    5. rounded : border_radius option;
    }
  5. | Inherit
  6. | Initial
  7. | Unset
  8. | Revert
  9. | Revert_layer
  10. | Var of object_view_box var
Sourceval object_view_box_inset : ?right:length -> ?bottom:length -> ?left:length -> length -> object_view_box

object_view_box_inset ?right ?bottom ?left top is an inset() object view box.

Sourceval object_view_box : object_view_box -> declaration

object_view_box box is the CSS object-view-box property.

module Webkit_gradient : sig ... end

Background image values

type background_image = Properties.background_image =
  1. | Url of string
  2. | Quoted of string * char
  3. | Linear_gradient of gradient_direction * gradient_stop list
  4. | Linear_gradient_var of gradient_stop var
    (*

    Linear gradient using a single variable for all stops including position. Outputs: linear-gradient(var(--tw-gradient-stops))

    *)
  5. | Radial_gradient of radial_gradient_config * gradient_stop list
  6. | Radial_gradient_var of gradient_stop var
    (*

    Radial gradient using a single variable for all stops. Outputs: radial-gradient(var(--tw-gradient-stops))

    *)
  7. | Conic_gradient of conic_gradient_config * gradient_stop list
  8. | Conic_gradient_var of gradient_stop var
    (*

    Conic gradient using a single variable for all stops. Outputs: conic-gradient(var(--tw-gradient-stops))

    *)
  9. | Repeating_linear_gradient of gradient_direction * gradient_stop list
  10. | Repeating_radial_gradient of radial_gradient_config * gradient_stop list
  11. | Repeating_conic_gradient of conic_gradient_config * gradient_stop list
    (*

    repeating-{linear,radial,conic}-gradient() CSS Images 4 sec. 3.

    *)
  12. | Webkit_linear_gradient of gradient_direction * gradient_stop list
  13. | Webkit_repeating_linear_gradient of gradient_direction * gradient_stop list
  14. | Webkit_radial_gradient of radial_gradient_config * gradient_stop list
  15. | Webkit_repeating_radial_gradient of radial_gradient_config * gradient_stop list
  16. | Moz_linear_gradient of gradient_direction * gradient_stop list
  17. | Moz_repeating_linear_gradient of gradient_direction * gradient_stop list
  18. | Moz_radial_gradient of radial_gradient_config * gradient_stop list
  19. | Moz_repeating_radial_gradient of radial_gradient_config * gradient_stop list
  20. | O_linear_gradient of gradient_direction * gradient_stop list
  21. | O_repeating_linear_gradient of gradient_direction * gradient_stop list
  22. | O_radial_gradient of radial_gradient_config * gradient_stop list
  23. | O_repeating_radial_gradient of radial_gradient_config * gradient_stop list
  24. | Image_set of image_set_option list
    (*

    image-set(<source>#) CSS Images 4

    *)
  25. | Webkit_image_set of image_set_option list
    (*

    -webkit-image-set(<source>#) legacy spelling

    *)
  26. | Cross_fade of cross_fade_option list
    (*

    cross-fade(<cf-mixing-image>#) CSS Images 4

    *)
  27. | Webkit_gradient of Webkit_gradient.t
  28. | List of background_image list
    (*

    Comma-separated list of background images

    *)
  29. | None
  30. | Initial
  31. | Inherit
  32. | Unset
  33. | Revert
  34. | Revert_layer
  35. | Var of background_image var
    (*

    CSS variable reference: var(--my-gradient)

    *)
and image_set_option = Properties.image_set_option = {
  1. source : image_set_source;
  2. resolution : string option;
    (*

    <resolution> like "1x" or "300dpi"

    *)
  3. mime_type : string option;
    (*

    type("image/avif")

    *)
}
and image_set_source = Properties.image_set_source =
  1. | Url of string
  2. | String of string
and cross_fade_option = Properties.cross_fade_option = {
  1. image : background_image;
  2. percent : percentage option;
}
type background_box = Properties.background_box =
  1. | Border_box
  2. | Padding_box
  3. | Content_box
  4. | Text
  5. | Layers of background_box list
  6. | Inherit
  7. | Initial
  8. | Unset
  9. | Revert
  10. | Revert_layer
  11. | Var of background_box var

CSS background and mask box values.

type webkit_mask_box = Properties.webkit_mask_box =
  1. | Border
  2. | Border_box
  3. | Content
  4. | Content_box
  5. | Padding
  6. | Padding_box
  7. | Text
  8. | Layers of webkit_mask_box list
  9. | Inherit
  10. | Initial
  11. | Unset
  12. | Revert
  13. | Revert_layer
  14. | Var of webkit_mask_box var
type webkit_mask_composite = Properties.webkit_mask_composite =
  1. | Source_over
  2. | Source_in
  3. | Source_out
  4. | Source_atop
  5. | Destination_over
  6. | Destination_in
  7. | Destination_out
  8. | Destination_atop
  9. | Xor
  10. | Plus_lighter
  11. | Clear
  12. | Copy
  13. | Composites of webkit_mask_composite list
  14. | Inherit
  15. | Initial
  16. | Unset
  17. | Revert
  18. | Revert_layer
  19. | Var of webkit_mask_composite var
type mask_composite = Properties.mask_composite =
  1. | Add
  2. | Subtract
  3. | Intersect
  4. | Exclude
  5. | Composites of mask_composite list
  6. | Inherit
  7. | Initial
  8. | Unset
  9. | Revert
  10. | Revert_layer
  11. | Var of mask_composite var
type webkit_mask_source_type = Properties.webkit_mask_source_type =
  1. | Alpha
  2. | Luminance
  3. | Auto
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of webkit_mask_source_type var
type mask_mode = Properties.mask_mode =
  1. | Alpha
  2. | Luminance
  3. | Match_source
  4. | Modes of mask_mode list
  5. | Initial
  6. | Inherit
  7. | Unset
  8. | Revert
  9. | Revert_layer
  10. | Var of mask_mode var
type mask_type = Properties.mask_type =
  1. | Alpha
  2. | Luminance
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of mask_type var
type mask_box = Properties.mask_box =
  1. | Border_box
  2. | Content_box
  3. | Fill_box
  4. | Padding_box
  5. | Stroke_box
  6. | View_box
  7. | No_clip
    (*

    Only valid for mask-clip

    *)
  8. | Layers of mask_box list
  9. | Inherit
  10. | Initial
  11. | Unset
  12. | Revert
  13. | Revert_layer
  14. | Var of mask_box var
type mask_layer = Properties.mask_layer = {
  1. image : background_image option;
  2. position : position_value option;
  3. size : background_size option;
  4. repeat : background_repeat option;
  5. origin : mask_box option;
  6. clip : mask_box option;
  7. mode : mask_mode option;
  8. composite : mask_composite option;
}
type mask = Properties.mask =
  1. | None
  2. | Layer of mask_layer
  3. | Layers of mask_layer list
  4. | Initial
  5. | Inherit
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of mask var
Sourceval mask_layer : ?image:background_image -> ?position:position_value -> ?size:background_size -> ?repeat:background_repeat -> ?origin:mask_box -> ?clip:mask_box -> ?mode:mask_mode -> ?composite:mask_composite -> unit -> mask_layer

mask_layer ?image ?position ?size ?repeat ?origin ?clip ?mode ?composite () is one layer for the mask shorthand.

Sourceval mask_layers : mask_layer list -> mask

mask_layers layers is a comma-separated mask shorthand value.

type background_shorthand = Properties.background_shorthand = {
  1. color : color option;
  2. image : background_image option;
  3. position : position_value option;
  4. size : background_size option;
  5. repeat : background_repeat option;
  6. attachment : background_attachment option;
  7. clip : background_box option;
  8. origin : background_box option;
}

CSS background shorthand values.

type background = Properties.background =
  1. | Inherit
  2. | Initial
  3. | Unset
  4. | None
  5. | Shorthand of background_shorthand
    (*

    CSS background values.

    *)
  6. | Var of background var
  7. | Vars of background var list
val background_shorthand : ?color:color -> ?image:background_image -> ?position:position_value -> ?size:background_size -> ?repeat:background_repeat -> ?attachment:background_attachment -> ?clip:background_box -> ?origin:background_box -> unit -> background

background_shorthand ?color ?image ?position ?size ?repeat ?attachment ?clip ?origin () is the background shorthand.

  • color: background color
  • image: background image (url or gradient)
  • position: image position
  • size: image size (cover, contain, or specific size)
  • repeat: repeat behavior (repeat, no-repeat, etc.)
  • attachment: scroll behavior (scroll, fixed, local)
  • clip: clipping area
  • origin: positioning area.
Sourceval color : color -> declaration

color c is the color property.

Sourceval background : background -> declaration

background bg is the background shorthand property.

Sourceval background_color : color -> declaration

background_color c is the background-color property.

Sourceval background_image : background_image -> declaration

background_image img is the background-image property.

Sourceval background_position : position_value list -> declaration

background_position pos is the background-position property.

Sourceval background_size : background_size -> declaration

background_size sz is the background-size property.

Sourceval background_repeat : background_repeat -> declaration

background_repeat rep is the background-repeat property.

Sourceval background_attachment : background_attachment -> declaration

background_attachment att is the background-attachment property.

Sourceval opacity : opacity -> declaration

opacity op is the opacity property.

val url : string -> background_image

url path is a URL background image value.

val linear_gradient : gradient_direction -> gradient_stop list -> background_image

linear_gradient dir stops is a linear gradient background.

val radial_gradient : ?config:radial_gradient_config -> gradient_stop list -> background_image

radial_gradient ?config stops is a radial gradient background.

Sourceval conic_gradient : ?config:conic_gradient_config -> gradient_stop list -> background_image

conic_gradient ?config stops is a conic gradient background.

val color_stop : color -> gradient_stop

color_stop c is a simple color stop.

val color_position : color -> length -> gradient_stop

color_position c pos is a color stop at a specific position.

Flexbox Layout

Properties for CSS Flexible Box Layout, a one-dimensional layout method for distributing space between items and providing alignment capabilities.

type flex_direction = Properties.flex_direction =
  1. | Row
  2. | Row_reverse
  3. | Column
  4. | Column_reverse
  5. | Inherit
  6. | Initial
  7. | Unset
  8. | Revert
  9. | Revert_layer
  10. | Var of flex_direction var

CSS flex direction values.

type flex_wrap = Properties.flex_wrap =
  1. | Nowrap
  2. | Wrap
  3. | Wrap_reverse
  4. | Balance
  5. | Wrap_reverse_balance
  6. | Inherit
  7. | Initial
  8. | Unset
  9. | Revert
  10. | Revert_layer
  11. | Var of flex_wrap var

CSS flex wrap values.

type flex_flow = Properties.flex_flow =
  1. | Flow of flex_direction option * flex_wrap option
  2. | Inherit
  3. | Initial
  4. | Unset
  5. | Revert
  6. | Revert_layer
  7. | Var of flex_flow var
type flex_factor = Properties.flex_factor =
  1. | Number of float
  2. | Inherit
  3. | Initial
  4. | Unset
  5. | Revert
  6. | Revert_layer
  7. | Calc of flex_factor calc
  8. | Var of flex_factor var
type flex_basis = Properties.flex_basis =
  1. | Auto
  2. | Content
  3. | Px of float
  4. | Cm of float
  5. | Mm of float
  6. | Q of float
  7. | In of float
  8. | Pt of float
  9. | Pc of float
  10. | Rem of float
  11. | Em of float
  12. | Ex of float
  13. | Cap of float
  14. | Ic of float
  15. | Ric of float
  16. | Rlh of float
  17. | Pct of float
  18. | Vw of float
  19. | Vh of float
  20. | Vmin of float
  21. | Vmax of float
  22. | Vi of float
  23. | Vb of float
  24. | Dvh of float
  25. | Dvw of float
  26. | Dvmin of float
  27. | Dvmax of float
  28. | Lvh of float
  29. | Lvw of float
  30. | Lvmin of float
  31. | Lvmax of float
  32. | Svh of float
  33. | Svw of float
  34. | Svmin of float
  35. | Svmax of float
  36. | Ch of float
  37. | Lh of float
  38. | Num of float
  39. | Zero
  40. | Inherit
  41. | Initial
  42. | Unset
  43. | Revert
  44. | Revert_layer
  45. | Fit_content
  46. | Fit_content_arg of length
  47. | Max_content
  48. | Min_content
  49. | Clamp of length * length * length
  50. | Min of length list
  51. | Max of length list
  52. | Round of string * length * length
  53. | Mod of length * length
  54. | Rem_fn of length * length
  55. | Hypot of length list
  56. | Abs of length
  57. | Dimension of {
    1. value : float;
    2. unit : string;
    3. repr : string;
    }
  58. | Calc of flex_basis calc
  59. | Var of flex_basis var

CSS flex basis values.

type flex = Properties.flex =
  1. | Initial
    (*

    0 1 auto

    *)
  2. | Inherit
  3. | Unset
  4. | Revert
  5. | Revert_layer
  6. | Auto
    (*

    1 1 auto

    *)
  7. | None
    (*

    0 0 auto

    *)
  8. | Grow of flex_factor
    (*

    Single grow value

    *)
  9. | Basis of flex_basis
    (*

    1 1 <flex-basis>

    *)
  10. | Grow_shrink of flex_factor * flex_factor
    (*

    grow shrink 0%

    *)
  11. | Full of flex_factor * flex_factor * flex_basis
    (*

    grow shrink basis

    *)
  12. | Var of flex var

CSS flex shorthand values.

type font_size = Properties.font_size =
  1. | Length of length
  2. | Pct of float
  3. | Calc of font_size calc
  4. | Xx_small
  5. | X_small
  6. | Small
  7. | Medium
  8. | Large
  9. | X_large
  10. | Xx_large
  11. | Xxx_large
  12. | Larger
  13. | Smaller
  14. | Math
  15. | Inherit
  16. | Initial
  17. | Unset
  18. | Revert
  19. | Revert_layer
  20. | Var of font_size var

CSS font-size values. MDN: font-size

Alignment Properties

CSS Box Alignment properties for flexbox and grid layouts.

type align_content = Properties.align_content =
  1. | Normal
  2. | Baseline
  3. | First_baseline
  4. | Last_baseline
  5. | Center
  6. | Start
  7. | End
  8. | Flex_start
  9. | Flex_end
  10. | Safe_center
  11. | Safe_start
  12. | Safe_end
  13. | Safe_flex_start
  14. | Safe_flex_end
  15. | Unsafe_center
  16. | Unsafe_start
  17. | Unsafe_end
  18. | Unsafe_flex_start
  19. | Unsafe_flex_end
  20. | Space_between
  21. | Space_around
  22. | Space_evenly
  23. | Stretch
  24. | Inherit
  25. | Initial
  26. | Unset
  27. | Revert
  28. | Revert_layer
  29. | Var of align_content var

CSS align-content values. MDN: align-content

type align_items = Properties.align_items =
  1. | Normal
  2. | Stretch
  3. | Baseline
  4. | First_baseline
  5. | Last_baseline
  6. | Center
  7. | Start
  8. | End
  9. | Self_start
  10. | Self_end
  11. | Flex_start
  12. | Flex_end
  13. | Safe_center
  14. | Safe_start
  15. | Safe_end
  16. | Safe_flex_start
  17. | Safe_flex_end
  18. | Unsafe_center
  19. | Unsafe_start
  20. | Unsafe_end
  21. | Unsafe_self_start
  22. | Unsafe_self_end
  23. | Unsafe_flex_start
  24. | Unsafe_flex_end
  25. | Anchor_center
  26. | Inherit
  27. | Initial
  28. | Unset
  29. | Revert
  30. | Revert_layer
  31. | Var of align_items var

CSS align-items values. MDN: align-items

type justify_content = Properties.justify_content =
  1. | Normal
  2. | Center
  3. | Start
  4. | End
  5. | Flex_start
  6. | Flex_end
  7. | Left
  8. | Right
  9. | Safe_center
  10. | Safe_start
  11. | Safe_end
  12. | Safe_flex_start
  13. | Safe_flex_end
  14. | Safe_left
  15. | Safe_right
  16. | Unsafe_center
  17. | Unsafe_start
  18. | Unsafe_end
  19. | Unsafe_flex_start
  20. | Unsafe_flex_end
  21. | Unsafe_left
  22. | Unsafe_right
  23. | Space_between
  24. | Space_around
  25. | Space_evenly
  26. | Stretch
  27. | Inherit
  28. | Initial
  29. | Unset
  30. | Revert
  31. | Revert_layer
  32. | Var of justify_content var

CSS justify-content values. MDN: justify-content

type align_self = Properties.align_self =
  1. | Auto
  2. | Normal
  3. | Stretch
  4. | Baseline
  5. | First_baseline
  6. | Last_baseline
  7. | Center
  8. | Start
  9. | End
  10. | Self_start
  11. | Self_end
  12. | Flex_start
  13. | Flex_end
  14. | Safe_center
  15. | Safe_start
  16. | Safe_end
  17. | Safe_flex_start
  18. | Safe_flex_end
  19. | Unsafe_center
  20. | Unsafe_start
  21. | Unsafe_end
  22. | Unsafe_self_start
  23. | Unsafe_self_end
  24. | Unsafe_flex_start
  25. | Unsafe_flex_end
  26. | Inherit
  27. | Initial
  28. | Unset
  29. | Revert
  30. | Revert_layer
  31. | Var of align_self var

CSS align-self values. MDN: align-self

type justify_items = Properties.justify_items =
  1. | Normal
  2. | Stretch
  3. | Baseline
  4. | First_baseline
  5. | Last_baseline
  6. | Center
  7. | Start
  8. | End
  9. | Self_start
  10. | Self_end
  11. | Flex_start
  12. | Flex_end
  13. | Left
  14. | Right
  15. | Safe_center
  16. | Safe_start
  17. | Safe_end
  18. | Safe_self_start
  19. | Safe_self_end
  20. | Safe_flex_start
  21. | Safe_flex_end
  22. | Safe_left
  23. | Safe_right
  24. | Unsafe_center
  25. | Unsafe_start
  26. | Unsafe_end
  27. | Unsafe_self_start
  28. | Unsafe_self_end
  29. | Unsafe_flex_start
  30. | Unsafe_flex_end
  31. | Unsafe_left
  32. | Unsafe_right
  33. | Anchor_center
  34. | Legacy
  35. | Legacy_center
  36. | Legacy_left
  37. | Legacy_right
  38. | Inherit
  39. | Initial
  40. | Unset
  41. | Revert
  42. | Revert_layer
  43. | Var of justify_items var

CSS justify-items values. MDN: justify-items

type justify_self = Properties.justify_self =
  1. | Auto
  2. | Normal
  3. | Stretch
  4. | Baseline
  5. | First_baseline
  6. | Last_baseline
  7. | Center
  8. | Start
  9. | End
  10. | Self_start
  11. | Self_end
  12. | Flex_start
  13. | Flex_end
  14. | Left
  15. | Right
  16. | Safe_center
  17. | Safe_start
  18. | Safe_end
  19. | Safe_self_start
  20. | Safe_self_end
  21. | Safe_flex_start
  22. | Safe_flex_end
  23. | Safe_left
  24. | Safe_right
  25. | Unsafe_center
  26. | Unsafe_start
  27. | Unsafe_end
  28. | Unsafe_self_start
  29. | Unsafe_self_end
  30. | Unsafe_flex_start
  31. | Unsafe_flex_end
  32. | Unsafe_left
  33. | Unsafe_right
  34. | Anchor_center
  35. | Inherit
  36. | Initial
  37. | Unset
  38. | Revert
  39. | Revert_layer
  40. | Var of justify_self var

CSS justify-self values. MDN: justify-self

Sourceval align_content : align_content -> declaration

align_content alignment is the align-content property. Sets how content is aligned along the cross axis. Common values: Normal, Baseline, Center, Start, End, Space_between, Stretch.

Sourceval justify_content : justify_content -> declaration

justify_content alignment is the justify-content property. Sets how content is aligned along the main axis. Common values: Normal, Center, Start, End, Space_between, Space_around, Stretch.

Sourceval align_items : align_items -> declaration

align_items alignment is the align-items property. Sets alignment for all items along the cross axis. Common values: Normal, Baseline, Center, Start, End, Stretch.

Sourceval align_self : align_self -> declaration

align_self alignment is the align-self property. Overrides align-items for an individual item. Common values: Auto, Normal, Baseline, Center, Start, End, Stretch.

Sourceval justify_items : justify_items -> declaration

justify_items justification is the justify-items property. Sets default justification for all items. Common values: Normal, Baseline, Center, Start, End, Stretch, Legacy.

Sourceval justify_self : justify_self -> declaration

justify_self justification is the justify-self property. Sets justification for an individual item on the inline (main) axis.

Sourceval flex_direction : flex_direction -> declaration

flex_direction direction is the flex-direction property.

Sourceval flex_wrap : flex_wrap -> declaration

flex_wrap wrap is the flex-wrap property.

Sourceval flex_flow : flex_flow -> declaration

flex_flow flow is the CSS flex-flow property.

Sourceval flex : flex -> declaration

flex flex is the flex shorthand property.

Sourceval flex_grow : float -> declaration

flex_grow amount is the flex-grow property.

Sourceval flex_shrink : float -> declaration

flex_shrink amount is the flex-shrink property.

Sourceval flex_basis : flex_basis -> declaration

flex_basis basis is the flex-basis property.

Sourceval order : order -> declaration

order order is the order property.

type gap = Properties.gap =
  1. | Lengths of {
    1. row_gap : length option;
    2. column_gap : length option;
    }
  2. | Inherit
  3. | Initial
  4. | Unset
  5. | Revert
  6. | Revert_layer
  7. | Var of gap var

CSS gap shorthand type.

Sourceval gaps : ?column:length -> length -> gap

gaps row is a one-value gap shorthand value. gaps ~column row is a two-value gap shorthand value with separate row and column gaps.

Sourceval gap : gap -> declaration

gap gap is the gap property shorthand (applies to both row and column gaps).

Sourceval row_gap : length -> declaration

row_gap gap is the row-gap property.

Sourceval column_gap : length -> declaration

column_gap gap is the column-gap property.

Grid Layout

Properties for CSS Grid Layout, a two-dimensional layout system optimized for user interface design with explicit row and column positioning.

type repeat_count = Properties.repeat_count =
  1. | Count of int
  2. | Auto_fill
  3. | Auto_fit
  4. | Var of repeat_count var

repeat() count argument: an integer or auto-fill / auto-fit (CSS Grid 1 sec. 7.2.3.1).

type grid_auto_flow_component = Properties.grid_auto_flow_component =
  1. | Axis of [ `Row | `Column ]
  2. | Dense
  3. | Var of grid_auto_flow_component var

One component in a grid-auto-flow value.

type grid_auto_flow = Properties.grid_auto_flow =
  1. | Row
  2. | Column
  3. | Dense
  4. | Row_dense
  5. | Column_dense
  6. | Components of grid_auto_flow_component list
  7. | Inherit
  8. | Initial
  9. | Unset
  10. | Revert
  11. | Revert_layer
  12. | Var of grid_auto_flow var

CSS grid-auto-flow values

type grid_flex_math = Properties.grid_flex_math =
  1. | Calc_flex of math_arg
  2. | Min_flex of math_arg list
  3. | Max_flex of math_arg list
  4. | Clamp_flex of math_arg * math_arg * math_arg

CSS grid template values

type grid_template = Properties.grid_template =
  1. | None
  2. | Px of float
  3. | Rem of float
  4. | Em of float
  5. | Pct of float
  6. | Vw of float
  7. | Vh of float
  8. | Vmin of float
  9. | Vmax of float
  10. | Zero
  11. | Length of length
  12. | Fr of float
  13. | Flex_math of grid_flex_math
  14. | Auto
  15. | Min_content
  16. | Max_content
  17. | Inherit
  18. | Initial
  19. | Unset
  20. | Revert
  21. | Revert_layer
  22. | Min_max of grid_template * grid_template
  23. | Fit_content of length
  24. | Repeat of repeat_count * grid_template list
  25. | Tracks of grid_template list
  26. | Split of grid_template * grid_template
  27. | Auto_flow_columns of grid_template * grid_auto_flow * grid_template option
    (*

    <grid-template-rows> / auto-flow [dense]? <grid-auto-columns>?.

    *)
  28. | Auto_flow_rows of grid_auto_flow * grid_template option * grid_template
    (*

    auto-flow [dense]? <grid-auto-rows>? / <grid-template-columns>.

    *)
  29. | Named_tracks of (string option * grid_template) list
  30. | Line_names of string list
    (*

    [col-start a b] line-names block, kept as its own track-list element so the printer preserves the surrounding track positions.

    *)
  31. | Template of string
  32. | Subgrid
  33. | Masonry
    (*

    CSS Grid 3 (ED) removed this value, and it stays because Firefox ships it behind a pref: refusing it would drop a declaration a shipping browser renders.

    *)
  34. | Var of grid_template var
type grid_template_areas = Properties.grid_template_areas =
  1. | No_areas
  2. | Areas of string
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of grid_template_areas var

CSS grid-template-areas values

type grid_line = Properties.grid_line =
  1. | Auto
    (*

    auto

    *)
  2. | Num of int
    (*

    1, 2, 3, ... or -1, -2, ...

    *)
  3. | Name of string
    (*

    "header-start", "main-end", etc.

    *)
  4. | Num_name of int * string
    (*

    <integer> <custom-ident>

    *)
  5. | Span of int
    (*

    span 2, span 3, etc.

    *)
  6. | Span_name of string
    (*

    span <custom-ident>

    *)
  7. | Span_num_name of int * string
    (*

    span <integer> <custom-ident>

    *)
  8. | Calc of grid_line calc
    (*

    calc(12 * -1), etc.

    *)
  9. | Calc_name of grid_line calc * string
    (*

    calc(2) <custom-ident>

    *)
  10. | Var of grid_line var

CSS grid line values

type grid_line_pair = Properties.grid_line_pair =
  1. | Lines of grid_line * grid_line
  2. | Var of grid_line_pair var
type grid_area = Properties.grid_area =
  1. | Lines of {
    1. row_start : grid_line;
    2. column_start : grid_line;
    3. row_end : grid_line;
    4. column_end : grid_line;
    }
  2. | Var of grid_area var
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
Sourceval grid_tracks : grid_template list -> grid_template

grid_tracks tracks is a track list.

Sourceval grid_repeat : repeat_count -> grid_template list -> grid_template

grid_repeat count tracks is a repeat(...) track list item.

Sourceval grid_line_num : int -> grid_line

grid_line_num n is a numeric grid line.

Sourceval grid_line_name : string -> grid_line

grid_line_name name is a named grid line.

Sourceval grid_line_span : int -> grid_line

grid_line_span n is span n.

Sourceval grid_line_span_name : string -> grid_line

grid_line_span_name name is span name.

grid_lines start end_ is a grid line pair for row/column shorthands.

Sourceval grid_template_columns : grid_template -> declaration

grid_template_columns cols is the grid-template-columns property.

Sourceval grid_template_rows : grid_template -> declaration

grid_template_rows rows is the grid-template-rows property.

Sourceval grid_template_areas : grid_template_areas -> declaration

grid_template_areas areas is the grid-template-areas property.

Sourceval grid_template : grid_template -> declaration

grid_template template is the grid-template shorthand property.

Sourceval grid_auto_columns : grid_template -> declaration

grid_auto_columns cols is the grid-auto-columns property.

Sourceval grid_auto_rows : grid_template -> declaration

grid_auto_rows rows is the grid-auto-rows property.

Sourceval grid_auto_flow : grid_auto_flow -> declaration

grid_auto_flow flow is the grid-auto-flow property.

Sourceval grid_row_start : grid_line -> declaration

grid_row_start start is the grid-row-start property.

Sourceval grid_row_end : grid_line -> declaration

grid_row_end end_ is the grid-row-end property.

Sourceval grid_column_start : grid_line -> declaration

grid_column_start start is the grid-column-start property.

Sourceval grid_column_end : grid_line -> declaration

grid_column_end end_ is the grid-column-end property.

Sourceval grid_row : (grid_line * grid_line) -> declaration

grid_row v is the grid-row shorthand property.

Sourceval grid_column : (grid_line * grid_line) -> declaration

grid_column v is the grid-column shorthand property.

Sourceval grid_area : grid_area -> declaration

grid_area area is the grid-area property.

type place_items = Properties.place_items =
  1. | Normal
  2. | Start
  3. | End
  4. | Center
  5. | Stretch
  6. | Baseline
  7. | First_baseline
  8. | Last_baseline
  9. | Start_safe
  10. | End_safe
  11. | Center_safe
  12. | Stretch_stretch
    (*

    Explicit stretch on both axes.

    *)
  13. | Align_justify of align_items * justify_items
  14. | Inherit
  15. | Initial
  16. | Unset
  17. | Revert
  18. | Revert_layer
  19. | Var of place_items var

CSS place-items values

Sourceval place_items : place_items -> declaration

place_items items is the place-items shorthand property.

type place_content = Properties.place_content =
  1. | Normal
  2. | Start
  3. | End
  4. | Center
  5. | Stretch
  6. | Space_between
  7. | Space_around
  8. | Space_evenly
  9. | Safe_center
  10. | Safe_start
  11. | Safe_end
  12. | Safe_stretch
  13. | Unsafe_center
  14. | Unsafe_start
  15. | Unsafe_end
  16. | Unsafe_stretch
  17. | Align_justify of align_content * justify_content
  18. | Inherit
  19. | Initial
  20. | Unset
  21. | Revert
  22. | Revert_layer
  23. | Var of place_content var

CSS place-content values

Sourceval place_content : place_content -> declaration

place_content content is the place-content shorthand property.

Sourceval place_self : (align_self * justify_self) -> declaration

place_self self_ is the place-self shorthand property.

Typography

Properties for controlling text appearance, fonts, and text layout. This includes font properties, text decoration, alignment, and spacing.

type font_weight = Properties.font_weight =
  1. | Weight of float
  2. | Normal
  3. | Bold
  4. | Bolder
  5. | Lighter
  6. | Calc of font_weight calc
  7. | Inherit
  8. | Initial
  9. | Unset
  10. | Revert
  11. | Revert_layer
  12. | Var of font_weight var

CSS font weight values.

type text_align = Properties.text_align =
  1. | Left
  2. | Right
  3. | Center
  4. | Justify
  5. | Start
  6. | End
  7. | Match_parent
  8. | Webkit_match_parent
  9. | Inherit
  10. | Initial
  11. | Unset
  12. | Revert
  13. | Revert_layer
  14. | Var of text_align var

CSS text align values.

type text_decoration_line = Properties.text_decoration_line =
  1. | None
  2. | Underline
  3. | Overline
  4. | Line_through
  5. | Spelling_error
  6. | Grammar_error
  7. | Inherit
  8. | Initial
  9. | Unset
  10. | Revert
  11. | Revert_layer
  12. | Var of text_decoration_line var
type text_decoration_style = Properties.text_decoration_style =
  1. | Solid
  2. | Double
  3. | Dotted
  4. | Dashed
  5. | Wavy
  6. | Inherit
  7. | Initial
  8. | Unset
  9. | Revert
  10. | Revert_layer
  11. | Var of text_decoration_style var
type text_decoration_shorthand = Properties.text_decoration_shorthand = {
  1. lines : text_decoration_line list;
  2. style : text_decoration_style option;
  3. color : color option;
  4. thickness : length option;
}
type text_decoration = Properties.text_decoration =
  1. | None
  2. | Shorthand of text_decoration_shorthand
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of text_decoration var

CSS text decoration values.

type text_emphasis_fill = Properties.text_emphasis_fill =
  1. | Filled
  2. | Open
type text_emphasis_shape = Properties.text_emphasis_shape =
  1. | Dot
  2. | Circle
  3. | Double_circle
  4. | Triangle
  5. | Sesame
type text_emphasis_style = Properties.text_emphasis_style =
  1. | None
  2. | Mark of text_emphasis_fill option * text_emphasis_shape option
  3. | String of string
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of text_emphasis_style var
type text_emphasis = Properties.text_emphasis =
  1. | Emphasis of text_emphasis_style option * color option
  2. | Inherit
  3. | Initial
  4. | Unset
  5. | Revert
  6. | Revert_layer
  7. | Var of text_emphasis var
type text_emphasis_line = Properties.text_emphasis_line =
  1. | Over
  2. | Under
type text_emphasis_side = Properties.text_emphasis_side =
  1. | Left
  2. | Right
type text_emphasis_position = Properties.text_emphasis_position =
  1. | Position of text_emphasis_line * text_emphasis_side option
  2. | Inherit
  3. | Initial
  4. | Unset
  5. | Revert
  6. | Revert_layer
  7. | Var of text_emphasis_position var
type text_orientation = Properties.text_orientation =
  1. | Mixed
  2. | Upright
  3. | Sideways
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of text_orientation var
type glyph_orientation_vertical = Properties.glyph_orientation_vertical =
  1. | Auto
  2. | Angle of angle
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of glyph_orientation_vertical var
type line_break = Properties.line_break =
  1. | Auto
  2. | Loose
  3. | Normal
  4. | Strict
  5. | Anywhere
  6. | Inherit
  7. | Initial
  8. | Unset
  9. | Revert
  10. | Revert_layer
  11. | Var of line_break var
val text_decoration_shorthand : ?lines:text_decoration_line list -> ?style:text_decoration_style -> ?color:color -> ?thickness:length -> unit -> text_decoration

text_decoration_shorthand ?lines ?style ?color ?thickness () is the text-decoration shorthand.

  • lines: decoration lines (underline, overline, line-through)
  • style: line style (solid, double, dotted, dashed, wavy)
  • color: decoration color
  • thickness: line thickness.
type font_style = Properties.font_style =
  1. | Normal
  2. | Italic
  3. | Oblique
  4. | Oblique_angle of angle
  5. | Oblique_range of angle * angle
  6. | Inherit
  7. | Initial
  8. | Unset
  9. | Revert
  10. | Revert_layer
  11. | Var of font_style var

CSS font style values.

type text_transform_case = Properties.text_transform_case =
  1. | Capitalize
  2. | Uppercase
  3. | Lowercase
type text_transform = Properties.text_transform =
  1. | None
  2. | Case of text_transform_case
  3. | Combo of {
    1. case : text_transform_case option;
    2. full_width : bool;
    3. full_size_kana : bool;
    }
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of text_transform var

CSS text transform values.

type text_size_adjust = Properties.text_size_adjust =
  1. | None
  2. | Auto
  3. | Pct of float
  4. | Calc of text_size_adjust calc
    (*

    A math function answering a <percentage>

    *)
  5. | Inherit
  6. | Initial
  7. | Unset
  8. | Revert
  9. | Revert_layer
  10. | Var of text_size_adjust var

CSS text-size-adjust values (including vendor prefixes).

type font_family = Properties.font_family =
  1. | Sans_serif
  2. | Serif
  3. | Monospace
  4. | Cursive
  5. | Fantasy
  6. | System_ui
  7. | Ui_sans_serif
  8. | Ui_serif
  9. | Ui_monospace
  10. | Ui_rounded
  11. | Emoji
  12. | Math
  13. | Fangsong
  14. | Inter
  15. | Roboto
  16. | Open_sans
  17. | Lato
  18. | Montserrat
  19. | Poppins
  20. | Source_sans_pro
  21. | Raleway
  22. | Oswald
  23. | Noto_sans
  24. | Ubuntu
  25. | Playfair_display
  26. | Merriweather
  27. | Lora
  28. | PT_sans
  29. | PT_serif
  30. | Nunito
  31. | Nunito_sans
  32. | Work_sans
  33. | Rubik
  34. | Fira_sans
  35. | Fira_code
  36. | JetBrains_mono
  37. | IBM_plex_sans
  38. | IBM_plex_serif
  39. | IBM_plex_mono
  40. | Source_code_pro
  41. | Space_mono
  42. | DM_sans
  43. | DM_serif_display
  44. | Bebas_neue
  45. | Barlow
  46. | Mulish
  47. | Josefin_sans
  48. | Helvetica
  49. | Helvetica_neue
  50. | Arial
  51. | Verdana
  52. | Tahoma
  53. | Trebuchet_ms
  54. | Times_new_roman
  55. | Times
  56. | Georgia
  57. | Cambria
  58. | Garamond
  59. | Courier_new
  60. | Courier
  61. | Lucida_console
  62. | SF_pro
  63. | SF_pro_display
  64. | SF_pro_text
  65. | SF_mono
  66. | NY
  67. | Segoe_ui
  68. | Segoe_ui_emoji
  69. | Segoe_ui_symbol
  70. | Apple_color_emoji
  71. | Noto_color_emoji
  72. | Android_emoji
  73. | Twemoji_mozilla
  74. | Menlo
  75. | Monaco
  76. | Consolas
  77. | Liberation_mono
  78. | SFMono_regular
  79. | Cascadia_code
  80. | Cascadia_mono
  81. | Victor_mono
  82. | Inconsolata
  83. | Hack
  84. | Inherit
  85. | Initial
  86. | Unset
  87. | Revert
  88. | Revert_layer
  89. | Name of string
  90. | List of font_family list
  91. | Var of font_family var
  92. | Invalid of invalid_value
    (*

    CSS-wide keyword mixed in a <custom-ident># list, preserved verbatim and dropped by Optimize.drop_invalid on every serialisation.

    *)

CSS font-family values

Sourceval font_stack : font_family list -> font_family

font_stack fonts is a comma-separated font-family stack.

Sourceval font_family : font_family -> declaration

font_family fonts is the font-family property.

Sourceval font_families : font_family list -> declaration

font_families fonts is the font-family property from a comma-separated list. Raises Invalid_argument when fonts is empty.

Sourceval font_size : length -> declaration

font_size size is the font-size property.

Sourceval font_size_kw : font_size -> declaration

font_size_kw fs is the font-size property accepting the full font_size type including absolute/relative size keywords like Larger and Xx_large.

Sourceval font_weight : font_weight -> declaration

font_weight weight is the font-weight property.

Sourceval font_style : font_style -> declaration

font_style style is the font-style property.

type line_height = Properties.line_height =
  1. | Normal
  2. | Px of float
  3. | Rem of float
  4. | Em of float
  5. | Pct of float
  6. | Num of float
  7. | Number of {
    1. value : float;
    2. unit : string option;
    3. repr : string;
    }
  8. | Inherit
  9. | Initial
  10. | Unset
  11. | Revert
  12. | Revert_layer
  13. | Min of line_height list
  14. | Max of line_height list
  15. | Clamp of line_height * line_height * line_height
    (*

    CSS Values 4 sec. 10.2 comparison functions over the <length-percentage> half of the grammar. A length beside a percentage resolves only at used-value time, so the call stands here rather than folding to one of its arguments.

    *)
  16. | Calc of line_height calc
  17. | Var of line_height var

CSS line-height values

Sourceval line_height : line_height -> declaration

line_height height is the line-height property. Accepts Normal, Length values (e.g., `Length (Rem 1.5)`), Number values (e.g., `Num 1.5`), or Percentage values.

Sourceval letter_spacing : length -> declaration

letter_spacing spacing is the letter-spacing property.

Sourceval word_spacing : length -> declaration

word_spacing spacing is the word-spacing property.

Sourceval text_align : text_align -> declaration

text_align align is the text-align property.

Sourceval text_decoration : text_decoration -> declaration

text_decoration decoration is the text-decoration property.

Sourceval text_transform : text_transform -> declaration

text_transform transform is the text-transform property.

type text_indent_value = Properties.text_indent_value =
  1. | Indent of {
    1. length : length_percentage;
    2. hanging : bool;
    3. each_line : bool;
    }
  2. | Inherit
  3. | Initial
  4. | Unset
  5. | Revert
  6. | Revert_layer
  7. | Var of text_indent_value var

text_indent indent is the text-indent property.

type white_space = Properties.white_space =
  1. | Normal
  2. | Nowrap
  3. | Pre
  4. | Pre_wrap
  5. | Pre_line
  6. | Break_spaces
  7. | Collapse
  8. | Preserve_nowrap
  9. | Inherit
  10. | Initial
  11. | Unset
  12. | Revert
  13. | Revert_layer
  14. | Var of white_space var

CSS white-space values

Sourceval white_space : white_space -> declaration

white_space space is the white-space property.

type word_break = Properties.word_break =
  1. | Normal
  2. | Break_all
  3. | Keep_all
  4. | Break_word
  5. | Auto_phrase
  6. | Inherit
  7. | Initial
  8. | Unset
  9. | Revert
  10. | Revert_layer
  11. | Var of word_break var

CSS word-break values

Sourceval word_break : word_break -> declaration

word_break break is the word-break property.

Sourceval text_decoration_color : color -> declaration

text_decoration_color color is the text-decoration-color property.

Sourceval text_size_adjust : text_size_adjust -> declaration

text_size_adjust adjust is the text-size-adjust property.

Sourceval text_decoration_style : text_decoration_style -> declaration

text_decoration_style style is the text-decoration-style property.

Sourceval text_decoration_line : text_decoration_line -> declaration

text_decoration_line line is the text-decoration-line property.

Sourceval text_underline_offset : length -> declaration

text_underline_offset offset is the text-underline-offset property.

Sourceval text_emphasis : text_emphasis -> declaration

text_emphasis emphasis is the text-emphasis property.

Sourceval text_emphasis_style : text_emphasis_style -> declaration

text_emphasis_style style is the text-emphasis-style property.

Sourceval text_emphasis_color : color -> declaration

text_emphasis_color color is the text-emphasis-color property.

Sourceval text_emphasis_position : text_emphasis_position -> declaration

text_emphasis_position position is the text-emphasis-position property.

Sourceval text_orientation : text_orientation -> declaration

text_orientation orientation is the text-orientation property.

Sourceval glyph_orientation_vertical : glyph_orientation_vertical -> declaration

glyph_orientation_vertical orientation is the CSS glyph-orientation-vertical property.

type overflow_wrap = Properties.overflow_wrap =
  1. | Normal
  2. | Break_word
  3. | Anywhere
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of overflow_wrap var

CSS overflow-wrap values

Sourceval overflow_wrap : overflow_wrap -> declaration

overflow_wrap wrap is the overflow-wrap property.

Sourceval line_break : line_break -> declaration

line_break break is the line-break property.

type hyphens = Properties.hyphens =
  1. | None
  2. | Manual
  3. | Auto
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of hyphens var

CSS hyphens values

Sourceval hyphens : hyphens -> declaration

hyphens hyphens is the hyphens property.

type font_stretch = Properties.font_stretch =
  1. | Pct of float
    (*

    Percentage values from 50% to 200%

    *)
  2. | Calc of font_stretch calc
    (*

    A math function answering a <percentage>

    *)
  3. | Ultra_condensed
  4. | Extra_condensed
  5. | Condensed
  6. | Semi_condensed
  7. | Normal
  8. | Semi_expanded
  9. | Expanded
  10. | Extra_expanded
  11. | Ultra_expanded
  12. | Inherit
  13. | Initial
  14. | Unset
  15. | Revert
  16. | Revert_layer
  17. | Var of font_stretch var

CSS font-stretch values

type font_variant_css21 = Properties.font_variant_css21 =
  1. | Normal
  2. | Small_caps
type font_shorthand = Properties.font_shorthand = {
  1. style : font_style option;
  2. variant : font_variant_css21 option;
  3. weight : font_weight option;
  4. stretch : font_stretch option;
  5. size : font_size;
  6. line_height : line_height option;
  7. family : font_family;
}
type font = Properties.font =
  1. | Shorthand of font_shorthand
  2. | Caption
  3. | Icon
  4. | Menu
  5. | Message_box
  6. | Small_caption
  7. | Status_bar
  8. | Inherit
  9. | Initial
  10. | Unset
  11. | Revert
  12. | Revert_layer
  13. | Var of font var
Sourceval font_stretch : font_stretch -> declaration

font_stretch stretch is the font-stretch property.

type font_optical_sizing = Properties.font_optical_sizing =
  1. | Auto
  2. | None
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of font_optical_sizing var
Sourceval font_optical_sizing : font_optical_sizing -> declaration

font_optical_sizing sizing is the font-optical-sizing property.

type font_kerning = Properties.font_kerning =
  1. | Auto
  2. | Normal
  3. | None
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of font_kerning var
Sourceval font_kerning : font_kerning -> declaration

font_kerning kerning is the font-kerning property.

type font_language_override = Properties.font_language_override =
  1. | Normal
  2. | String of string
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of font_language_override var
Sourceval font_language_override : font_language_override -> declaration

font_language_override override is the font-language-override property.

type font_synthesis_style = Properties.font_synthesis_style =
  1. | Auto
  2. | None
  3. | Oblique_only
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of font_synthesis_style var
Sourceval font_synthesis_style : font_synthesis_style -> declaration

font_synthesis_style style is the font-synthesis-style property.

type font_synthesis_weight = Properties.font_synthesis_weight =
  1. | Auto
  2. | None
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of font_synthesis_weight var
Sourceval font_synthesis_weight : font_synthesis_weight -> declaration

font_synthesis_weight weight is the font-synthesis-weight property.

type font_synthesis_small_caps = Properties.font_synthesis_small_caps =
  1. | Auto
  2. | None
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of font_synthesis_small_caps var
Sourceval font_synthesis_small_caps : font_synthesis_small_caps -> declaration

font_synthesis_small_caps small_caps is the font-synthesis-small-caps property.

type font_synthesis_position = Properties.font_synthesis_position =
  1. | Auto
  2. | None
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of font_synthesis_position var
Sourceval font_synthesis_position : font_synthesis_position -> declaration

font_synthesis_position position is the font-synthesis-position property.

type font_variant_ligature = Properties.font_variant_ligature =
  1. | Common_ligatures
  2. | No_common_ligatures
  3. | Discretionary_ligatures
  4. | No_discretionary_ligatures
  5. | Historical_ligatures
  6. | No_historical_ligatures
  7. | Contextual
  8. | No_contextual
type font_variant_ligatures = Properties.font_variant_ligatures =
  1. | Normal
  2. | None
  3. | Ligatures of font_variant_ligature list
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of font_variant_ligatures var
Sourceval font_variant_ligatures : font_variant_ligatures -> declaration

font_variant_ligatures ligatures is the font-variant-ligatures property.

type font_variant_caps = Properties.font_variant_caps =
  1. | Normal
  2. | Small_caps
  3. | All_small_caps
  4. | Petite_caps
  5. | All_petite_caps
  6. | Unicase
  7. | Titling_caps
  8. | Inherit
  9. | Initial
  10. | Unset
  11. | Revert
  12. | Revert_layer
  13. | Var of font_variant_caps var
Sourceval font_variant_caps : font_variant_caps -> declaration

font_variant_caps caps is the font-variant-caps property.

type font_variant_position = Properties.font_variant_position =
  1. | Normal
  2. | Sub
  3. | Super
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of font_variant_position var
Sourceval font_variant_position : font_variant_position -> declaration

font_variant_position position is the font-variant-position property.

type east_asian_feature = Properties.east_asian_feature =
  1. | Jis78
  2. | Jis83
  3. | Jis90
  4. | Jis04
  5. | Simplified
  6. | Traditional
  7. | Full_width
  8. | Proportional_width
  9. | Ruby
type font_variant_east_asian = Properties.font_variant_east_asian =
  1. | Normal
  2. | Features of east_asian_feature list
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of font_variant_east_asian var
Sourceval font_variant_east_asian : font_variant_east_asian -> declaration

font_variant_east_asian east_asian is the font-variant-east-asian property.

type font_size_adjust_metric = Properties.font_size_adjust_metric =
  1. | Ex_height
  2. | Cap_height
  3. | Ch_width
  4. | Ic_width
  5. | Ic_height

CSS font-size-adjust metric keywords

type font_size_adjust = Properties.font_size_adjust =
  1. | None
  2. | Number of float
  3. | Calc of font_size_adjust calc
  4. | From_font
  5. | Metric_number of font_size_adjust_metric * float
  6. | Metric_from_font of font_size_adjust_metric
  7. | Inherit
  8. | Initial
  9. | Unset
  10. | Revert
  11. | Revert_layer
  12. | Var of font_size_adjust var

CSS font-size-adjust values

type font_variant_emoji = Properties.font_variant_emoji =
  1. | Normal
  2. | Text
  3. | Emoji
  4. | Unicode
  5. | Inherit
  6. | Initial
  7. | Unset
  8. | Revert
  9. | Revert_layer
  10. | Var of font_variant_emoji var

CSS font-variant-emoji values

type font_variant_numeric_token = Properties.font_variant_numeric_token =
  1. | Normal
    (*

    Reset to normal font variant

    *)
  2. | Lining_nums
  3. | Oldstyle_nums
  4. | Proportional_nums
  5. | Tabular_nums
  6. | Diagonal_fractions
  7. | Stacked_fractions
  8. | Ordinal
  9. | Slashed_zero
  10. | Var of font_variant_numeric_token var
    (*

    CSS font-variant-numeric values

    *)

CSS font-variant-numeric token values

type font_variant_numeric = Properties.font_variant_numeric =
  1. | Normal
  2. | Inherit
  3. | Initial
  4. | Unset
  5. | Revert
  6. | Revert_layer
  7. | Tokens of font_variant_numeric_token list
  8. | Composed of {
    1. ordinal : font_variant_numeric_token option;
    2. slashed_zero : font_variant_numeric_token option;
    3. numeric_figure : font_variant_numeric_token option;
    4. numeric_spacing : font_variant_numeric_token option;
    5. numeric_fraction : font_variant_numeric_token option;
    }
  9. | Var of font_variant_numeric var
Sourceval font_variant_numeric : font_variant_numeric -> declaration

font_variant_numeric numeric is the font-variant-numeric property using a list of tokens or a composed value.

Sourceval font_variant_numeric_tokens : font_variant_numeric_token list -> font_variant_numeric

font_variant_numeric_tokens tokens is a font-variant-numeric value from tokens.

Sourceval font_variant_numeric_composed : ?ordinal:font_variant_numeric_token -> ?slashed_zero:font_variant_numeric_token -> ?numeric_figure:font_variant_numeric_token -> ?numeric_spacing:font_variant_numeric_token -> ?numeric_fraction:font_variant_numeric_token -> unit -> font_variant_numeric

font_variant_numeric_composed ... is a composed font-variant-numeric value using CSS variables for style composition.

Sourceval font_feature_settings : font_feature_settings -> declaration

font_feature_settings settings is the font-feature-settings property.

type shadow_body = Properties.shadow_body = {
  1. h_offset : length;
  2. v_offset : length;
  3. blur : length option;
  4. spread : length option;
  5. color : color option;
}

CSS shadow values

The <length>{2,4} && <color>? part of a single <shadow>.

and inset = Properties.inset =
  1. | Var of shadow var
    (*

    inset var(--x): the whole body from one var.

    *)
  2. | Body of shadow_body
    (*

    inset 2px 4px red: a concrete inset body.

    *)
  3. | Toggle of {
    1. name : string;
    2. no_fallback : bool;
    3. body : shadow_body;
    }
    (*

    var(--name) <body>: a dynamic inset toggle (Tailwind's ring system).

    *)
and shadow = Properties.shadow =
  1. | Shadow of shadow_body
    (*

    A non-inset shadow.

    *)
  2. | Inset of inset
    (*

    An inset shadow.

    *)
  3. | None
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | List of shadow list
  10. | Var of shadow var
val shadow : ?inset:bool -> ?inset_var:string -> ?inset_var_no_fallback:bool -> ?h_offset:length -> ?v_offset:length -> ?blur:length -> ?spread:length -> ?color:color -> unit -> shadow

shadow ?inset ?inset_var ?inset_var_no_fallback ?h_offset ?v_offset ?blur ?spread ?color () is a shadow value with optional parameters. When inset_var is set, outputs var(--<name>,) (with empty fallback) or var(--<name>) (no fallback, when inset_var_no_fallback is true) before the shadow values. Used by Tailwind's ring system. Defaults: inset=false, inset_var=None, inset_var_no_fallback=false, h_offset=0px, v_offset=0px, blur=0px, spread=0px, color=Transparent.

type text_shadow = Properties.text_shadow =
  1. | None
  2. | Text_shadow of {
    1. h_offset : length;
    2. v_offset : length;
    3. blur : length option;
    4. color : color option;
    }
  3. | Initial
  4. | Inherit
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of text_shadow var

CSS text-shadow values

Sourceval text_shadow_value : ?blur:length -> ?color:color -> length -> length -> text_shadow

text_shadow_value ?blur ?color x y is a single text-shadow value.

Sourceval text_shadow : text_shadow -> declaration

text_shadow shadow is the text-shadow property.

Sourceval text_shadows : text_shadow list -> declaration

text_shadows shadows is the text-shadow property with multiple shadows.

Sourceval font : font -> declaration

font spec is the font shorthand property.

type direction = Properties.direction =
  1. | Ltr
  2. | Rtl
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of direction var

CSS direction values

Sourceval direction : direction -> declaration

direction dir is the direction property.

type unicode_bidi = Properties.unicode_bidi =
  1. | Normal
  2. | Embed
  3. | Isolate
  4. | Bidi_override
  5. | Isolate_override
  6. | Plaintext
  7. | Inherit
  8. | Initial
  9. | Unset
  10. | Revert
  11. | Revert_layer
  12. | Var of unicode_bidi var

CSS unicode-bidi values

Sourceval unicode_bidi : unicode_bidi -> declaration

unicode_bidi bidi is the unicode-bidi property.

type writing_mode = Properties.writing_mode =
  1. | Horizontal_tb
  2. | Vertical_rl
  3. | Vertical_lr
  4. | Sideways_lr
  5. | Sideways_rl
  6. | Inherit
  7. | Initial
  8. | Unset
  9. | Revert
  10. | Revert_layer
  11. | Var of writing_mode var

CSS writing-mode values

type text_combine_upright = Properties.text_combine_upright =
  1. | None
  2. | All
  3. | Digits of int option
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of text_combine_upright var
Sourceval writing_mode : writing_mode -> declaration

writing_mode mode is the writing-mode property.

Sourceval text_combine_upright : text_combine_upright -> declaration

text_combine_upright value is the CSS text-combine-upright property.

Sourceval text_decoration_thickness : length -> declaration

text_decoration_thickness thick is the text-decoration-thickness property.

type text_decoration_skip_ink = Properties.text_decoration_skip_ink =
  1. | Auto
  2. | None
  3. | All
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of text_decoration_skip_ink var

CSS text-decoration-skip-ink values

Sourceval text_decoration_skip_ink : text_decoration_skip_ink -> declaration

text_decoration_skip_ink skip is the text-decoration-skip-ink property.

type text_decoration_skip = Properties.text_decoration_skip =
  1. | None
  2. | Auto
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of text_decoration_skip var

CSS Text Decoration 4 text-decoration-skip: the shorthand over the four longhands below.

Sourceval text_decoration_skip : text_decoration_skip -> declaration

text_decoration_skip v is the text-decoration-skip shorthand.

type text_decoration_skip_self = Properties.text_decoration_skip_self =
  1. | None
  2. | Objects
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of text_decoration_skip_self var

Sec. 2.5.1 text-decoration-skip-self: whether the box's own decoration skips it.

Sourceval text_decoration_skip_self : text_decoration_skip_self -> declaration

text_decoration_skip_self v is the text-decoration-skip-self property.

type text_decoration_skip_box = Properties.text_decoration_skip_box =
  1. | All
  2. | None
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of text_decoration_skip_box var

Sec. 2.5.2 text-decoration-skip-box: whether an ancestor's decoration skips the box's edges.

Sourceval text_decoration_skip_box : text_decoration_skip_box -> declaration

text_decoration_skip_box v is the text-decoration-skip-box property.

type text_decoration_skip_inset = Properties.text_decoration_skip_inset =
  1. | None
  2. | Auto
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of text_decoration_skip_inset var

Sec. 2.5.3 text-decoration-skip-inset: whether the decoration is inset from the glyph edges.

Sourceval text_decoration_skip_inset : text_decoration_skip_inset -> declaration

text_decoration_skip_inset v is the text-decoration-skip-inset property.

type text_decoration_skip_space = Properties.text_decoration_skip_space =
  1. | All
  2. | Start
  3. | End

Sec. 2.5.4: one span of spaces a decoration skips.

type text_decoration_skip_spaces = Properties.text_decoration_skip_spaces =
  1. | Spaces of text_decoration_skip_space list
  2. | Inherit
  3. | Initial
  4. | Unset
  5. | Revert
  6. | Revert_layer
  7. | Var of text_decoration_skip_spaces var

Sec. 2.5.4 text-decoration-skip-spaces.

Sourceval text_decoration_skip_spaces : text_decoration_skip_spaces -> declaration

text_decoration_skip_spaces v is the text-decoration-skip-spaces property.

type text_emphasis_skip_keyword = Properties.text_emphasis_skip_keyword =
  1. | Spaces
  2. | Punctuation
  3. | Symbols
  4. | Narrow

One class of character the emphasis marks skip, for CSS Text Decoration 4 text-emphasis-skip.

type text_emphasis_skip = Properties.text_emphasis_skip =
  1. | Skip of text_emphasis_skip_keyword list
  2. | Inherit
  3. | Initial
  4. | Unset
  5. | Revert
  6. | Revert_layer
  7. | Var of text_emphasis_skip var

Sec. 4.3 text-emphasis-skip.

Sourceval text_emphasis_skip : text_emphasis_skip -> declaration

text_emphasis_skip v is the text-emphasis-skip property.

type white_space_collapse = Properties.white_space_collapse =
  1. | Collapse
  2. | Discard
  3. | Preserve
  4. | Preserve_breaks
  5. | Preserve_spaces
  6. | Break_spaces
  7. | Inherit
  8. | Initial
  9. | Unset
  10. | Revert
  11. | Revert_layer
  12. | Var of white_space_collapse var

CSS Text 4 white-space-collapse: how white space and line breaks collapse.

Sourceval white_space_collapse : white_space_collapse -> declaration

white_space_collapse v is the white-space-collapse property.

Sourceval line_height_step : length -> declaration

line_height_step v is the line-height-step property.

type font_palette = Properties.font_palette =
  1. | Normal
  2. | Light
  3. | Dark
  4. | Palette of string
  5. | Initial
  6. | Inherit
  7. | Unset
  8. | Revert
  9. | Revert_layer
  10. | Var of font_palette var

CSS Fonts 4 font-palette.

Sourceval font_palette : font_palette -> declaration

font_palette v is the font-palette property.

type font_synthesis_feature = Properties.font_synthesis_feature =
  1. | Weight
  2. | Style
  3. | Small_caps
  4. | Position

One face the browser may synthesise, for CSS Fonts 4 font-synthesis.

type font_synthesis = Properties.font_synthesis =
  1. | None
  2. | Features of font_synthesis_feature list
  3. | Initial
  4. | Inherit
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of font_synthesis var

CSS Fonts 4 font-synthesis.

Sourceval font_synthesis : font_synthesis -> declaration

font_synthesis v is the font-synthesis shorthand.

Sourceval font_size_adjust : font_size_adjust -> declaration

font_size_adjust v is the font-size-adjust property.

Sourceval font_variant_emoji : font_variant_emoji -> declaration

font_variant_emoji v is the font-variant-emoji property.

type font_variant_alternates_item = Properties.font_variant_alternates_item =
  1. | Stylistic of string
  2. | Historical_forms
  3. | Styleset of string list
  4. | Character_variant of string list
  5. | Swash of string
  6. | Ornaments of string
  7. | Annotation of string

One feature of CSS Fonts 4 font-variant-alternates.

type font_variant_alternates = Properties.font_variant_alternates =
  1. | Normal
  2. | Alternates of font_variant_alternates_item list
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of font_variant_alternates var
Sourceval font_variant_alternates : font_variant_alternates -> declaration

font_variant_alternates v is the font-variant-alternates property.

type font_variant_shorthand = Properties.font_variant_shorthand = {
  1. ligatures : font_variant_ligature list;
  2. alternates : font_variant_alternates_item list;
  3. caps : font_variant_caps option;
  4. numeric : font_variant_numeric_token list;
  5. east_asian : east_asian_feature list;
  6. position : font_variant_position option;
  7. emoji : font_variant_emoji option;
}

The slots of the CSS Fonts 4 font-variant shorthand.

type font_variant = Properties.font_variant =
  1. | Normal
  2. | None
  3. | Shorthand of font_variant_shorthand
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of font_variant var

CSS Fonts 4 font-variant.

Sourceval font_variant : font_variant -> declaration

font_variant v is the font-variant shorthand.

Sourceval text_wrap_style : text_wrap_style -> declaration

text_wrap_style v is the text-wrap-style property.

Sourceval text_box_trim : text_box_trim -> declaration

text_box_trim v is the text-box-trim property.

type text_box = Properties.text_box =
  1. | Normal
  2. | Box of text_box_trim option * text_box_edge option
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of text_box var

CSS Inline 3 text-box: normal | <'text-box-trim'> || <'text-box-edge'>.

Sourceval text_box : text_box -> declaration

text_box v is the text-box shorthand.

Sourceval text_spacing_trim : text_spacing_trim -> declaration

text_spacing_trim v is the text-spacing-trim property.

Sourceval hyphenate_limit_chars : hyphenate_limit_chars -> declaration

hyphenate_limit_chars v is the hyphenate-limit-chars property.

Sourceval initial_letter : initial_letter -> declaration

initial_letter v is the initial-letter property.

type initial_letter_align_keyword = Properties.initial_letter_align_keyword =
  1. | Alphabetic
  2. | Ideographic
  3. | Hanging
  4. | Leading
  5. | Border_box

One alignment point of CSS Inline 3 initial-letter-align.

type initial_letter_align = Properties.initial_letter_align =
  1. | Align of initial_letter_align_keyword list
  2. | Inherit
  3. | Initial
  4. | Unset
  5. | Revert
  6. | Revert_layer
  7. | Var of initial_letter_align var

CSS Inline 3 initial-letter-align.

Sourceval initial_letter_align : initial_letter_align -> declaration

initial_letter_align v is the initial-letter-align property.

type initial_letter_wrap = Properties.initial_letter_wrap =
  1. | None
  2. | First
  3. | All
  4. | Grid
  5. | Length of length_percentage
  6. | Inherit
  7. | Initial
  8. | Unset
  9. | Revert
  10. | Revert_layer
  11. | Var of initial_letter_wrap var

CSS Inline 3 initial-letter-wrap.

Sourceval initial_letter_wrap : initial_letter_wrap -> declaration

initial_letter_wrap v is the initial-letter-wrap property.

type shape_image_threshold = Properties.shape_image_threshold =
  1. | Number of float
  2. | Calc of shape_image_threshold calc
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of shape_image_threshold var

CSS Shapes 1 shape-image-threshold: the alpha above which a pixel of the shape image is inside the shape.

Sourceval shape_image_threshold : shape_image_threshold -> declaration

shape_image_threshold v is the shape-image-threshold property.

Sourceval shape_margin : length_percentage -> declaration

shape_margin v is the shape-margin property.

Sourceval shape_outside : string -> declaration

shape_outside v is the shape-outside property, held as the authored text of its shape.

type overflow_clip_box = Properties.overflow_clip_box =
  1. | Content_box
  2. | Padding_box
  3. | Border_box

CSS Box 4 <visual-box>: the box edge an overflow clip margin is measured from.

type overflow_clip_margin = Properties.overflow_clip_margin =
  1. | Clip_margin of overflow_clip_box option * length option
  2. | Initial
  3. | Inherit
  4. | Unset
  5. | Revert
  6. | Revert_layer
  7. | Var of overflow_clip_margin var

CSS Overflow 4 overflow-clip-margin: <visual-box> || <length>.

Sourceval overflow_clip_margin : overflow_clip_margin -> declaration

overflow_clip_margin v is the overflow-clip-margin property.

type overflow_anchor = Properties.overflow_anchor =
  1. | Auto
  2. | None
  3. | Initial
  4. | Inherit
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of overflow_anchor var

CSS Scroll Anchoring 1 overflow-anchor.

Sourceval overflow_anchor : overflow_anchor -> declaration

overflow_anchor v is the overflow-anchor property.

Sourceval overflow_block : overflow -> declaration

overflow_block v is the overflow-block property.

Sourceval overflow_inline : overflow -> declaration

overflow_inline v is the overflow-inline property.

type image_orientation = Properties.image_orientation =
  1. | None
  2. | From_image
  3. | Initial
  4. | Inherit
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of image_orientation var

CSS Images 3 image-orientation.

Sourceval image_orientation : image_orientation -> declaration

image_orientation v is the image-orientation property.

type image_rendering = Properties.image_rendering =
  1. | Auto
  2. | Smooth
  3. | High_quality
  4. | Crisp_edges
  5. | Pixelated
  6. | Initial
  7. | Inherit
  8. | Unset
  9. | Revert
  10. | Revert_layer
  11. | Var of image_rendering var

CSS Images 3 image-rendering.

Sourceval image_rendering : image_rendering -> declaration

image_rendering v is the image-rendering property.

type resolution = Properties.resolution =
  1. | Dpi of float
  2. | Dpcm of float
  3. | Dppx of float
  4. | X of float

CSS Values 4 <resolution>.

type image_resolution = Properties.image_resolution =
  1. | Resolution of resolution
  2. | From_image
  3. | From_image_resolution of resolution
  4. | Snap of resolution
  5. | From_image_snap
  6. | From_image_snap_resolution of resolution
  7. | Initial
  8. | Inherit
  9. | Unset
  10. | Revert
  11. | Revert_layer
  12. | Var of image_resolution var

CSS Images 4 image-resolution: [ from-image || <resolution> ] && snap?.

Sourceval image_resolution : image_resolution -> declaration

image_resolution v is the image-resolution property.

type margin_trim_axis = Properties.margin_trim_axis =
  1. | Block
  2. | Inline

One axis whose margins CSS Box 4 margin-trim trims.

type margin_trim_edge = Properties.margin_trim_edge =
  1. | Block_start
  2. | Inline_start
  3. | Block_end
  4. | Inline_end

One edge whose margin CSS Box 4 margin-trim trims.

type margin_trim = Properties.margin_trim =
  1. | None
  2. | Block
  3. | Inline
  4. | Axes of margin_trim_axis list
  5. | Edges of margin_trim_edge list
  6. | Initial
  7. | Inherit
  8. | Unset
  9. | Revert
  10. | Revert_layer
  11. | Var of margin_trim var

CSS Box 4 margin-trim.

Sourceval margin_trim : margin_trim -> declaration

margin_trim v is the margin-trim property.

type overlay = Properties.overlay =
  1. | Auto
  2. | None
  3. | Initial
  4. | Inherit
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of overlay var

CSS Positioned Layout 4 overlay: whether the box is in the top layer.

Sourceval overlay : overlay -> declaration

overlay v is the overlay property.

type animation_composition_item = Properties.animation_composition_item =
  1. | Replace
  2. | Add
  3. | Accumulate

How one animation composes with the value beneath it, for CSS Animations 2 animation-composition.

type animation_composition = Properties.animation_composition =
  1. | Compositions of animation_composition_item list
  2. | Initial
  3. | Inherit
  4. | Unset
  5. | Revert
  6. | Revert_layer
  7. | Var of animation_composition var

CSS Animations 2 animation-composition.

Sourceval animation_composition : animation_composition -> declaration

animation_composition v is the animation-composition property.

type position_axis_edge = Properties.position_axis_edge =
  1. | Left
  2. | Right
  3. | Top
  4. | Bottom

One physical edge a <position> offsets from, for CSS Backgrounds 4 background-position-x.

type background_position_axis = Properties.background_position_axis =
  1. | Center
  2. | Edge of position_axis_edge
  3. | Offset of length_percentage
  4. | Edge_offset of position_axis_edge * length_percentage
  5. | Layers of background_position_axis list
    (*

    CSS Backgrounds 4 sec. 3.6 spells the axis longhand with the same # the pair carries, so it names one position per background layer.

    *)
  6. | Inherit
  7. | Initial
  8. | Unset
  9. | Revert
  10. | Revert_layer
  11. | Var of background_position_axis var

One axis of CSS Backgrounds 4 background-position-x.

Sourceval background_position_x : background_position_axis -> declaration

background_position_x v is the background-position-x property.

Sourceval background_position_y : background_position_axis -> declaration

background_position_y v is the background-position-y property.

Sourceval webkit_mask_position_x : background_position_axis -> declaration

webkit_mask_position_x v is the -webkit-mask-position-x property.

Sourceval webkit_mask_position_y : background_position_axis -> declaration

webkit_mask_position_y v is the -webkit-mask-position-y property.

moz_orient v is the -moz-orient property.

type webkit_text_stroke = Properties.webkit_text_stroke = {
  1. width : border_width option;
  2. color : color option;
}

-webkit-text-stroke: a width and a colour, either of which may be absent. No CSS specification defines it.

Sourceval webkit_text_stroke : webkit_text_stroke -> declaration

webkit_text_stroke v is the -webkit-text-stroke shorthand.

Sourceval page_size : page_size -> declaration

page_size v is the size descriptor of an @page rule.

grid v is the grid shorthand.

Borders & Outlines

Properties for styling element borders, outlines, and related decorative features including border radius for rounded corners.

type border_style = Properties.border_style =
  1. | None
  2. | Solid
  3. | Dashed
  4. | Dotted
  5. | Double
  6. | Groove
  7. | Ridge
  8. | Inset
  9. | Outset
  10. | Hidden
  11. | Inherit
  12. | Initial
  13. | Unset
  14. | Revert
  15. | Revert_layer
  16. | Var of border_style var

CSS border style values.

type border_shorthand = Properties.border_shorthand = {
  1. width : border_width option;
  2. style : border_style option;
  3. color : color option;
}

CSS border shorthand type.

type border = Properties.border =
  1. | Inherit
  2. | Initial
  3. | Unset
  4. | Revert
  5. | Revert_layer
  6. | None
  7. | Shorthand of border_shorthand
  8. | Var of border var

CSS border property values.

type logical_border_color = Properties.logical_border_color =
  1. | Single of color
  2. | Pair of color * color
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of logical_border_color var
Sourceval logical_border_color : color -> logical_border_color

logical_border_color color is a one-value logical border color.

Sourceval logical_border_colors : color -> color -> logical_border_color

logical_border_colors start end_ is a two-value logical border color.

type logical_border_width = Properties.logical_border_width =
  1. | Single of border_width
  2. | Pair of border_width * border_width
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of logical_border_width var
Sourceval logical_border_width : border_width -> logical_border_width

logical_border_width w is a one-value logical border width.

Sourceval logical_border_widths : border_width -> border_width -> logical_border_width

logical_border_widths start end_ is a two-value logical border width.

type logical_border_style = Properties.logical_border_style =
  1. | Single of border_style
  2. | Pair of border_style * border_style
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of logical_border_style var
Sourceval logical_border_style : border_style -> logical_border_style

logical_border_style s is a one-value logical border style.

Sourceval logical_border_styles : border_style -> border_style -> logical_border_style

logical_border_styles start end_ is a two-value logical border style.

type outline_style = Properties.outline_style =
  1. | None
  2. | Solid
  3. | Dashed
  4. | Dotted
  5. | Double
  6. | Groove
  7. | Ridge
  8. | Inset
  9. | Outset
  10. | Auto
  11. | Inherit
  12. | Initial
  13. | Unset
  14. | Revert
  15. | Revert_layer
  16. | Var of outline_style var

CSS outline style values.

type outline_shorthand = Properties.outline_shorthand = {
  1. width : border_width option;
  2. style : outline_style option;
  3. color : color option;
}

CSS outline shorthand components.

type outline = Properties.outline =
  1. | Inherit
  2. | Initial
  3. | Unset
  4. | Revert
  5. | Revert_layer
  6. | None
  7. | Shorthand of outline_shorthand
  8. | Var of outline var

CSS outline property values.

Sourceval outline_shorthand : ?width:border_width -> ?style:outline_style -> ?color:color -> unit -> outline

outline_shorthand ?width ?style ?color () is the outline shorthand.

val border_shorthand : ?width:border_width -> ?style:border_style -> ?color:color -> unit -> border

border_shorthand ?width ?style ?color () is the border shorthand.

  • width: border width (thin, medium, thick, or specific length)
  • style: border style (solid, dashed, dotted, etc.)
  • color: border color.
Sourceval border : ?width:border_width -> ?style:border_style -> ?color:color -> unit -> declaration

border border is the border shorthand property.

Sourceval column_rule : border list -> declaration

column_rule v is the column-rule shorthand property.

CSS Gaps 1 gives each gap decoration longhand a comma-separated list, one entry per rule line, where column_rule writes one.

CSS Logical 1 gives the flow-relative borders the same shorthand shape the physical ones have.

Sourceval border_block_start : border -> declaration

border_block_start v is the border-block-start shorthand.

Sourceval border_block_end : border -> declaration

border_block_end v is the border-block-end shorthand.

Sourceval border_inline : border -> declaration

border_inline v is the border-inline shorthand.

Sourceval border_inline_start : border -> declaration

border_inline_start v is the border-inline-start shorthand.

Sourceval border_inline_end : border -> declaration

border_inline_end v is the border-inline-end shorthand.

Sourceval column_rule_width : border_width list -> declaration

column_rule_width v is the column-rule-width longhand, one entry per gap decoration line.

Sourceval column_rule_style : border_style list -> declaration

column_rule_style v is the column-rule-style longhand, one entry per gap decoration line.

Sourceval column_rule_color : color list -> declaration

column_rule_color v is the column-rule-color longhand, one entry per gap decoration line.

type border_image_slice_item = Properties.border_image_slice_item =
  1. | Number of number
  2. | Pct of float
  3. | Calc of border_image_slice_item calc

One offset of CSS Backgrounds 3 border-image-slice, a number in units of the image's own pixels or a percentage of its size.

type border_image_slice_offsets = Properties.border_image_slice_offsets = {
  1. offsets : border_image_slice_item list;
  2. fill : bool;
}

Sec. 5.2: the one to four offsets and the fill keyword.

type border_image_slice = Properties.border_image_slice =
  1. | Slices of border_image_slice_offsets
  2. | Inherit
  3. | Initial
  4. | Unset
  5. | Revert
  6. | Revert_layer
  7. | Var of border_image_slice var

Sec. 5.2 border-image-slice.

Sourceval border_image_slice : border_image_slice -> declaration

border_image_slice v is the border-image-slice property.

type border_image_width_item = Properties.border_image_width_item =
  1. | Number of number
  2. | Pct of float
  3. | Length of length
  4. | Auto

Sec. 5.3: one border-image-width, which unlike a border width takes a bare number as a multiple of the border width.

type border_image_width = Properties.border_image_width =
  1. | Widths of border_image_width_item list
  2. | Inherit
  3. | Initial
  4. | Unset
  5. | Revert
  6. | Revert_layer
  7. | Var of border_image_width var

Sec. 5.3 border-image-width.

Sourceval border_image_width : border_image_width -> declaration

border_image_width v is the border-image-width property.

type border_image_outset_item = Properties.border_image_outset_item =
  1. | Number of number
  2. | Length of length

Sec. 5.4: one border-image-outset, a number or a length.

type border_image_outset = Properties.border_image_outset =
  1. | Outsets of border_image_outset_item list
  2. | Inherit
  3. | Initial
  4. | Unset
  5. | Revert
  6. | Revert_layer
  7. | Var of border_image_outset var

Sec. 5.4 border-image-outset.

Sourceval border_image_outset : border_image_outset -> declaration

border_image_outset v is the border-image-outset property.

type border_image_repeat_keyword = Properties.border_image_repeat_keyword =
  1. | Stretch
  2. | Repeat
  3. | Round
  4. | Space

Sec. 5.5: how the middle of an edge is filled.

type border_image_repeat = Properties.border_image_repeat =
  1. | Repeats of border_image_repeat_keyword list
  2. | Inherit
  3. | Initial
  4. | Unset
  5. | Revert
  6. | Revert_layer
  7. | Var of border_image_repeat var

Sec. 5.5 border-image-repeat: the block edge then the inline edge.

Sourceval border_image_repeat : border_image_repeat -> declaration

border_image_repeat v is the border-image-repeat property.

Sourceval border_image_source : background_image -> declaration

border_image_source v is the border-image-source property.

type mask_border_mode = Properties.mask_border_mode =
  1. | Alpha
  2. | Luminance

CSS Masking 1 mask-border-mode: which channel of the source image is the mask.

type border_image = Properties.border_image = {
  1. source : background_image option;
  2. slice : border_image_slice_offsets option;
  3. width : border_image_width_item list option;
  4. outset : border_image_outset_item list option;
  5. repeat : border_image_repeat_keyword list option;
  6. mode : mask_border_mode option;
}

CSS Backgrounds 3 border-image and CSS Masking 1 mask-border, which share every slot but the mode only the mask carries.

Sourceval border_image : border_image -> declaration

border_image v is the border-image shorthand.

Sourceval mask_border : border_image -> declaration

mask_border v is the mask-border shorthand, which takes what border-image takes plus the mode slot.

Sourceval border_width : border_width -> declaration

border_width width is the border-width property.

Sourceval border_style : border_style -> declaration

border_style style is the border-style property.

Sourceval border_color : color -> declaration

border_color color is the border-color property.

Sourceval border_block : border -> declaration

border_block v is the border-block shorthand property.

Sourceval border_inline_color : logical_border_color -> declaration

border_inline_color v is the border-inline-color property.

Sourceval border_block_color : logical_border_color -> declaration

border_block_color v is the border-block-color property.

Sourceval border_inline_width : logical_border_width -> declaration

border_inline_width v is the border-inline-width property.

Sourceval border_block_width : logical_border_width -> declaration

border_block_width v is the border-block-width property.

Sourceval border_radius : border_radius -> declaration

border_radius v is the border-radius property; takes a typed value with 1-4 horizontal radii and optional 1-4 vertical radii separated by val-/.

Sourceval border_top_left_radius : length -> declaration

border_top_left_radius radius is the border-top-left-radius property.

Sourceval border_top_right_radius : length -> declaration

border_top_right_radius radius is the border-top-right-radius property.

Sourceval border_bottom_left_radius : length -> declaration

border_bottom_left_radius radius is the border-bottom-left-radius property.

Sourceval border_bottom_right_radius : length -> declaration

border_bottom_right_radius radius is the border-bottom-right-radius property.

Sourceval border_top : border -> declaration

border_top border is the border-top property.

Sourceval border_right : border -> declaration

border_right border is the border-right property.

Sourceval border_bottom : border -> declaration

border_bottom border is the border-bottom property.

Sourceval border_left : border -> declaration

border_left border is the border-left property.

Sourceval outline : outline -> declaration

outline outline is the outline property.

Sourceval outline_width : border_width -> declaration

outline_width width is the outline-width property.

Sourceval outline_style : outline_style -> declaration

outline_style style is the outline-style property.

Sourceval outline_color : color -> declaration

outline_color color is the outline-color property.

Sourceval outline_offset : length -> declaration

outline_offset offset is the outline-offset property.

Sourceval border_top_style : border_style -> declaration

border_top_style s is the border-top-style property.

Sourceval border_right_style : border_style -> declaration

border_right_style s is the border-right-style property.

Sourceval border_bottom_style : border_style -> declaration

border_bottom_style s is the border-bottom-style property.

Sourceval border_left_style : border_style -> declaration

border_left_style s is the border-left-style property.

Sourceval border_inline_style : logical_border_style -> declaration

border_inline_style s is the border-inline-style property.

Sourceval border_block_style : logical_border_style -> declaration

border_block_style s is the border-block-style property.

Sourceval border_inline_start_style : border_style -> declaration

border_inline_start_style s is the border-inline-start-style property.

Sourceval border_inline_end_style : border_style -> declaration

border_inline_end_style s is the border-inline-end-style property.

Sourceval border_block_start_style : border_style -> declaration

border_block_start_style s is the border-block-start-style property.

Sourceval border_block_end_style : border_style -> declaration

border_block_end_style s is the border-block-end-style property.

Sourceval border_start_start_radius : length -> declaration

border_start_start_radius len is the border-start-start-radius property.

Sourceval border_start_end_radius : length -> declaration

border_start_end_radius len is the border-start-end-radius property.

Sourceval border_end_start_radius : length -> declaration

border_end_start_radius len is the border-end-start-radius property.

Sourceval border_end_end_radius : length -> declaration

border_end_end_radius len is the border-end-end-radius property.

Sourceval border_left_width : border_width -> declaration

border_left_width len is the border-left-width property.

Sourceval border_top_width : border_width -> declaration

border_top_width len is the border-top-width property.

Sourceval border_right_width : border_width -> declaration

border_right_width len is the border-right-width property.

Sourceval border_bottom_width : border_width -> declaration

border_bottom_width len is the border-bottom-width property.

Sourceval border_top_color : color -> declaration

border_top_color c is the border-top-color property.

Sourceval border_right_color : color -> declaration

border_right_color c is the border-right-color property.

Sourceval border_bottom_color : color -> declaration

border_bottom_color c is the border-bottom-color property.

Sourceval border_left_color : color -> declaration

border_left_color c is the border-left-color property.

type border_collapse = Properties.border_collapse =
  1. | Collapse
  2. | Separate
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of border_collapse var

CSS border-collapse values

Sourceval border_collapse : border_collapse -> declaration

border_collapse value is the border-collapse property.

Transforms & Animations

Properties for 2D/3D transformations, CSS animations, and transitions. Based on multiple CSS specification modules for comprehensive animation support.

type transform = Properties.transform =
  1. | Translate of length * length option
  2. | Translate_x of length
  3. | Translate_y of length
  4. | Translate_z of length
  5. | Translate_3d of length * length * length
  6. | Rotate of angle
  7. | Rotate_x of angle
  8. | Rotate_y of angle
  9. | Rotate_z of angle
  10. | Rotate_3d of float * float * float * angle
  11. | Rotate_axis of float * float * float * angle
  12. | Scale of number_percentage * number_percentage option
  13. | Scale_space of number_percentage * number_percentage
  14. | Scale_x of number_percentage
  15. | Scale_y of number_percentage
  16. | Scale_z of number_percentage
  17. | Scale_3d of number_percentage * number_percentage * number_percentage
  18. | Skew of angle * angle option
  19. | Skew_x of angle
  20. | Skew_y of angle
  21. | Matrix of float * float * float * float * float * float
  22. | Matrix_3d of float * float * float * float * float * float * float * float * float * float * float * float * float * float * float * float
  23. | Perspective of length
  24. | None
  25. | Inherit
  26. | Initial
  27. | Unset
  28. | Revert
  29. | Revert_layer
  30. | List of transform list
  31. | Var of transform var

CSS transform values

Sourceval transform_list : transform list -> transform

transform_list items is a multi-function transform value.

Sourceval transform : transform -> declaration

transform t is the transform property with a single transformation.

Sourceval transforms : transform list -> declaration

transforms ts is the transform property with multiple transformations.

type transform_origin = Properties.transform_origin =
  1. | Center
  2. | Center_center
  3. | Left
  4. | Right
  5. | Top
  6. | Bottom
  7. | Left_top
  8. | Left_center
  9. | Left_bottom
  10. | Right_top
  11. | Right_center
  12. | Right_bottom
  13. | Center_top
  14. | Center_bottom
  15. | Top_left
  16. | Top_right
  17. | Bottom_left
  18. | Bottom_right
  19. | Position of position_value
  20. | X of length
    (*

    Single x-offset, y defaults to 50%.

    *)
  21. | XY of length * length
  22. | XYZ of length * length * length
  23. | Position_z of position_value * length
  24. | Initial
  25. | Inherit
    (*

    Transform origin (2D or 3D).

    *)
  26. | Unset
  27. | Revert
  28. | Revert_layer
  29. | Var of transform_origin var
val origin : length -> length -> transform_origin

origin x y is a transform-origin helper for 2D positions.

val origin3d : length -> length -> length -> transform_origin

origin3d x y z is a transform-origin helper for 3D positions.

Sourceval transform_origin : transform_origin -> declaration

transform_origin origin is the transform-origin property.

type transform_box = Properties.transform_box =
  1. | Content_box
  2. | Border_box
  3. | Fill_box
  4. | Stroke_box
  5. | View_box
  6. | Initial
  7. | Inherit
  8. | Unset
  9. | Revert
  10. | Revert_layer
  11. | Var of transform_box var

CSS transform-box property values

Sourceval transform_box : transform_box -> declaration

transform_box value is the transform-box property.

type rotate_value = Properties.rotate_value =
  1. | Angle of angle
    (*

    z-axis rotation

    *)
  2. | X of angle
    (*

    x-axis rotation

    *)
  3. | Y of angle
    (*

    y-axis rotation

    *)
  4. | Z of angle
    (*

    z-axis rotation (explicit)

    *)
  5. | Axis of float * float * float * angle
    (*

    custom axis rotation

    *)
  6. | None
  7. | Inherit
  8. | Initial
  9. | Unset
  10. | Revert
  11. | Revert_layer
  12. | Var of rotate_value var

CSS rotate property values

rotate v is the rotate property.

Sourceval perspective : length -> declaration

perspective perspective is the perspective property (3D transforms).

type perspective_origin = position_value

CSS perspective-origin values for 3D transforms.

Sourceval perspective_origin : perspective_origin -> declaration

perspective_origin origin is the perspective-origin property.

type transform_style = Properties.transform_style =
  1. | Flat
  2. | Preserve_3d
  3. | Initial
  4. | Inherit
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of transform_style var

CSS transform-style values

Sourceval transform_style : transform_style -> declaration

transform_style style is the transform-style property (3D transforms).

type steps_direction = Properties.steps_direction =
  1. | Jump_start
  2. | Jump_end
  3. | Jump_none
  4. | Jump_both
  5. | Start
  6. | End
  7. | Var of steps_direction var

CSS steps direction values.

type timing_function = Properties.timing_function =
  1. | Ease
  2. | Linear
  3. | Ease_in
  4. | Ease_out
  5. | Ease_in_out
  6. | Step_start
  7. | Step_end
  8. | Steps of int * steps_direction option
  9. | Cubic_bezier of float * float * float * float
  10. | Linear_function of string
  11. | Timing_functions of timing_function list
  12. | Inherit
  13. | Initial
  14. | Unset
  15. | Revert
  16. | Revert_layer
  17. | Var of timing_function var

CSS animation timing function values.

type duration = Values.duration =
  1. | Ms of float
    (*

    milliseconds

    *)
  2. | S of float
    (*

    seconds

    *)
  3. | Auto
    (*

    animation-duration only

    *)
  4. | Durations of duration list
    (*

    comma-separated list of durations

    *)
  5. | Round of string * duration * duration
  6. | Mod of duration * duration
  7. | Rem of duration * duration
  8. | Inherit
  9. | Initial
  10. | Unset
  11. | Revert
  12. | Revert_layer
  13. | Var of duration var
    (*

    CSS variable reference

    *)
  14. | Calc of duration calc

CSS duration values.

type transition_property_value = Properties.transition_property_value =
  1. | All
  2. | None
  3. | Property of string
  4. | Initial
  5. | Inherit
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of transition_property_value var

CSS transition property value.

type transition_property = transition_property_value list

CSS transition property (list of property values).

type transition_behavior = Properties.transition_behavior =
  1. | Normal
  2. | Allow_discrete
  3. | Behaviors of transition_behavior list
    (*

    The <transition-behavior-value># list of two or more behaviours.

    *)
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of transition_behavior var

CSS transition-behavior values (Transitions Level 2).

type transition_shorthand = Properties.transition_shorthand = {
  1. property : transition_property_value;
  2. duration : duration option;
  3. timing_function : timing_function option;
  4. delay : duration option;
  5. behavior : transition_behavior option;
}

CSS transition shorthand values.

type transition = Properties.transition =
  1. | Inherit
  2. | Initial
  3. | Unset
  4. | Revert
  5. | Revert_layer
  6. | None
  7. | Shorthand of transition_shorthand
    (*

    CSS transition values.

    *)
  8. | Var of transition var
val transition_shorthand : ?property:transition_property_value -> ?duration:duration -> ?timing_function:timing_function -> ?delay:duration -> ?behavior:transition_behavior -> unit -> transition

transition_shorthand ?property ?duration ?timing_function ?delay ?behavior () is the transition shorthand.

  • property: CSS property to transition (defaults to All)
  • duration: transition duration
  • timing_function: easing function (ease, linear, ease-in, etc.)
  • delay: delay before transition starts
  • behavior: transition-behavior (Transitions Level 2).
Sourceval transition : transition -> declaration

transition transition is the transition property.

Sourceval transitions : transition list -> declaration

transitions values is the transition property from a comma-separated list.

Sourceval transition_timing_function : timing_function -> declaration

transition_timing_function tf is the transition-timing-function property.

Sourceval transition_duration : duration -> declaration

transition_duration dur is the transition-duration property.

Sourceval transition_delay : duration -> declaration

transition_delay delay is the transition-delay property.

Sourceval transition_property : transition_property -> declaration

transition_property v is the transition-property property.

transition_behavior v is the transition-behavior property.

type animation_fill_mode = Properties.animation_fill_mode =
  1. | None
  2. | Forwards
  3. | Backwards
  4. | Both
  5. | Fill_modes of animation_fill_mode list
  6. | Initial
  7. | Inherit
  8. | Unset
  9. | Revert
  10. | Revert_layer
  11. | Var of animation_fill_mode var

CSS animation fill mode values

type animation_direction = Properties.animation_direction =
  1. | Normal
  2. | Reverse
  3. | Alternate
  4. | Alternate_reverse
  5. | Directions of animation_direction list
  6. | Initial
  7. | Inherit
  8. | Unset
  9. | Revert
  10. | Revert_layer
  11. | Var of animation_direction var

CSS animation direction values

type animation_play_state = Properties.animation_play_state =
  1. | Running
  2. | Paused
  3. | States of animation_play_state list
  4. | Initial
  5. | Inherit
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of animation_play_state var

CSS animation play state values

type animation_iteration_count = Properties.animation_iteration_count =
  1. | Count of number
  2. | Infinite
  3. | Counts of animation_iteration_count list
  4. | Initial
  5. | Inherit
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of animation_iteration_count var

CSS animation iteration count values

type animation_name = Properties.animation_name =
  1. | None
  2. | Name of string
  3. | Ambiguous of string
  4. | Quoted of string
  5. | Names of animation_name list
  6. | Initial
  7. | Inherit
  8. | Unset
  9. | Revert
  10. | Revert_layer
  11. | Var of animation_name var
type animation_shorthand = Properties.animation_shorthand = {
  1. name : animation_name option;
  2. duration : duration option;
  3. timing_function : timing_function option;
  4. delay : duration option;
  5. iteration_count : animation_iteration_count option;
  6. direction : animation_direction option;
  7. fill_mode : animation_fill_mode option;
  8. play_state : animation_play_state option;
  9. timeline : animation_timeline option;
}

CSS animation shorthand values

and animation_timeline = Properties.animation_timeline =
  1. | None
  2. | Auto
  3. | Name of string
  4. | Scroll of string
  5. | View of string
  6. | Timelines of animation_timeline list
  7. | Initial
  8. | Inherit
  9. | Unset
  10. | Revert
  11. | Revert_layer
  12. | Var of animation_timeline var
type animation = Properties.animation =
  1. | Inherit
  2. | Initial
  3. | None
  4. | Shorthand of animation_shorthand
  5. | Var of animation var
val animation_shorthand : ?name:string -> ?duration:duration -> ?timing_function:timing_function -> ?delay:duration -> ?iteration_count:animation_iteration_count -> ?direction:animation_direction -> ?fill_mode:animation_fill_mode -> ?play_state:animation_play_state -> ?timeline:animation_timeline -> unit -> animation

animation_shorthand ?name ?duration ?timing_function ?delay ?iteration_count ?direction ?fill_mode ?play_state ?timeline () is the animation shorthand.

  • name: animation name
  • duration: animation duration
  • timing_function: easing function
  • delay: delay before animation starts
  • iteration_count: number of iterations (or Infinite)
  • direction: animation direction (normal, reverse, alternate, etc.)
  • fill_mode: how styles apply before/after animation
  • play_state: running or paused
  • timeline: animation timeline.
Sourceval animation : animation -> declaration

animation props is the animation shorthand property.

Sourceval animation_name : animation_name -> declaration

animation_name name is the animation-name property.

Sourceval animation_duration : duration -> declaration

animation_duration dur is the animation-duration property.

Sourceval animation_timing_function : timing_function -> declaration

animation_timing_function tf is the animation-timing-function property.

Sourceval animation_delay : duration -> declaration

animation_delay delay is the animation-delay property.

Sourceval animation_iteration_count : animation_iteration_count -> declaration

animation_iteration_count count is the animation-iteration-count property.

Sourceval animation_direction : animation_direction -> declaration

animation_direction dir is the animation-direction property.

Sourceval animation_fill_mode : animation_fill_mode -> declaration

animation_fill_mode mode is the animation-fill-mode property.

Sourceval animation_play_state : animation_play_state -> declaration

animation_play_state state is the animation-play-state property.

Visual Effects

Properties for visual effects including shadows, filters, clipping, and other advanced rendering features.

Sourceval box_shadow : shadow -> declaration

box_shadow shadow is the box-shadow property.

Sourceval box_shadows : shadow list -> declaration

box_shadows values is the box-shadow property. Raises Invalid_argument when values is empty.

type scale = Properties.scale =
  1. | X of number_percentage
  2. | XY of number_percentage * number_percentage
  3. | XYZ of number_percentage * number_percentage * number_percentage
  4. | None
  5. | Inherit
  6. | Initial
  7. | Unset
  8. | Revert
  9. | Revert_layer
  10. | Var of scale var

CSS scale property values

Sourceval scale : scale -> declaration

scale scale is the scale property.

type translate_value = Properties.translate_value =
  1. | X of length
  2. | XY of length * length
  3. | XYZ of length * length * length
  4. | None
  5. | Inherit
  6. | Initial
  7. | Unset
  8. | Revert
  9. | Revert_layer
  10. | Var of translate_value var

translate v is the translate property.

type filter_function = Properties.filter_function =
  1. | Blur_function
  2. | Brightness_function
  3. | Contrast_function
  4. | Grayscale_function
  5. | Hue_rotate_function
  6. | Invert_function
  7. | Opacity_function
  8. | Saturate_function
  9. | Sepia_function

Filter functions with an optional argument.

type filter = Properties.filter =
  1. | None
    (*

    No filter

    *)
  2. | Omitted of filter_function
    (*

    Function with its argument omitted.

    *)
  3. | Blur of length
    (*

    blur(px)

    *)
  4. | Brightness of number_percentage
    (*

    brightness(%)

    *)
  5. | Contrast of number_percentage
    (*

    contrast(%)

    *)
  6. | Drop_shadow of shadow
    (*

    drop-shadow(...)

    *)
  7. | Grayscale of number_percentage
    (*

    grayscale(%)

    *)
  8. | Hue_rotate of angle
    (*

    hue-rotate(deg)

    *)
  9. | Invert of number_percentage
    (*

    invert(%)

    *)
  10. | Opacity of number_percentage
    (*

    opacity(%)

    *)
  11. | Saturate of number_percentage
    (*

    saturate(%)

    *)
  12. | Sepia of number_percentage
    (*

    sepia(%)

    *)
  13. | Url of string
    (*

    url(...)

    *)
  14. | List of filter list
    (*

    Multiple filters

    *)
  15. | Inherit
  16. | Initial
  17. | Unset
  18. | Revert
  19. | Revert_layer
  20. | Var of filter var

CSS filter values

Sourceval filter_list : filter list -> filter

filter_list items is a multi-function filter value.

Sourceval filter : filter -> declaration

filter values is the filter property.

Sourceval filter_var_empty : string -> filter

filter_var_empty name creates a filter var reference with empty fallback, i.e., var(--name, ). Used for composable filter utilities.

Sourceval background_image_var_none : string -> background_image

background_image_var_none name creates a background_image var reference with no fallback, i.e., var(--name). Used for mask gradient utilities.

Sourceval minify_color : color -> color

minify_color c shortens hex colors (e.g., #0088cc to #08c) and converts named colors to shorter hex equivalents when possible.

val minify_background_image : background_image -> background_image

minify_background_image img converts named colors in gradient stops to their shortest hex form, matching Lightning CSS behavior.

Sourceval backdrop_filter : filter -> declaration

backdrop_filter values is the backdrop-filter property.

Sourceval webkit_backdrop_filter : filter -> declaration

webkit_backdrop_filter values is the -webkit-backdrop-filter property.

type clip = Properties.clip =
  1. | Clip_auto
  2. | Clip_rect of length * length * length * length
    (*

    top, right, bottom, left

    *)
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of clip var

CSS clip property values (deprecated, but needed for sr-only).

type clip_geometry_box = Properties.clip_geometry_box =
  1. | Margin_box
  2. | Border_box
  3. | Padding_box
  4. | Content_box
  5. | Fill_box
  6. | Stroke_box
  7. | View_box
type clip_path_extent = Properties.clip_path_extent =
  1. | Extent_length of length
  2. | Closest_side
  3. | Farthest_side
type clip_path_fill_rule = Properties.clip_path_fill_rule =
  1. | Nonzero
  2. | Evenodd
type clip_path = Properties.clip_path =
  1. | Clip_path_none
  2. | Clip_path_url of string
  3. | Clip_path_inset of {
    1. top : length_percentage;
    2. right : length_percentage option;
    3. bottom : length_percentage option;
    4. left : length_percentage option;
    5. rounded : border_radius option;
    }
  4. | Clip_path_circle of {
    1. radius : clip_path_extent option;
    2. position : position_value option;
    }
  5. | Clip_path_ellipse of {
    1. rx : clip_path_extent option;
    2. ry : clip_path_extent option;
    3. position : position_value option;
    }
  6. | Clip_path_polygon of {
    1. fill_rule : clip_path_fill_rule option;
    2. points : (length * length) list;
    3. spaced : bool;
    }
  7. | Clip_path_path of string
  8. | Clip_path_shape of string
  9. | Clip_path_box of clip_geometry_box
  10. | Clip_path_with_box of {
    1. shape : clip_path;
    2. box : clip_geometry_box;
    3. box_first : bool;
    }
  11. | Clip_path_xywh of {
    1. x : length_percentage;
    2. y : length_percentage;
    3. width : length_percentage;
    4. height : length_percentage;
    5. rounded : border_radius option;
    }
    (*

    xywh(<length-percentage>{4} [round <border-radius>]?) - CSS Shapes 2.

    *)
  12. | Clip_path_rect of {
    1. top : length_percentage;
    2. right : length_percentage;
    3. bottom : length_percentage;
    4. left : length_percentage;
    5. rounded : border_radius option;
    }
    (*

    rect(<length-percentage>{4} [round <border-radius>]?) - CSS Shapes 2.

    *)
  13. | Inherit
  14. | Initial
  15. | Unset
  16. | Revert
  17. | Revert_layer
  18. | Var of clip_path var
  19. | Invalid of invalid_value
    (*

    Spec-invalid <basic-shape> preserved verbatim.

    *)

CSS clip-path property values for clipping regions.

Sourceval clip : clip -> declaration

clip clip is the clip property (deprecated).

Sourceval clip_path : clip_path -> declaration

clip_path path is the clip-path property.

Sourceval mask : mask -> declaration

mask mask is the mask property.

Sourceval webkit_mask_image : background_image -> declaration

webkit_mask_image img is the -webkit-mask-image property.

mask_image img is the mask-image property.

Sourceval webkit_mask_composite : webkit_mask_composite -> declaration

webkit_mask_composite v is the -webkit-mask-composite property.

Sourceval mask_composite : mask_composite -> declaration

mask_composite v is the mask-composite property.

Sourceval webkit_mask_source_type : webkit_mask_source_type -> declaration

webkit_mask_source_type v is the -webkit-mask-source-type property.

Sourceval mask_mode : mask_mode -> declaration

mask_mode v is the mask-mode property.

Sourceval mask_type : mask_type -> declaration

mask_type v is the mask-type property.

Sourceval webkit_mask_size : background_size -> declaration

webkit_mask_size v is the -webkit-mask-size property.

mask_size v is the mask-size property.

Sourceval webkit_mask_position : position_value list -> declaration

webkit_mask_position v is the -webkit-mask-position property.

Sourceval mask_position : position_value list -> declaration

mask_position v is the mask-position property.

Sourceval webkit_mask_repeat : background_repeat -> declaration

webkit_mask_repeat v is the -webkit-mask-repeat property.

mask_repeat v is the mask-repeat property.

Sourceval webkit_mask_clip : webkit_mask_box -> declaration

webkit_mask_clip v is the -webkit-mask-clip property.

Sourceval mask_clip : mask_box -> declaration

mask_clip v is the mask-clip property.

Sourceval webkit_mask_origin : webkit_mask_box -> declaration

webkit_mask_origin v is the -webkit-mask-origin property.

Sourceval mask_origin : mask_box -> declaration

mask_origin v is the mask-origin property.

Sourceval mix_blend_mode : blend_mode -> declaration

mix_blend_mode mode is the mix-blend-mode property.

Sourceval background_blend_mode : blend_mode -> declaration

background_blend_mode values is the background-blend-mode property.

User Interaction

Properties that affect user interaction with elements including cursor appearance, user selection behavior, and pointer events.

type cursor = Properties.cursor =
  1. | Auto
  2. | Default
  3. | None
  4. | Context_menu
  5. | Help
  6. | Pointer
  7. | Progress
  8. | Wait
  9. | Cell
  10. | Crosshair
  11. | Text
  12. | Vertical_text
  13. | Alias
  14. | Copy
  15. | Move
  16. | No_drop
  17. | Not_allowed
  18. | Grab
  19. | Grabbing
  20. | E_resize
  21. | N_resize
  22. | Ne_resize
  23. | Nw_resize
  24. | S_resize
  25. | Se_resize
  26. | Sw_resize
  27. | W_resize
  28. | Ew_resize
  29. | Ns_resize
  30. | Nesw_resize
  31. | Nwse_resize
  32. | Col_resize
  33. | Row_resize
  34. | All_scroll
  35. | Zoom_in
  36. | Zoom_out
  37. | Url of string * (float * float) option * cursor
  38. | Inherit
  39. | Initial
  40. | Unset
  41. | Revert
  42. | Revert_layer
  43. | Var of cursor var

CSS cursor values.

Sourceval cursor_url : ?hotspot:(float * float) -> fallback:cursor -> string -> cursor

cursor_url ?hotspot ~fallback url is a URL cursor with its required fallback.

type user_select = Properties.user_select =
  1. | None
  2. | Auto
  3. | Text
  4. | All
  5. | Contain
  6. | Inherit
  7. | Initial
  8. | Unset
  9. | Revert
  10. | Revert_layer
  11. | Var of user_select var

CSS user-select values.

type resize = Properties.resize =
  1. | None
  2. | Both
  3. | Horizontal
  4. | Vertical
  5. | Block
  6. | Inline
  7. | Inherit
  8. | Initial
  9. | Unset
  10. | Revert
  11. | Revert_layer
  12. | Var of resize var

CSS resize values.

type print_color_adjust = Properties.print_color_adjust =
  1. | Economy
  2. | Exact
  3. | Initial
  4. | Inherit
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of print_color_adjust var

CSS print-color-adjust values.

Sourceval cursor : cursor -> declaration

cursor cursor is the cursor property.

type interactivity = Properties.interactivity =
  1. | Auto
  2. | Inert
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of interactivity var
Sourceval interactivity : interactivity -> declaration

interactivity interactivity is the CSS interactivity property.

type caret_animation = Properties.caret_animation =
  1. | Auto
  2. | Manual
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of caret_animation var
Sourceval caret_animation : caret_animation -> declaration

caret_animation animation is the CSS caret-animation property.

type caret_shape = Properties.caret_shape =
  1. | Auto
  2. | Bar
  3. | Block
  4. | Underscore
  5. | Inherit
  6. | Initial
  7. | Unset
  8. | Revert
  9. | Revert_layer
  10. | Var of caret_shape var
Sourceval caret_shape : caret_shape -> declaration

caret_shape shape is the CSS caret-shape property.

type caret = Properties.caret =
  1. | Auto
  2. | Caret of color option * caret_animation option * caret_shape option
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of caret var
Sourceval caret : caret -> declaration

caret caret is the CSS caret property.

type interest_delay_item = Properties.interest_delay_item =
  1. | Normal
  2. | Time of duration
type interest_delay = Properties.interest_delay =
  1. | Delays of interest_delay_item list
  2. | Inherit
  3. | Initial
  4. | Unset
  5. | Revert
  6. | Revert_layer
  7. | Var of interest_delay var
Sourceval interest_delay : interest_delay -> declaration

interest_delay delay is the CSS interest-delay property.

Sourceval interest_delay_start : interest_delay -> declaration

interest_delay_start delay is the CSS interest-delay-start property.

Sourceval interest_delay_end : interest_delay -> declaration

interest_delay_end delay is the CSS interest-delay-end property.

type nav_scope = Properties.nav_scope =
  1. | Current
  2. | Root
  3. | Named of string
type nav = Properties.nav =
  1. | Auto
  2. | Target of string * nav_scope option
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of nav var
Sourceval nav_up : nav -> declaration

nav_up nav is the CSS nav-up property.

Sourceval nav_right : nav -> declaration

nav_right nav is the CSS nav-right property.

Sourceval nav_down : nav -> declaration

nav_down nav is the CSS nav-down property.

Sourceval nav_left : nav -> declaration

nav_left nav is the CSS nav-left property.

type pointer_events = Properties.pointer_events =
  1. | Auto
  2. | None
  3. | Visible_painted
  4. | Visible_fill
  5. | Visible_stroke
  6. | Visible
  7. | Painted
  8. | Fill
  9. | Stroke
  10. | All
  11. | Inherit
  12. | Initial
  13. | Unset
  14. | Revert
  15. | Revert_layer
  16. | Var of pointer_events var

CSS pointer-events values

Sourceval pointer_events : pointer_events -> declaration

pointer_events events is the pointer-events property.

Sourceval user_select : user_select -> declaration

user_select select is the user-select property.

Sourceval webkit_user_select : user_select -> declaration

webkit_user_select select is the -webkit-user-select property.

Sourceval resize : resize -> declaration

resize resize is the resize property.

Sourceval print_color_adjust : print_color_adjust -> declaration

print_color_adjust v is the print-color-adjust property.

Sourceval webkit_print_color_adjust : print_color_adjust -> declaration

webkit_print_color_adjust v is the -webkit-print-color-adjust property, the legacy WebKit-prefixed alias of print-color-adjust.

type box_decoration_break = Properties.box_decoration_break =
  1. | Clone
  2. | Slice
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of box_decoration_break var
Sourceval box_decoration_break : box_decoration_break -> declaration

box_decoration_break v is the box-decoration-break property.

Sourceval webkit_box_decoration_break : box_decoration_break -> declaration

webkit_box_decoration_break v is the -webkit-box-decoration-break property.

Sourceval background_origin : background_box -> declaration

background_origin v is the background-origin property.

Sourceval background_clip : background_box -> declaration

background_clip v is the background-clip property.

Sourceval webkit_background_clip : background_box -> declaration

webkit_background_clip v is the -webkit-background-clip property.

Anchor Positioning

Properties that tie an absolutely positioned box to an anchor element.

type anchor_name = Properties.anchor_name =
  1. | None
  2. | Names of string list
  3. | Initial
  4. | Inherit
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of anchor_name var

Sec. 2.1 anchor-name: none | <dashed-ident>#.

Sourceval anchor_name : anchor_name -> declaration

anchor_name v is the anchor-name property.

type position_anchor = Properties.position_anchor =
  1. | Normal
  2. | None
  3. | Auto
  4. | Anchor of string
  5. | Initial
  6. | Inherit
  7. | Unset
  8. | Revert
  9. | Revert_layer
  10. | Var of position_anchor var

Sec. 4.1 position-anchor: normal | none | auto | <anchor-name>.

Sourceval position_anchor : position_anchor -> declaration

position_anchor v is the position-anchor property.

type position_area_keyword = Properties.position_area_keyword =
  1. | Top
  2. | Bottom
  3. | Left
  4. | Right
  5. | Center
  6. | Span_top
  7. | Span_bottom
  8. | Span_left
  9. | Span_right
  10. | X_start
  11. | X_end
  12. | Y_start
  13. | Y_end
  14. | Span_x_start
  15. | Span_x_end
  16. | Span_y_start
  17. | Span_y_end
  18. | Inline_start
  19. | Inline_end
  20. | Block_start
  21. | Block_end
  22. | Span_inline_start
  23. | Span_inline_end
  24. | Span_block_start
  25. | Span_block_end
  26. | Start
  27. | End
  28. | Span_start
  29. | Span_end
  30. | Self_start
  31. | Self_end
  32. | Span_self_start
  33. | Span_self_end
  34. | Self_x_start
  35. | Self_x_end
  36. | Self_y_start
  37. | Self_y_end
  38. | Span_self_x_start
  39. | Span_self_x_end
  40. | Span_self_y_start
  41. | Span_self_y_end
  42. | Self_block_start
  43. | Self_block_end
  44. | Self_inline_start
  45. | Self_inline_end
  46. | Span_self_block_start
  47. | Span_self_block_end
  48. | Span_self_inline_start
  49. | Span_self_inline_end
  50. | Span_all

Sec. 3.1.2 <position-area>: one of the grid keywords naming a region around the anchor.

type position_area = Properties.position_area =
  1. | None
  2. | Area of position_area_keyword * position_area_keyword option
  3. | Initial
  4. | Inherit
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of position_area var

Sec. 3.1.2 position-area: one or two keywords from a single branch of the grammar.

Sourceval position_area : position_area -> declaration

position_area v is the position-area property.

type position_try_fallback = Properties.position_try_fallback =
  1. | Flip_block
  2. | Flip_inline
  3. | Flip_start
  4. | Name of string

Sec. 6.1 <try-tactic> and the <dashed-ident> naming a @position-try rule.

type position_try_fallback_entry = Properties.position_try_fallback_entry =
  1. | Tactics of position_try_fallback list
  2. | Area of position_area_keyword * position_area_keyword option

Sec. 6.1: one comma-separated fallback entry, which is either a tactic group or a <position-area>, never a mix of the two.

type position_try_fallbacks = Properties.position_try_fallbacks =
  1. | None
  2. | Fallbacks of position_try_fallback_entry list
  3. | Initial
  4. | Inherit
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of position_try_fallbacks var

Sec. 6.1 position-try-fallbacks.

Sourceval position_try_fallbacks : position_try_fallbacks -> declaration

position_try_fallbacks v is the position-try-fallbacks property.

type position_try_order = Properties.position_try_order =
  1. | Normal
  2. | Most_width
  3. | Most_height
  4. | Most_block_size
  5. | Most_inline_size
  6. | Initial
  7. | Inherit
  8. | Unset
  9. | Revert
  10. | Revert_layer
  11. | Var of position_try_order var

Sec. 6.2 position-try-order: normal | <try-size>.

Sourceval position_try_order : position_try_order -> declaration

position_try_order v is the position-try-order property.

type position_try = Properties.position_try =
  1. | Try of position_try_order * position_try_fallbacks
  2. | Initial
  3. | Inherit
  4. | Unset
  5. | Revert
  6. | Revert_layer
  7. | Var of position_try var

Sec. 6.3 position-try: <'position-try-order'>? <'position-try-fallbacks'>.

Sourceval position_try : position_try -> declaration

position_try v is the position-try shorthand.

type position_visibility_condition = Properties.position_visibility_condition =
  1. | Anchors_visible
  2. | No_overflow

Sec. 7 <anchor-visibility>: one condition that hides the box.

type position_visibility = Properties.position_visibility =
  1. | Always
  2. | Conditions of position_visibility_condition list
  3. | Initial
  4. | Inherit
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of position_visibility var

Sec. 7 position-visibility.

Sourceval position_visibility : position_visibility -> declaration

position_visibility v is the position-visibility property.

View Transitions

Properties that name the elements a view transition animates independently.

type view_transition_name = Properties.view_transition_name =
  1. | None
  2. | Match_element
  3. | Name of string
  4. | Initial
  5. | Inherit
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of view_transition_name var

View Transitions 1 view-transition-name, with the match-element of Level 2.

Sourceval view_transition_name : view_transition_name -> declaration

view_transition_name v is the view-transition-name property.

type view_transition_class = Properties.view_transition_class =
  1. | None
  2. | Classes of string list
  3. | Initial
  4. | Inherit
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of view_transition_class var

View Transitions 2 view-transition-class: none | <custom-ident>+.

Sourceval view_transition_class : view_transition_class -> declaration

view_transition_class v is the view-transition-class property.

Motion Path

Properties that move a box along a path rather than by an offset.

type ray_size = Properties.ray_size =
  1. | Closest_side
  2. | Closest_corner
  3. | Farthest_side
  4. | Farthest_corner
  5. | Sides

Sec. 3.2 <ray-size>: how far the ray reaches.

type ray = Properties.ray = {
  1. angle : angle;
  2. size : ray_size option;
  3. contain : bool;
  4. position : position_value option;
}

Sec. 3.2 ray(): an angle, a size, whether the path is contained, and the position it starts from.

type offset_path = Properties.offset_path =
  1. | None
  2. | Url of string
  3. | Path of string
  4. | Ray of ray
  5. | Shape of clip_path
  6. | Initial
  7. | Inherit
  8. | Unset
  9. | Revert
  10. | Revert_layer
  11. | Var of offset_path var

Sec. 2.1 offset-path: none | <offset-path> || <coord-box>, where the shape branch reuses clip_path.

Sourceval offset_path : offset_path -> declaration

offset_path v is the offset-path property.

Sourceval offset_distance : length_percentage -> declaration

offset_distance v is the offset-distance property.

type offset_rotate_mode = Properties.offset_rotate_mode =
  1. | Auto
  2. | Reverse

Sec. 2.3 offset-rotate: which of auto and reverse an explicit angle is measured from.

type offset_rotate = Properties.offset_rotate =
  1. | Auto
  2. | Reverse
  3. | Angle of angle
  4. | With_angle of offset_rotate_mode * angle
  5. | Initial
  6. | Inherit
  7. | Unset
  8. | Revert
  9. | Revert_layer
  10. | Var of offset_rotate var

Sec. 2.3 offset-rotate: [ auto | reverse ] || <angle>.

Sourceval offset_rotate : offset_rotate -> declaration

offset_rotate v is the offset-rotate property.

type offset_anchor = Properties.offset_anchor =
  1. | Auto
  2. | Position of position_value
  3. | Initial
  4. | Inherit
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of offset_anchor var

Sec. 2.4 offset-anchor: auto | <position>.

Sourceval offset_anchor : offset_anchor -> declaration

offset_anchor v is the offset-anchor property.

type offset_position = Properties.offset_position =
  1. | Normal
  2. | Auto
  3. | Position of position_value
  4. | Initial
  5. | Inherit
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of offset_position var

Sec. 2.5 offset-position: normal | auto | <position>.

Sourceval offset_position : offset_position -> declaration

offset_position v is the offset-position property.

type offset_target = Properties.offset_target =
  1. | Position_only of offset_position
  2. | With_path of {
    1. position : offset_position option;
    2. path : offset_path;
    3. distance : length_percentage option;
    4. rotate : offset_rotate option;
    }

Sec. 2.6: the leading group of the offset shorthand, which is either a position on its own or a path with the slots that follow it.

type offset = Properties.offset =
  1. | Shorthand of {
    1. target : offset_target;
    2. anchor : offset_anchor option;
    }
  2. | Initial
  3. | Inherit
  4. | Unset
  5. | Revert
  6. | Revert_layer
  7. | Var of offset var

Sec. 2.6 offset: [ <'offset-position'>? [ <'offset-path'> [ <'offset-distance'> || <'offset-rotate'> ]? ]? ]! [ / <'offset-anchor'> ]?.

Sourceval offset : offset -> declaration

offset v is the offset shorthand.

Container Queries & Containment

CSS container queries and containment features for component-based responsive design and performance optimization through layout isolation.

type container_type = Properties.container_type =
  1. | Size
  2. | Inline_size
  3. | Scroll_state
  4. | Normal
  5. | Initial
  6. | Inherit
  7. | Unset
  8. | Revert
  9. | Revert_layer
  10. | Var of container_type var

CSS container-type values

Sourceval container_type : container_type -> declaration

container_type type_ is the container-type property for container queries.

The shorthand that sets this and the name together is val-Declaration.container, because container at this level is the at-rule builder.

type contain_intrinsic_size_item = Properties.contain_intrinsic_size_item =
  1. | None
  2. | Length of length
  3. | Auto_none
  4. | Auto of length

One axis of CSS Sizing 4 contain-intrinsic-size, a length that the auto prefix lets a remembered size override.

type contain_intrinsic_size = Properties.contain_intrinsic_size =
  1. | None
  2. | Intrinsic of contain_intrinsic_size_item * contain_intrinsic_size_item option
  3. | Initial
  4. | Inherit
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of contain_intrinsic_size var

CSS Sizing 4 contain-intrinsic-size: one axis or both.

Sourceval contain_intrinsic_size : contain_intrinsic_size -> declaration

contain_intrinsic_size v is the contain-intrinsic-size shorthand.

type contain_intrinsic_longhand = Properties.contain_intrinsic_longhand =
  1. | None
  2. | Size of contain_intrinsic_size_item
  3. | Initial
  4. | Inherit
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of contain_intrinsic_longhand var
Sourceval contain_intrinsic_width : contain_intrinsic_longhand -> declaration

contain_intrinsic_width v is the contain-intrinsic-width property.

Sourceval contain_intrinsic_height : contain_intrinsic_longhand -> declaration

contain_intrinsic_height v is the contain-intrinsic-height property.

Sourceval contain_intrinsic_block_size : contain_intrinsic_longhand -> declaration

contain_intrinsic_block_size v is the contain-intrinsic-block-size property.

Sourceval contain_intrinsic_inline_size : contain_intrinsic_longhand -> declaration

contain_intrinsic_inline_size v is the contain-intrinsic-inline-size property.

type container_name = Properties.container_name =
  1. | None
  2. | Names of string list
  3. | Initial
  4. | Inherit
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of container_name var
Sourceval container_name : string -> declaration

container_name name is the container-name property.

type contain = Properties.contain =
  1. | None
  2. | Strict
  3. | Content
  4. | Size
  5. | Layout
  6. | Style
  7. | Paint
  8. | Inline_size
  9. | List of contain list
  10. | Inherit
  11. | Initial
  12. | Unset
  13. | Revert
  14. | Revert_layer
  15. | Var of contain var

CSS contain values

Sourceval contain_list : contain list -> contain

contain_list items is a combined contain value.

Sourceval contain : contain -> declaration

contain contain is the contain property.

Advanced Features

Specialized functionality for advanced CSS features and legacy support.

Vendor-Specific Properties

Vendor-prefixed properties for browser compatibility and legacy support. These are implementation-specific extensions that may be needed for older browsers.

Vendor-prefixed longhands

Each writes the prefixed spelling of the unprefixed property beside it and takes the same value type.

Sourceval moz_user_select : user_select -> declaration

moz_user_select v is the -moz-user-select property.

Sourceval ms_user_select : user_select -> declaration

ms_user_select v is the -ms-user-select property.

Sourceval webkit_text_fill_color : color -> declaration

webkit_text_fill_color v is the -webkit-text-fill-color property.

Sourceval webkit_text_stroke_width : border_width -> declaration

webkit_text_stroke_width v is the -webkit-text-stroke-width property.

Sourceval webkit_text_stroke_color : color -> declaration

webkit_text_stroke_color v is the -webkit-text-stroke-color property.

Sourceval webkit_transform : transform list -> declaration

webkit_transform v is the -webkit-transform property.

Sourceval moz_transform : transform list -> declaration

moz_transform v is the -moz-transform property.

Sourceval ms_transform : transform list -> declaration

ms_transform v is the -ms-transform property.

Sourceval o_transform : transform list -> declaration

o_transform v is the -o-transform property.

Sourceval webkit_transition : transition list -> declaration

webkit_transition v is the -webkit-transition property.

Sourceval webkit_transition_delay : duration -> declaration

webkit_transition_delay v is the -webkit-transition-delay property.

Sourceval webkit_transition_duration : duration -> declaration

webkit_transition_duration v is the -webkit-transition-duration property.

Sourceval webkit_transition_property : transition_property -> declaration

webkit_transition_property v is the -webkit-transition-property property.

Sourceval webkit_transition_timing_function : timing_function -> declaration

webkit_transition_timing_function v is the -webkit-transition-timing-function property.

Sourceval webkit_animation : animation list -> declaration

webkit_animation v is the -webkit-animation property.

Sourceval webkit_animation_delay : duration -> declaration

webkit_animation_delay v is the -webkit-animation-delay property.

Sourceval webkit_animation_duration : duration -> declaration

webkit_animation_duration v is the -webkit-animation-duration property.

Sourceval webkit_animation_direction : animation_direction -> declaration

webkit_animation_direction v is the -webkit-animation-direction property.

Sourceval webkit_animation_iteration_count : animation_iteration_count -> declaration

webkit_animation_iteration_count v is the -webkit-animation-iteration-count property.

Sourceval webkit_animation_name : animation_name -> declaration

webkit_animation_name v is the -webkit-animation-name property.

Sourceval webkit_animation_timing_function : timing_function -> declaration

webkit_animation_timing_function v is the -webkit-animation-timing-function property.

Sourceval webkit_animation_fill_mode : animation_fill_mode -> declaration

webkit_animation_fill_mode v is the -webkit-animation-fill-mode property.

Sourceval webkit_animation_play_state : animation_play_state -> declaration

webkit_animation_play_state v is the -webkit-animation-play-state property.

Sourceval webkit_flex_direction : flex_direction -> declaration

webkit_flex_direction v is the -webkit-flex-direction property.

Sourceval webkit_flex_wrap : flex_wrap -> declaration

webkit_flex_wrap v is the -webkit-flex-wrap property.

Sourceval webkit_flex_flow : flex_flow -> declaration

webkit_flex_flow v is the -webkit-flex-flow property.

Sourceval webkit_justify_content : justify_content -> declaration

webkit_justify_content v is the -webkit-justify-content property.

Sourceval webkit_align_items : align_items -> declaration

webkit_align_items v is the -webkit-align-items property.

Sourceval webkit_align_content : align_content -> declaration

webkit_align_content v is the -webkit-align-content property.

Sourceval webkit_align_self : align_self -> declaration

webkit_align_self v is the -webkit-align-self property.

Sourceval webkit_border_radius : border_radius -> declaration

webkit_border_radius v is the -webkit-border-radius property.

Sourceval webkit_box_sizing : box_sizing -> declaration

webkit_box_sizing v is the -webkit-box-sizing property.

Sourceval moz_box_sizing : box_sizing -> declaration

moz_box_sizing v is the -moz-box-sizing property.

Sourceval webkit_box_shadow : shadow -> declaration

webkit_box_shadow v is the -webkit-box-shadow property.

Sourceval webkit_background_size : background_size -> declaration

webkit_background_size v is the -webkit-background-size property.

Sourceval webkit_filter : filter -> declaration

webkit_filter v is the -webkit-filter property.

Sourceval moz_animation : animation list -> declaration

moz_animation v is the -moz-animation property.

Sourceval moz_animation_delay : duration -> declaration

moz_animation_delay v is the -moz-animation-delay property.

Sourceval moz_animation_duration : duration -> declaration

moz_animation_duration v is the -moz-animation-duration property.

Sourceval moz_animation_direction : animation_direction -> declaration

moz_animation_direction v is the -moz-animation-direction property.

Sourceval moz_animation_iteration_count : animation_iteration_count -> declaration

moz_animation_iteration_count v is the -moz-animation-iteration-count property.

Sourceval moz_animation_name : animation_name -> declaration

moz_animation_name v is the -moz-animation-name property.

Sourceval moz_animation_timing_function : timing_function -> declaration

moz_animation_timing_function v is the -moz-animation-timing-function property.

Sourceval moz_animation_fill_mode : animation_fill_mode -> declaration

moz_animation_fill_mode v is the -moz-animation-fill-mode property.

Sourceval moz_animation_play_state : animation_play_state -> declaration

moz_animation_play_state v is the -moz-animation-play-state property.

Sourceval moz_transition : transition list -> declaration

moz_transition v is the -moz-transition property.

Sourceval moz_transition_delay : duration -> declaration

moz_transition_delay v is the -moz-transition-delay property.

Sourceval moz_transition_duration : duration -> declaration

moz_transition_duration v is the -moz-transition-duration property.

Sourceval moz_transition_property : transition_property -> declaration

moz_transition_property v is the -moz-transition-property property.

Sourceval moz_transition_timing_function : timing_function -> declaration

moz_transition_timing_function v is the -moz-transition-timing-function property.

Sourceval moz_border_radius : border_radius -> declaration

moz_border_radius v is the -moz-border-radius property.

Sourceval moz_box_shadow : shadow -> declaration

moz_box_shadow v is the -moz-box-shadow property.

Sourceval ms_filter : filter -> declaration

ms_filter v is the -ms-filter property.

Sourceval o_transition : transition list -> declaration

o_transition v is the -o-transition property.

type webkit_box_orient = Properties.webkit_box_orient =
  1. | Horizontal
  2. | Vertical
  3. | Inline_axis
  4. | Block_axis
  5. | Inherit
  6. | Initial
  7. | Unset
  8. | Revert
  9. | Revert_layer
  10. | Var of webkit_box_orient var

CSS webkit-box-orient values.

type webkit_line_clamp = Properties.webkit_line_clamp =
  1. | None
  2. | Lines of int
  3. | Calc of webkit_line_clamp calc
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of webkit_line_clamp var

CSS -webkit-line-clamp values.

type webkit_appearance = Properties.webkit_appearance =
  1. | None
    (*

    No appearance styling

    *)
  2. | Auto
    (*

    Default browser styling

    *)
  3. | Button
    (*

    Button appearance

    *)
  4. | Textfield
    (*

    Text field appearance

    *)
  5. | Menulist
    (*

    Select/dropdown appearance

    *)
  6. | Base_select
    (*

    The base appearance of a select (Chrome alias)

    *)
  7. | Listbox
    (*

    List box appearance

    *)
  8. | Checkbox
    (*

    Checkbox appearance

    *)
  9. | Radio
    (*

    Radio button appearance

    *)
  10. | Push_button
    (*

    Push button appearance

    *)
  11. | Square_button
    (*

    Square button appearance

    *)
  12. | Apple_pay_button
    (*

    Apple Pay button appearance

    *)
  13. | Inherit
    (*

    Inherit from parent

    *)
  14. | Initial
  15. | Unset
  16. | Revert
  17. | Revert_layer
  18. | Var of webkit_appearance var

CSS -webkit-appearance values.

type webkit_font_smoothing = Properties.webkit_font_smoothing =
  1. | Auto
  2. | None
  3. | Antialiased
  4. | Subpixel_antialiased
  5. | Inherit
  6. | Initial
  7. | Unset
  8. | Revert
  9. | Revert_layer
  10. | Var of webkit_font_smoothing var

CSS -webkit-font-smoothing values.

type moz_osx_font_smoothing = Properties.moz_osx_font_smoothing =
  1. | Auto
  2. | Grayscale
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of moz_osx_font_smoothing var

CSS -moz-osx-font-smoothing values.

Sourceval webkit_appearance : webkit_appearance -> declaration

webkit_appearance app is the -webkit-appearance property.

Sourceval webkit_font_smoothing : webkit_font_smoothing -> declaration

webkit_font_smoothing smoothing is the -webkit-font-smoothing property.

Sourceval moz_osx_font_smoothing : moz_osx_font_smoothing -> declaration

moz_osx_font_smoothing smoothing is the -moz-osx-font-smoothing property.

Sourceval webkit_tap_highlight_color : color -> declaration

webkit_tap_highlight_color color is the -webkit-tap-highlight-color property.

Sourceval webkit_text_decoration : text_decoration -> declaration

webkit_text_decoration decoration is the WebKit-only -webkit-text-decoration property.

Sourceval webkit_text_decoration_color : color -> declaration

webkit_text_decoration_color color is the WebKit-only -webkit-text-decoration-color property.

Sourceval webkit_line_clamp : webkit_line_clamp -> declaration

webkit_line_clamp clamp is the WebKit-only -webkit-line-clamp property.

Sourceval webkit_box_orient : webkit_box_orient -> declaration

webkit_box_orient orient is the WebKit-only -webkit-box-orient property.

Sourceval webkit_hyphens : hyphens -> declaration

webkit_hyphens hyphens is the WebKit-only -webkit-hyphens property.

Sourceval webkit_text_size_adjust : text_size_adjust -> declaration

webkit_text_size_adjust adjust is the WebKit-only -webkit-text-size-adjust property.

Additional Properties

Specialized CSS properties organized by their functional purpose.

Lists & Tables

Properties for styling HTML lists and tables.

type symbols_type = Properties.symbols_type =
  1. | Cyclic
  2. | Numeric
  3. | Alphabetic
  4. | Symbolic
  5. | Fixed

CSS symbols() counter-system keywords

type list_style_symbol = Properties.list_style_symbol =
  1. | String of string
  2. | Url of string
Sourceval list_style_symbol_string : string -> list_style_symbol

list_style_symbol_string value is a string symbol for symbols().

Sourceval list_style_symbol_url : string -> list_style_symbol

list_style_symbol_url value is a URL symbol for symbols().

type list_style_type = Properties.list_style_type =
  1. | None
  2. | Disc
  3. | Circle
  4. | Square
  5. | Decimal
  6. | Lower_alpha
  7. | Upper_alpha
  8. | Lower_roman
  9. | Upper_roman
  10. | Decimal_leading_zero
  11. | Arabic_indic
  12. | Armenian
  13. | Upper_armenian
  14. | Lower_armenian
  15. | Bengali
  16. | Cambodian
  17. | Khmer
  18. | Cjk_decimal
  19. | Devanagari
  20. | Georgian
  21. | Gujarati
  22. | Gurmukhi
  23. | Hebrew
  24. | Kannada
  25. | Lao
  26. | Malayalam
  27. | Mongolian
  28. | Myanmar
  29. | Oriya
  30. | Persian
  31. | Tamil
  32. | Telugu
  33. | Thai
  34. | Tibetan
  35. | Lower_latin
  36. | Upper_latin
  37. | Cjk_earthly_branch
  38. | Cjk_heavenly_stem
  39. | Lower_greek
  40. | Hiragana
  41. | Hiragana_iroha
  42. | Katakana
  43. | Katakana_iroha
  44. | Disclosure_open
  45. | Disclosure_closed
  46. | Cjk_ideographic
  47. | Japanese_informal
  48. | Japanese_formal
  49. | Korean_hangul_formal
  50. | Korean_hanja_informal
  51. | Korean_hanja_formal
  52. | Simp_chinese_informal
  53. | Simp_chinese_formal
  54. | Trad_chinese_informal
  55. | Trad_chinese_formal
  56. | Ethiopic_numeric
  57. | Name of string
    (*

    A case-sensitive custom counter-style name.

    *)
  58. | String of string
  59. | Symbols of symbols_type option * list_style_symbol list
  60. | Inherit
  61. | Initial
  62. | Unset
  63. | Revert
  64. | Revert_layer
  65. | Var of list_style_type var

CSS list-style-type values

Sourceval list_style_string : string -> list_style_type

list_style_string value is a string list-style-type.

Sourceval list_style_symbols : ?kind:symbols_type -> list_style_symbol list -> list_style_type

list_style_symbols ?kind symbols is a symbols(...) list-style type.

type list_style_image = Properties.list_style_image =
  1. | None
  2. | Image of background_image
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of list_style_image var

CSS list-style-image values

type list_style_shorthand = Properties.list_style_shorthand = {
  1. type_ : list_style_type option;
  2. position : list_style_position option;
  3. image : list_style_image option;
}
type list_style = Properties.list_style =
  1. | Shorthand of list_style_shorthand
  2. | Inherit
  3. | Initial
  4. | Unset
  5. | Revert
  6. | Revert_layer
  7. | Var of list_style var
Sourceval list_style_image_url : string -> list_style_image

list_style_image_url value is a URL list-style-image.

Sourceval list_style_type : list_style_type -> declaration

list_style_type lst is the list-style-type property.

Sourceval list_style_image : list_style_image -> declaration

list_style_image img is the list-style-image property.

type table_layout = Properties.table_layout =
  1. | Auto
  2. | Fixed
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of table_layout var
type vertical_align = Properties.vertical_align =
  1. | Baseline
  2. | Top
  3. | Middle
  4. | Bottom
  5. | Text_top
  6. | Text_bottom
  7. | Sub
  8. | Super
  9. | Length of length_percentage
  10. | Inherit
  11. | Initial
  12. | Unset
  13. | Revert
  14. | Revert_layer
  15. | Var of vertical_align var
Sourceval table_layout : table_layout -> declaration

table_layout value is the table-layout property.

Sourceval vertical_align : vertical_align -> declaration

vertical_align value is the vertical-align property.

Sourceval list_style : list_style -> declaration

list_style value is the list-style shorthand property.

Sourceval border_spacing : border_spacing -> declaration

border_spacing values is the border-spacing property. Accepts 1 or 2 length values.

Sourceval border_spacing_values : length list -> border_spacing

border_spacing_values values is a one- or two-value border-spacing.

SVG Properties

Properties specific to SVG rendering and styling.

type svg_paint = Properties.svg_paint =
  1. | None
    (*

    No paint

    *)
  2. | Inherit
    (*

    Inherited value

    *)
  3. | Current_color
    (*

    Current color value

    *)
  4. | Color of color
    (*

    Specific color value

    *)
  5. | Url of string * svg_paint option
    (*

    url(#id) with optional fallback

    *)
  6. | Context_fill
    (*

    SVG2 context-fill keyword

    *)
  7. | Context_stroke
    (*

    SVG2 context-stroke keyword

    *)
  8. | Var of svg_paint var

SVG paint values for fill and stroke properties

Sourceval svg_paint_color : color -> svg_paint

svg_paint_color color is a color paint value.

Sourceval svg_paint_url : ?fallback:svg_paint -> string -> svg_paint

svg_paint_url ?fallback url is a URL paint value with an optional fallback.

fill paint is the SVG fill property.

stroke paint is the SVG stroke property.

type stroke_width = Properties.stroke_width =
  1. | Number of float
    (*

    A width in user units

    *)
  2. | Calc of stroke_width calc
    (*

    A math function answering a <number>

    *)
  3. | Length of length_percentage
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of stroke_width var

SVG 2 stroke-width: <length-percentage> | <number>, where a bare number is a width in user units rather than a CSS <length>.

Sourceval stroke_width : stroke_width -> declaration

stroke_width width is the SVG stroke-width property.

type fill_rule = Properties.fill_rule =
  1. | Nonzero
  2. | Evenodd
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of fill_rule var

SVG 2 fill-rule: which points count as inside a shape when its subpaths overlap. CSS Masking 1 clip-rule takes the same values.

Sourceval fill_rule : fill_rule -> declaration

fill_rule v is the SVG fill-rule property.

Sourceval clip_rule : fill_rule -> declaration

clip_rule v is the SVG clip-rule property, which takes what fill-rule takes.

Sourceval fill_opacity : opacity -> declaration

fill_opacity v is the SVG fill-opacity property.

Sourceval stroke_opacity : opacity -> declaration

stroke_opacity v is the SVG stroke-opacity property.

type stroke_linecap = Properties.stroke_linecap =
  1. | Butt
  2. | Round
  3. | Square
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of stroke_linecap var

SVG 2 stroke-linecap: the shape at the ends of an open subpath.

Sourceval stroke_linecap : stroke_linecap -> declaration

stroke_linecap v is the SVG stroke-linecap property.

type stroke_linejoin = Properties.stroke_linejoin =
  1. | Miter
  2. | Miter_clip
  3. | Round
  4. | Bevel
  5. | Arcs
  6. | Inherit
  7. | Initial
  8. | Unset
  9. | Revert
  10. | Revert_layer
  11. | Var of stroke_linejoin var

SVG 2 stroke-linejoin: the shape at a corner between two stroke segments.

Sourceval stroke_linejoin : stroke_linejoin -> declaration

stroke_linejoin v is the SVG stroke-linejoin property.

type stroke_miterlimit = Properties.stroke_miterlimit =
  1. | Number of float
  2. | Calc of stroke_miterlimit calc
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of stroke_miterlimit var

SVG 2 stroke-miterlimit: the ratio past which a miter join falls back to a bevel.

Sourceval stroke_miterlimit : stroke_miterlimit -> declaration

stroke_miterlimit v is the SVG stroke-miterlimit property.

type dash_length = Properties.dash_length =
  1. | Number of number
  2. | Length of length_percentage

SVG 2 stroke-dasharray writes each dash as a <length-percentage> or a bare number in user units, the way stroke_width does.

type stroke_dashoffset = Properties.stroke_dashoffset =
  1. | Dash of dash_length
  2. | Inherit
  3. | Initial
  4. | Unset
  5. | Revert
  6. | Revert_layer
  7. | Var of stroke_dashoffset var

SVG 2 stroke-dashoffset: where the dash pattern starts.

Sourceval stroke_dashoffset : stroke_dashoffset -> declaration

stroke_dashoffset v is the SVG stroke-dashoffset property.

type stroke_dasharray = Properties.stroke_dasharray =
  1. | None
  2. | Dashes of dash_length list
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of stroke_dasharray var

SVG 2 stroke-dasharray: the dash and gap lengths.

Sourceval stroke_dasharray : stroke_dasharray -> declaration

stroke_dasharray v is the SVG stroke-dasharray property.

type paint_order_keyword = Properties.paint_order_keyword =
  1. | Fill
  2. | Stroke
  3. | Markers

One of the three painting operations SVG 2 paint-order orders.

type paint_order = Properties.paint_order =
  1. | Normal
  2. | Order of paint_order_keyword list
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of paint_order var

SVG 2 paint-order: the order fill, stroke and markers paint in.

Sourceval paint_order : paint_order -> declaration

paint_order v is the SVG paint-order property.

type vector_effect_keyword = Properties.vector_effect_keyword =
  1. | Non_scaling_stroke
  2. | Non_scaling_size
  3. | Non_rotation
  4. | Fixed_position

One effect the transform does not scale, for SVG 2 vector-effect.

type vector_effect_space = Properties.vector_effect_space =
  1. | Viewport
  2. | Screen

The coordinate space an SVG 2 vector-effect effect is taken against.

type vector_effect = Properties.vector_effect =
  1. | None
  2. | Effects of vector_effect_keyword list * vector_effect_space option
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of vector_effect var
Sourceval vector_effect : vector_effect -> declaration

vector_effect v is the SVG vector-effect property.

Sourceval stop_color : color -> declaration

stop_color v is the SVG stop-color property of a gradient stop.

Sourceval stop_opacity : opacity -> declaration

stop_opacity v is the SVG stop-opacity property of a gradient stop.

Sourceval flood_color : color -> declaration

flood_color v is the SVG flood-color property of feFlood.

Sourceval flood_opacity : opacity -> declaration

flood_opacity v is the SVG flood-opacity property of feFlood.

Sourceval lighting_color : color -> declaration

lighting_color v is the SVG lighting-color property of a light filter.

type dominant_baseline = Properties.dominant_baseline =
  1. | Auto
  2. | Alphabetic
  3. | Ideographic
  4. | Mathematical
  5. | Central
  6. | Middle
  7. | Text_top
  8. | Text_bottom
  9. | Inherit
  10. | Initial
  11. | Unset
  12. | Revert
  13. | Revert_layer
  14. | Var of dominant_baseline var

CSS Inline 3 dominant-baseline: auto | <baseline-metric>.

Sourceval dominant_baseline : dominant_baseline -> declaration

dominant_baseline v is the dominant-baseline property.

type alignment_baseline = Properties.alignment_baseline =
  1. | Baseline
  2. | Text_bottom
  3. | Middle
  4. | Central
  5. | Text_top
  6. | Ideographic
  7. | Alphabetic
  8. | Hanging
  9. | Mathematical
  10. | Inherit
  11. | Initial
  12. | Unset
  13. | Revert
  14. | Revert_layer
  15. | Var of alignment_baseline var

SVG 2 alignment-baseline: the baseline of the box aligned against its parent's dominant baseline.

Sourceval alignment_baseline : alignment_baseline -> declaration

alignment_baseline v is the alignment-baseline property.

type baseline_shift = Properties.baseline_shift =
  1. | Shift of length_percentage
  2. | Sub
  3. | Super
  4. | Top
  5. | Center
  6. | Bottom
  7. | Inherit
  8. | Initial
  9. | Unset
  10. | Revert
  11. | Revert_layer
  12. | Var of baseline_shift var

CSS Inline 3 baseline-shift: <length-percentage> | sub | super | top | center | bottom.

Sourceval baseline_shift : baseline_shift -> declaration

baseline_shift v is the baseline-shift property.

type baseline_source = Properties.baseline_source =
  1. | Auto
  2. | First
  3. | Last
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of baseline_source var

CSS Inline 3 baseline-source: which line box baseline an inline block aligns on.

Sourceval baseline_source : baseline_source -> declaration

baseline_source v is the baseline-source property.

Scroll & Touch

Properties for scroll behavior and touch interaction.

type touch_action = Properties.touch_action =
  1. | Auto
  2. | None
  3. | Pan_x
  4. | Pan_y
  5. | Pan_left
  6. | Pan_right
  7. | Pan_up
  8. | Pan_down
  9. | Pinch_zoom
  10. | Manipulation
  11. | Actions of touch_action list
  12. | Inherit
  13. | Initial
  14. | Unset
  15. | Revert
  16. | Revert_layer
  17. | Vars of touch_action var list
  18. | Var of touch_action var

CSS touch-action values

type scroll_snap_strictness = Properties.scroll_snap_strictness =
  1. | Mandatory
  2. | Proximity
  3. | Var of scroll_snap_strictness var

CSS scroll-snap-strictness values

type scroll_snap_axis = Properties.scroll_snap_axis =
  1. | None
  2. | X
  3. | Y
  4. | Block
  5. | Inline
  6. | Both
  7. | Var of scroll_snap_axis var

CSS scroll-snap axis values

type scroll_snap_type = Properties.scroll_snap_type =
  1. | Axis of scroll_snap_axis
  2. | Axis_with_strictness of scroll_snap_axis * scroll_snap_strictness
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of scroll_snap_type var

CSS scroll-snap-type values

type scroll_snap_align = Properties.scroll_snap_align =
  1. | None
  2. | Start
  3. | End
  4. | Center
  5. | Snap_align_pair of scroll_snap_align * scroll_snap_align
  6. | Inherit
  7. | Initial
  8. | Unset
  9. | Revert
  10. | Revert_layer
  11. | Var of scroll_snap_align var

CSS scroll-snap-align values

type timeline_axis = Properties.timeline_axis =
  1. | Block
  2. | Inline
  3. | X
  4. | Y
  5. | Axes of timeline_axis list
  6. | Initial
  7. | Inherit
  8. | Unset
  9. | Revert
  10. | Revert_layer
  11. | Var of timeline_axis var
type timeline_ident = Properties.timeline_ident =
  1. | None
  2. | Name of string

none | <dashed-ident>#, shared by scroll-timeline-name, view-timeline-name and Scroll-driven Animations 1 timeline-scope.

type timeline_name = Properties.timeline_name =
  1. | Names of timeline_ident list
  2. | Initial
  3. | Inherit
  4. | Unset
  5. | Revert
  6. | Revert_layer
  7. | Var of timeline_name var
type timeline_scope = Properties.timeline_scope =
  1. | None
  2. | Names of string list
  3. | Initial
  4. | Inherit
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of timeline_scope var

Scroll-driven Animations 1 timeline-scope: none | <dashed-ident>#, where none stands for the whole value.

type timeline_shorthand_item = Properties.timeline_shorthand_item = {
  1. name : timeline_ident;
  2. axis : timeline_axis option;
}
type timeline_shorthand = Properties.timeline_shorthand =
  1. | Timelines of timeline_shorthand_item list
  2. | Initial
  3. | Inherit
  4. | Unset
  5. | Revert
  6. | Revert_layer
  7. | Var of timeline_shorthand var
type view_timeline_shorthand_item = Properties.view_timeline_shorthand_item = {
  1. name : timeline_ident;
  2. axis : timeline_axis option;
  3. inset : Properties.timeline_inset option;
}
type view_timeline_shorthand = Properties.view_timeline_shorthand =
  1. | Timelines of view_timeline_shorthand_item list
  2. | Initial
  3. | Inherit
  4. | Unset
  5. | Revert
  6. | Revert_layer
  7. | Var of view_timeline_shorthand var
type timeline_inset_item = Properties.timeline_inset_item =
  1. | Auto
  2. | Length of length_percentage

One edge of Scroll-driven Animations 1 view-timeline-inset.

type timeline_inset = Properties.timeline_inset =
  1. | Inset of timeline_inset_item * timeline_inset_item option
  2. | Insets of timeline_inset list
  3. | Initial
  4. | Inherit
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of timeline_inset var

Sec. 5.2 view-timeline-inset: the start edge then the end edge.

type animation_range_name = Properties.animation_range_name =
  1. | Cover
  2. | Contain
  3. | Entry
  4. | Exit
  5. | Entry_crossing
  6. | Exit_crossing

Sec. 6.2 <timeline-range-name>: the named part of a view progress timeline.

type animation_range_item = Properties.animation_range_item =
  1. | Normal
  2. | Items of animation_range_item list
  3. | Offset of length_percentage
  4. | Named of animation_range_name * length_percentage option
  5. | Initial
  6. | Inherit
  7. | Unset
  8. | Revert
  9. | Revert_layer
  10. | Var of animation_range_item var

Sec. 6.2: one end of animation-range.

type animation_range = Properties.animation_range =
  1. | Range of animation_range_item * animation_range_item option
  2. | Ranges of animation_range list
  3. | Initial
  4. | Inherit
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of animation_range var

Sec. 6.2 animation-range: the start then the end.

Sourceval animation_timeline : animation_timeline -> declaration

animation_timeline v is the animation-timeline property.

Sourceval animation_range : animation_range -> declaration

animation_range v is the animation-range shorthand.

Sourceval animation_range_start : animation_range_item -> declaration

animation_range_start v is the animation-range-start property.

Sourceval animation_range_end : animation_range_item -> declaration

animation_range_end v is the animation-range-end property.

Sourceval scroll_timeline : timeline_shorthand -> declaration

scroll_timeline v is the scroll-timeline shorthand.

Sourceval scroll_timeline_name : timeline_name -> declaration

scroll_timeline_name v is the scroll-timeline-name property.

Sourceval scroll_timeline_axis : timeline_axis -> declaration

scroll_timeline_axis v is the scroll-timeline-axis property.

view_timeline v is the view-timeline shorthand.

Sourceval view_timeline_name : timeline_name -> declaration

view_timeline_name v is the view-timeline-name property.

Sourceval view_timeline_axis : timeline_axis -> declaration

view_timeline_axis v is the view-timeline-axis property.

Sourceval view_timeline_inset : timeline_inset -> declaration

view_timeline_inset v is the view-timeline-inset property.

Sourceval timeline_scope : timeline_scope -> declaration

timeline_scope v is the timeline-scope property.

Sourceval touch_action : touch_action -> declaration

touch_action action is the touch-action property.

Sourceval scroll_snap_type : scroll_snap_type -> declaration

scroll_snap_type type_ is the scroll-snap-type property.

Sourceval scroll_snap_align : scroll_snap_align -> declaration

scroll_snap_align align is the scroll-snap-align property.

type scroll_snap_stop = Properties.scroll_snap_stop =
  1. | Normal
  2. | Always
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of scroll_snap_stop var

CSS scroll-snap-stop values

Sourceval scroll_snap_stop : scroll_snap_stop -> declaration

scroll_snap_stop stop is the scroll-snap-stop property.

type scroll_behavior = Properties.scroll_behavior =
  1. | Auto
  2. | Smooth
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of scroll_behavior var

CSS scroll behavior values

Sourceval scroll_behavior : scroll_behavior -> declaration

scroll_behavior behavior is the scroll-behavior property for smooth scrolling.

type color_scheme = Properties.color_scheme =
  1. | Normal
  2. | Light
  3. | Dark
  4. | Light_dark
  5. | Only_light
  6. | Only_dark
  7. | Only_light_dark
  8. | Custom of string list
  9. | Inherit
  10. | Initial
  11. | Unset
  12. | Revert
  13. | Revert_layer
  14. | Var of color_scheme var
Sourceval color_scheme : color_scheme -> declaration

color_scheme scheme is the color-scheme property for light/dark mode preference.

Sourceval scroll_margin : length list -> declaration

scroll_margin margin is the scroll-margin property.

Sourceval scroll_margin_top : length -> declaration

scroll_margin_top margin is the scroll-margin-top property.

Sourceval scroll_margin_right : length -> declaration

scroll_margin_right margin is the scroll-margin-right property.

Sourceval scroll_margin_bottom : length -> declaration

scroll_margin_bottom margin is the scroll-margin-bottom property.

Sourceval scroll_margin_left : length -> declaration

scroll_margin_left margin is the scroll-margin-left property.

Sourceval scroll_margin_inline : length list -> declaration

scroll_margin_inline margin is the scroll-margin-inline property.

Sourceval scroll_margin_inline_start : length -> declaration

scroll_margin_inline_start margin is the scroll-margin-inline-start property.

Sourceval scroll_margin_inline_end : length -> declaration

scroll_margin_inline_end margin is the scroll-margin-inline-end property.

Sourceval scroll_margin_block : length list -> declaration

scroll_margin_block margins is the scroll-margin-block property; takes 1 (both edges) or 2 (start, end) length values per the spec.

Sourceval scroll_margin_block_start : length -> declaration

scroll_margin_block_start margin is the scroll-margin-block-start property.

Sourceval scroll_margin_block_end : length -> declaration

scroll_margin_block_end margin is the scroll-margin-block-end property.

Sourceval scroll_padding : length list -> declaration

scroll_padding padding is the scroll-padding property.

Sourceval scroll_padding_top : length -> declaration

scroll_padding_top padding is the scroll-padding-top property.

Sourceval scroll_padding_right : length -> declaration

scroll_padding_right padding is the scroll-padding-right property.

Sourceval scroll_padding_bottom : length -> declaration

scroll_padding_bottom padding is the scroll-padding-bottom property.

Sourceval scroll_padding_left : length -> declaration

scroll_padding_left padding is the scroll-padding-left property.

Sourceval scroll_padding_inline : length list -> declaration

scroll_padding_inline padding is the scroll-padding-inline property.

Sourceval scroll_padding_inline_start : length -> declaration

scroll_padding_inline_start padding is the scroll-padding-inline-start property.

Sourceval scroll_padding_inline_end : length -> declaration

scroll_padding_inline_end padding is the scroll-padding-inline-end property.

Sourceval scroll_padding_block : length list -> declaration

scroll_padding_block padding is the scroll-padding-block property.

Sourceval scroll_padding_block_start : length -> declaration

scroll_padding_block_start padding is the scroll-padding-block-start property.

Sourceval scroll_padding_block_end : length -> declaration

scroll_padding_block_end padding is the scroll-padding-block-end property.

type overscroll_behavior = Properties.overscroll_behavior =
  1. | Auto
  2. | Contain
  3. | None
  4. | Inherit
  5. | Initial
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of overscroll_behavior var

CSS overscroll behavior values

Sourceval overscroll_behavior : overscroll_behavior list -> declaration

overscroll_behavior behaviors is the overscroll-behavior property.

Sourceval overscroll_behavior_x : overscroll_behavior -> declaration

overscroll_behavior_x behavior is the overscroll-behavior-x property.

Sourceval overscroll_behavior_block : overscroll_behavior -> declaration

overscroll_behavior_block v is the overscroll-behavior-block property.

Sourceval overscroll_behavior_inline : overscroll_behavior -> declaration

overscroll_behavior_inline v is the overscroll-behavior-inline property.

Sourceval overscroll_behavior_y : overscroll_behavior -> declaration

overscroll_behavior_y behavior is the overscroll-behavior-y property.

Sourceval accent_color : color -> declaration

accent_color color is the accent-color property for form controls.

Sourceval caret_color : color -> declaration

caret_color color is the caret-color property for the text input cursor.

Miscellaneous

Other properties that don't fit into specific categories.

Sourceval forced_color_adjust : forced_color_adjust -> declaration

forced_color_adjust adjust is the forced-color-adjust property.

type appearance = Properties.appearance =
  1. | None
  2. | Auto
  3. | Button
  4. | Textfield
  5. | Menulist
  6. | Base_select
  7. | Inherit
  8. | Initial
  9. | Unset
  10. | Revert
  11. | Revert_layer
  12. | Var of appearance var
Sourceval appearance : appearance -> declaration

appearance app is the appearance property.

Sourceval moz_appearance : appearance -> declaration

moz_appearance v is the -moz-appearance property.

type tab_size = Properties.tab_size =
  1. | Number of number
  2. | Length of length
  3. | Initial
  4. | Inherit
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of tab_size var
Sourceval tab_size : int -> declaration

tab_size size is the tab-size property.

Sourceval tab_size_value : tab_size -> declaration

tab_size_value v is the tab-size property from a typed value, allowing a <length> in addition to an integer.

type scrollbar_width = Properties.scrollbar_width =
  1. | Auto
  2. | Thin
  3. | None
  4. | Initial
  5. | Inherit
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of scrollbar_width var
type scrollbar_color = Properties.scrollbar_color =
  1. | Auto
  2. | Colors of color * color
  3. | Initial
  4. | Inherit
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of scrollbar_color var
type scrollbar_gutter = Properties.scrollbar_gutter =
  1. | Auto
  2. | Stable
  3. | Stable_both_edges
  4. | Initial
  5. | Inherit
  6. | Unset
  7. | Revert
  8. | Revert_layer
  9. | Var of scrollbar_gutter var
Sourceval scrollbar_width : scrollbar_width -> declaration

scrollbar_width v is the scrollbar-width property.

Sourceval scrollbar_color : scrollbar_color -> declaration

scrollbar_color v is the scrollbar-color property.

Sourceval scrollbar_gutter : scrollbar_gutter -> declaration

scrollbar_gutter v is the scrollbar-gutter property.

type zoom = Properties.zoom =
  1. | Normal
  2. | Reset
  3. | Num of float
  4. | Pct of float
  5. | Calc of zoom calc
  6. | Initial
  7. | Inherit
  8. | Unset
  9. | Revert
  10. | Revert_layer
  11. | Var of zoom var
Sourceval zoom : zoom -> declaration

zoom v is the CSS zoom property.

Sourceval font_variation_settings : font_variation_settings -> declaration

font_variation_settings settings is the font-variation-settings property.

Custom Properties

Type-safe CSS custom properties (CSS variables) with GADT-based type checking.

type 'a kind = 'a Properties.kind =
  1. | Length : length kind
  2. | Color : color kind
  3. | Rgb : rgb kind
  4. | Number : number kind
  5. | Int : int kind
  6. | Float : float kind
  7. | Percentage : percentage kind
  8. | Length_percentage : length_percentage kind
  9. | Number_percentage : number_percentage kind
  10. | Opacity : opacity kind
  11. | Value : custom_value kind
  12. | Duration : duration kind
  13. | Aspect_ratio : aspect_ratio kind
  14. | Border_style : border_style kind
  15. | Outline_style : outline_style kind
  16. | Border : border kind
  17. | Font_weight : font_weight kind
  18. | Font_size : font_size kind
  19. | Line_height : line_height kind
  20. | Font_family : font_family kind
  21. | Font_feature_settings : font_feature_settings kind
  22. | Font_variation_settings : font_variation_settings kind
  23. | Numeric : font_variant_numeric kind
  24. | Font_variant_numeric_token : font_variant_numeric_token kind
  25. | Blend_mode : blend_mode kind
  26. | Scroll_snap_strictness : scroll_snap_strictness kind
  27. | Angle : angle kind
  28. | Rotate : rotate_value kind
  29. | Scale : scale kind
  30. | Shadow : shadow kind
  31. | Content : content kind
  32. | Gradient_stop : gradient_stop kind
  33. | Gradient_direction : gradient_direction kind
  34. | Gradient_position : gradient_position kind
  35. | Radial_shape : radial_shape kind
  36. | Radial_size : radial_size kind
  37. | Position_value : position_value kind
  38. | Animation : animation kind
  39. | Timing_function : timing_function kind
  40. | Transform : transform kind
  41. | Touch_action : touch_action kind
  42. | Transition_property_value : transition_property_value kind
  43. | Background_image : background_image kind
  44. | Z_index : z_index kind
  45. | Filter : filter kind
  46. | Font_src : Font_face.src kind

Value kind GADT for typed custom properties

type meta = Values.meta = ..

The type for CSS variable metadata.

Sourceval var_meta : 'a var -> meta option

var_meta v is the optional metadata associated with v.

Sourceval meta : unit -> ('a -> meta) * (meta -> 'a option)

meta () returns a fresh injection/projection pair for storing values of type 'a inside meta.

Sourceval var_ref : ?fallback:'a fallback -> ?default:'a -> ?layer:string -> ?meta:meta -> ?runtime:bool -> string -> 'a var

var_ref ?fallback ?default ?layer ?meta ?runtime name is a CSS variable reference. This is primarily for the CSS parser to create var() references.

  • name is the variable name (without the -- prefix)
  • fallback is used inside var(--name, fallback) in CSS output
  • default is the resolved value when mode is Inline
  • layer is an optional CSS layer name
  • meta is optional metadata.

CSS @property Support

type 'a syntax = 'a Variables.syntax =
  1. | Length : length syntax
  2. | Color : color syntax
  3. | Number : float syntax
  4. | Integer : int syntax
  5. | Percentage : percentage syntax
  6. | Length_percentage : length_percentage syntax
  7. | Angle : angle syntax
  8. | Time : duration syntax
  9. | Resolution : string syntax
  10. | Custom_ident : string syntax
  11. | String : string syntax
  12. | Url : string syntax
  13. | Image : background_image syntax
  14. | Transform_function : string syntax
  15. | Transform_list : string syntax
  16. | Universal : string syntax
  17. | Or : 'a syntax * 'b syntax -> ('a, 'b) Either.t syntax
  18. | Plus : 'a syntax -> 'a list syntax
  19. | Hash : 'a syntax -> 'a list syntax
  20. | Ident_keyword : string -> unit syntax

Type-safe syntax descriptors for CSS @property rules per CSS Properties and Values API 1 sec. 2.

Sourceval property : name:string -> 'a syntax -> ?initial_value:'a -> ?inherits:bool -> unit -> t

property ~name syntax ?initial_value ?inherits () creates a @property rule for registering a custom CSS property with type-safe syntax and initial value.

Examples:

  • property ~name:"--my-color" Variables.Color ~initial_value:(hex "#ff0000") ()
  • property ~name:"--my-size" Variables.Length ~initial_value:(Px 10.) ()

See MDN @property.

Sourceval var : ?default:'a -> ?fallback:'a fallback -> ?layer:string -> ?meta:meta -> ?runtime:bool -> string -> 'a kind -> 'a -> declaration * 'a var

var ?default ?fallback ?layer ?runtime name kind value returns a declaration and a variable handle. With ~runtime:true a context keeps the var() reference instead of folding it to value, so a runtime stylesheet or script can still override --name.

  • name is the variable name without the -- prefix
  • kind specifies the value type (Length, Color, Angle, Float, etc.)
  • default specifies the value to use in inline mode instead of var() reference
  • fallback is used inside var(--name, fallback) in CSS output
  • layer is an optional CSS layer name where the variable should be placed

Example:

open Cascade.Css

let def_radius, radius_var = var "radius-md" Length (Rem 0.5)

let card =
  rule ~selector:(Selector.class_ "card")
    [ def_radius; border_top_left_radius (Var radius_var) ]

The returned radius_var must be wrapped with Var when used in CSS properties. In variables mode, it emits "--radius-md: 0.5rem" and uses "var(--radius-md)". In inline mode, it uses "0.5rem" directly when the default equals the defined value.

Sourceval meta_of_declaration : declaration -> meta option

meta_of_declaration decl extracts metadata from a declaration if it has any.

Sourceval custom_property : ?layer:string -> string -> string -> declaration

custom_property ?layer name value is a CSS custom property declaration.

For type-safe variable declarations and usage, prefer using the var API which provides compile-time checking and automatic variable management.

  • parameter layer

    Optional CSS layer name for the custom property

  • parameter name

    CSS custom property name: a <dashed-ident>

  • parameter value

    the <declaration-value>? CSS Variables 1 sec. 2 gives a custom property, as CSS text

It raises Failure on a pair that does not make the one declaration it names, such as a value carrying a top-level ; or } or an unterminated function, block or string. A name holding a code point no bare ident carries is written back with the escapes that read it. Declaration.parse_custom_property is the same check as an option.

Example: custom_property "--primary-color" "#3b82f6"

See also var (type-safe CSS variable API).

Sourceval parse_declaration : ?layer:string -> string -> string -> declaration option

parse_declaration ?layer property value reads property and value with the full declaration parser. The two are read as the tokens they are rather than as one "property: value" text, so a property carrying a ;, a } or a : names this declaration or names none:

  • a known property (e.g. mask-type, display) becomes a typed declaration;
  • a custom property (--x) or an unknown property keeps its parsed component stream, so var() references in value are visible to vars_of_declarations (unlike custom_property, which forces an opaque token value);
  • None if value does not parse.

layer applies only to a custom property.

Sourceval custom_declaration_name : declaration -> string option

custom_declaration_name decl is the variable name if decl is a custom property declaration, None otherwise.

Sourceval custom_declaration_layer : declaration -> string option

custom_declaration_layer decl is the declared layer for a custom property declaration if present (e.g., "theme" or "utilities"). It is None for non-custom declarations or when no layer metadata is attached.

Printing & Optimization

CSS output generation and performance optimization tools.

Printing

Functions for converting CSS structures to string output.

type mode = Stylesheet.mode =
  1. | Variables
  2. | Inline

Rendering mode for CSS output.

  • Variables: Standard rendering with CSS custom properties support
  • Inline: For inline styles (no at-rules, variables expanded with their values)
Sourceval to_string : ?minify:bool -> ?indent:int -> ?lossless:bool -> ?enforce_spec:bool -> ?rename_custom_property:(string -> string) -> t -> string

to_string ?minify ?indent ?lossless ?enforce_spec ?rename_custom_property stylesheet serialises a stylesheet to CSS. rename_custom_property rewrites every custom property name, without its leading --, wherever one is written: the name a declaration declares and the name a var() reads. That is how a sheet is namespaced without rebuilding the typed values its references live in. Pure formatter - no optimisation, no theme resolution, no var() substitution. Run optimize, resolve_theme, and inline_vars explicitly when those passes are needed. Spec recovery (drop invalid declarations and empty rules) still applies because the parser preserved those shapes for round-trip and browsers discard them during parse. Unknown at-rules are preserved. Output never ends with a newline.

  • minify toggles compact serialisation (no insignificant whitespace).
  • indent sets the per-level indent width.
  • lossless suppresses colour-channel rounding in minified output.
  • enforce_spec suppresses target-dependent minified shortenings and keeps their spec-canonical serialisations.
Sourceval pp : t Pp.t

pp is the composable form of to_string. It applies the same invalid declaration and empty-rule filtering before printing.

Sourceval to_buffer : Buffer.t -> ?minify:bool -> ?indent:int -> ?lossless:bool -> ?enforce_spec:bool -> ?rename_custom_property:(string -> string) -> t -> unit

to_buffer buf stylesheet appends the serialised stylesheet to buf. Same options as to_string.

Sourcetype parse = {
  1. stylesheet : t;
  2. warnings : Error.t list;
  3. source : Source.t option;
}

A partially-recovered parse: the stylesheet composed of every rule that validated successfully, plus the warnings accumulated for rules that were dropped or section 5.3-recovered. Each warning is an Error.t stamped with the source filename when one was supplied. source is Some only when parsing requested source fidelity.

Sourceval of_string : ?strict:bool -> ?filename:string -> ?meta:Loc.meta_level -> ?enforce_spec:bool -> ?preserve_source:bool -> string -> (parse, Error.t) result

of_string ?strict css parses css with CSS Syntax 3 (ED) section 5.4 recovery. Returns Ok { stylesheet; warnings } when no fatal syntax error escapes recovery; warnings carries every typed diagnostic the parser collected (unknown at-rules, unknown properties, invalid values, ...). With ~strict:true a non-empty warnings list collapses to Error (first warning) - useful in linters and CI gates that want to fail on any spec deviation. ?meta controls diagnostic richness; see Loc.meta_level.

enforce_spec (default false) restricts non-ASCII identifiers to the CSS Syntax 3 (ED) sec. 4.2 range list, which excludes most BMP symbols. The default accepts any code point >= U+0080, so a selector such as .text-\u{2197} reads rather than being dropped with a warning. Output is unaffected either way: a code point outside the range list is hex-escaped.

preserve_source (default false) retains the byte-exact input, located recovered syntax tree, comments, trivia ownership, and source-coordinate mapping in source. The snapshot describes only the authored parse: optimising, flattening, mapping, or otherwise transforming stylesheet neither mutates it nor fabricates locations for split, merged, dropped, or synthetic nodes.

Sourceval of_string_exn : ?strict:bool -> ?filename:string -> ?meta:Loc.meta_level -> ?enforce_spec:bool -> string -> t

of_string_exn ?strict css parses css like of_string, raises Error.Parse_error instead of returning Error, and discards the warnings list. In non-strict mode warnings are silently dropped; with ~strict:true any warning escalates to a raise.

Optimization

Tools for optimizing CSS output for performance and file size.

Sourceval canonicalize_rule_order : ?lossless:bool -> ?enforce_spec:bool -> ?judge:Optimize.targets -> t -> t

canonicalize_rule_order t projects cascade-equivalent stylesheets to one deterministic form: selector-list rules expand onto their branches, same-selector rules coalesce when no intervening write can observe the move (so a declaration hoisted into a shared group and the same declaration written inline converge), each rule's declarations sort into a canonical order among those with disjoint footprints (a shorthand and its longhand, or two writes of the same property, keep their cascade-significant order), and cascade-independent statements sort into a content-keyed linear extension of the cascade-conflict graph. Sharing a selector branch alone is not a conflict in this projection: after branch expansion, only overlapping cascade-property writes constrain their order. A @media / @supports / @container block whose transitive content is plain rules reads as one block per rule, so each rule moves on its own footprint and how the rules were grouped into blocks is no difference; adjacent blocks of one condition fold back together, and conflicting statements keep their relative order. Two equal @supports blocks may merge across an intervening non-important write that the later block shadows with the same selector and property whenever the condition holds. Two rules under a condition and its exact negation

  • an @media query, an @supports condition, or an @container query on one container name - never apply together, so their order is no difference. CSS Cascade 5 sec. 6.1 sorts by layer before order of appearance, so a named @layer block of style rules reads in the sheet's layer order, however a pin and the blocks spell that order, and its place among unlayered rules, @property and @keyframes is no difference; two blocks of one layer keep their order, and an @layer statement pins the layer order where it stands. A run of @property rules sorts by name, keeping the last registration of each, since CSS Properties and Values API 1 sec. 2 makes registrations for different names order-independent. A @media prelude is keyed as the Level 4 query Media Queries 4 makes it equal to - not all and (X) as not (X), min-X/max-X as the range form, and a lower bound met by an upper bound as the two-sided interval - and an @container prelude the same way, which emission cannot do because a Level 3 parser rejects the shorter forms. A color(srgb ...) whose channels all land on a whole byte is keyed as the rgb() spelling of the same colour, which emission cannot do either because color() needs a browser that parses it. A none channel of a Lab-family colour standing as a whole colour-longhand value, or as a colour function of a custom-property token stream, is keyed as the zero CSS Color 4 sec. 4.4 says a missing component behaves as, so a converted achromatic oklab() meets the hex a minifier writes for it; sec. 13.3 keeps that off the positions the sheet interpolates, so a gradient stop, a color-mix() operand, @keyframes, @starting-style and a colour whose own rule transitions the property it writes, a custom property named by its own name included, keep their none, and lossless bounds how far the resolved colour respells. An angle is keyed as the degrees it names, which CSS Values 4 sec. 6.1 makes one dimension under deg, grad, rad and turn, in the rotate property, in a transform function and in an unregistered custom property's stream, a converted unit rounded to the six-significant-figure budget a quotient takes; lossless keeps the unit as written. An @supports guard false however a user agent answers its feature tests, reading a parenthesised <general-enclosed> term as the false CSS Conditional 3 sec. 6.1 makes it (Supports.never_holds), is dropped with its block under either reading, since no reading answers it yes. An identical -webkit-text-decoration-color compatibility declaration is dropped when its unprefixed twin is present; a differing or prefixed-only declaration is retained. These are comparison-side normalisations; this function does not change optimize's configured emission policy.
Sourceval optimize : ?scope:Optimize.scope -> ?targets:Optimize.targets -> ?judge:Optimize.targets -> ?flatten_nesting:bool -> ?lossless:bool -> ?enforce_spec:bool -> ?aggressive:bool -> ?regroup:bool -> ?closed_world:bool -> ?objective:Optimize.objective -> ?prune_unused_custom_props:bool -> ?stats:Stats.t -> t -> t

optimize ?scope ?targets ?judge ?flatten_nesting ?lossless ?enforce_spec ?aggressive ?regroup ?closed_world ?objective ?prune_unused_custom_props ?stats stylesheet applies CSS optimizations to the stylesheet, including merging consecutive identical selectors and combining rules with identical properties. Preserves CSS cascade semantics for any DOM, unless closed_world is set.

scope (default `Fragment) gates partial-coverage shorthand synthesis. Pass `Stylesheet when the caller controls the whole author stylesheet graph. See Optimize.scope for the details.

targets defaults to Optimize.evergreen_targets and owns compatibility prefix generation. It is ignored when enforce_spec is true.

judge, unset by default, names the browsers the sheet is judged for; see Optimize.stylesheet.

When flatten_nesting is true (default false) the optimizer also desugars nested rules into flat top-level rules; see Optimize.stylesheet.

When lossless is true (default false), bounded colour and numeric approximation is disabled while exact canonicalisation still runs. Independent declarations retain their authored order rather than being sorted for compression, preserving stylesheet-text and CSSOM observability.

When enforce_spec is true (default false) the optimizer drops the evergreen-browser target facts: a vendor-prefixed declaration is kept beside its unprefixed twin, a media or container feature keeps its min-/max- form rather than the shorter Media Queries 4 range grammar, and a nested selector keeps its & prefix.

When aggressive is true (default false) the global factoring fixpoint runs even when the preflight predicts low gain, and the top-level statement-optimisation pipeline iterates until the AST reaches a structural fixpoint (capped at a small bound).

When regroup is true (the default), order-dependent adjacent rule runs may be regrouped by factoring shared declarations and synthesising nesting. Canonical diff projection disables it to remain confluent; see Optimize.stylesheet.

When closed_world is true (default false) the optimizer assumes the caller knows the exact HTML and that no element ever matches two clashing selectors, so it may merge rules it would otherwise keep apart. Unsafe: the page can render wrong if such an element appears, including one a script adds at runtime. This is about the HTML, separate from scope (how much of the CSS you control). The default is safe for any page.

objective (default `Transfer) is the size metric factoring is judged by: under `Transfer, a global factoring result that grows the estimated DEFLATE (gzip) size of the output is discarded even when it shrinks raw bytes, since repeated declaration text is nearly free once compressed. Pass `Raw to keep every raw-byte win, the right objective when the output ships uncompressed (inline HTML style attributes, email HTML).

When prune_unused_custom_props is true (default false) custom-property bindings referenced by no var() anywhere are dropped. Opt-in: it assumes a complete stylesheet with no out-of-band reader (another stylesheet, or getComputedStyle), the same closed-world assumption as inline_vars.

stats records what this run did; read it back with Stats.snapshot. Without it the run counts into a recorder of its own that nobody reads.

Sourceval flatten_nesting : t -> t

flatten_nesting stylesheet returns the stylesheet with every nested rule flattened into a top-level rule (without running the rest of the optimization passes). Child selectors with & have the parent substituted in; selectors without & are joined to the parent with the descendant combinator; at-rules nested inside a rule are emitted at the top level with the parent selector applied to their inner rules.

Closed-world inlining

Transforms that assume the caller controls properties the open web cannot guarantee (no undeclared runtime mutation, full file resolution).

Sourceval inline_vars : ?keep_vars:string list -> ?inline_runtime:bool -> ?warn:(string -> unit) -> t -> t

inline_vars ?keep_vars ?inline_runtime ?warn stylesheet substitutes var(--name) references with the value of the corresponding --name declaration and deletes the definition, but only for a variable with a single definition. A variable in keep_vars, or one redefined in a different scope (a real cascade override such as dark mode), keeps its definition and stays a live var() reference; warn is called with each such name. The transform assumes no runtime mutation of the variables it inlines: a reference marked ~runtime on var_ref also stays live, fallback included, so a browser-time override point survives, unless inline_runtime (default false) is true, in which case such a reference folds like any other whose variable the sheet defines once. A style() container query reads the computed value of the custom property it names, so that property stays live as well.

Every @layer wrapper is spliced into its parent and the @layer-decl rules ordering them go with it. A @property registration goes only when the substitution left neither a declaration of its property nor a var() reading it: its initial-value and inherits descriptors decide computed values, so a property that stays live keeps its registration.

Sourceval resolve_theme : ?theme:Pp.String_set.t -> ?theme_defaults:(string -> string option) -> t -> t

resolve_theme ?theme ?theme_defaults stylesheet resolves theme guards and external theme defaults as an explicit AST transformation. to_string is a pure formatter and does not perform this step.

theme names the variables whose var() references stay live. When theme is given, references to any other name are inlined to the value theme_defaults resolves for it.

theme_defaults maps a custom-property name to its value and is the source of global theme-token definitions. An answer binds only when the name and the value make one custom-property declaration - a <dashed-ident> name and a CSS Syntax 3 (ED) sec. 7.2 <declaration-value>, as Declaration.parse_custom_property checks. Any other answer, such as one carrying a } or a top-level ;, reads as no default at all and leaves the reference live. Every var() reference that is undefined in stylesheet and resolvable through theme_defaults - transitively, and only when the whole chain closes without a cycle or dead end - is emitted as a definition in the root-scope theme block: merged into an existing :root / :host rule, or a fresh :root. A name with no theme_defaults value (e.g. a runtime --tw-* variable) is left free, so non-theme variables are gated out.

Root scope is deliberate. Per CSS Custom Properties L1 a custom property is inherited and resolved per element at computed-value time, so var(--x) needs --x defined on the element or an ancestor. A value theme_defaults supplies is a global token: defining it at :root / :host makes it inherit to every element and stay globally overridable, whereas defining it on the element-scoped rule that happens to reference it would confine and shadow it.

Sourceval add_var_fallbacks : (string -> string option) -> t -> t

add_var_fallbacks lookup stylesheet gives every var(--name) reference in stylesheet that has no fallback of its own the value lookup "--name" answers, as its fallback, in every declaration a custom property's value included. A reference that already carries a fallback keeps it, and the references inside that fallback are given theirs, so var(--a, var(--b)) can become var(--a, var(--b, 1px)). A name lookup does not answer, and an answer that is not a CSS Syntax 3 (ED) sec. 7.2 <declaration-value>, leave the reference as it was.

This is how a sheet whose tokens are declared somewhere else still resolves each one where no declaration reaches it: CSS Variables 1 sec. 3 substitutes the fallback for a custom property left at its guaranteed-invalid initial value, and a declared one still wins. Unlike resolve_theme, no reference is inlined and no definition is emitted.

Sourceval decode_import_url : string -> string

decode_import_url s strips the url(...) wrapper and any surrounding quotes from an @import URL string as held in Stylesheet.import_rule.url. The parser preserves the verbatim source form there for round-tripping; this helper recovers the bare URL.

Sourceval inline_imports : ?query:Context.query -> ?layer_order:string list -> Context.loader -> t -> t

inline_imports ?query ?layer_order loader stylesheet replaces every @import rule in stylesheet with the body of the imported stylesheet looked up through loader. Imports the loader cannot resolve, or that fail their media/supports/layer guard, are left in place. The walk descends into nested at-rules and rule bodies, so imports declared inside them are inlined too; the caller is responsible for preloading loader.imports with every transitively-referenced stylesheet body.

type will_change = Properties.will_change =
  1. | Will_change_auto
  2. | Scroll_position
  3. | Contents
  4. | Transform
  5. | Opacity
  6. | Properties of string list
    (*

    Custom CSS property names

    *)
  7. | Initial
  8. | Inherit
  9. | Unset
  10. | Revert
  11. | Revert_layer
  12. | Var of will_change var

CSS will-change property values for performance optimization hints.

Sourceval will_change : will_change -> declaration

will_change value is the will-change property for performance optimization.

Sourceval inline_style_of_declarations : ?optimize:bool -> ?minify:bool -> ?mode:mode -> declaration list -> string

inline_style_of_declarations declarations converts a list of declarations to an inline style string.

Pretty-printing functions for types

val pp_display : display Pp.t

pp_display is the pretty printer for display values.

val pp_position : position Pp.t

pp_position is the pretty printer for position values.

Sourceval pp_length : ?always:bool -> length Pp.t

pp_length ?always is the pretty printer for length values. When always is true, units are always included even for zero values.

Sourceval pp_color : color Pp.t

pp_color is the pretty printer for color values.

Sourceval pp_angle : angle Pp.t

pp_angle is the pretty printer for angle values.

Sourceval pp_duration : duration Pp.t

pp_duration is the pretty printer for duration values.

val pp_font_weight : font_weight Pp.t

pp_font_weight is the pretty printer for font-weight values.

val pp_cursor : cursor Pp.t

pp_cursor is the pretty printer for cursor values.

val pp_animation : animation Pp.t

pp_animation is the pretty printer for animation values.

val pp_gradient_direction : gradient_direction Pp.t

pp_gradient_direction is the pretty printer for gradient directions.

val pp_transform : transform Pp.t

pp_transform is the pretty printer for transform values.

Sourceval pp_calc : ?unwrap_num:bool -> ?unwrap:('a -> bool) -> ?pp_unwrapped:'a Pp.t -> 'a Pp.t -> 'a calc Pp.t

pp_calc ?unwrap_num ?unwrap ?pp_unwrapped pp_value is the pretty printer for calc expressions. pp_unwrapped writes the one leaf that comes out of the call, which is no longer an operand; it defaults to pp_value. Minified output drops the call around a single leaf, and unwrap says which leaves that is safe for. unwrap_num is the same question for a bare number leaf, which a property taking an <integer> answers no to.

val pp_font_style : font_style Pp.t

pp_font_style is the pretty printer for font-style values.

val pp_text_align : text_align Pp.t

pp_text_align is the pretty printer for text-align values.

val pp_text_decoration : text_decoration Pp.t

pp_text_decoration is the pretty printer for text-decoration values.

val pp_text_transform : text_transform Pp.t

pp_text_transform is the pretty printer for text-transform values.

val pp_text_wrap_mode : text_wrap_mode Pp.t

pp_text_wrap_mode is the pretty printer for text-wrap-mode values.

val pp_text_wrap_style : text_wrap_style Pp.t

pp_text_wrap_style is the pretty printer for text-wrap-style values.

val pp_text_box_trim : text_box_trim Pp.t

pp_text_box_trim is the pretty printer for text-box-trim values.

val pp_text_spacing_trim : text_spacing_trim Pp.t

pp_text_spacing_trim is the pretty printer for text-spacing-trim values.

val pp_hyphenate_limit_chars : hyphenate_limit_chars Pp.t

pp_hyphenate_limit_chars is the pretty printer for hyphenate-limit-chars values.

val pp_initial_letter : initial_letter Pp.t

pp_initial_letter is the pretty printer for initial-letter values.

val pp_overflow : overflow Pp.t

pp_overflow is the pretty printer for overflow values.

val pp_border_spacing : border_spacing Pp.t

pp_border_spacing is the pretty printer for border-spacing values.

val pp_border_style : border_style Pp.t

pp_border_style is the pretty printer for border-style values.

val pp_outline_style : outline_style Pp.t

pp_outline_style is the pretty printer for outline-style values.

val pp_scroll_snap_strictness : scroll_snap_strictness Pp.t

pp_scroll_snap_strictness is the pretty printer for scroll-snap-strictness values.

val pp_flex_direction : flex_direction Pp.t

pp_flex_direction is the pretty printer for flex-direction values.

val pp_flex_flow : flex_flow Pp.t

pp_flex_flow is the pretty printer for flex-flow values.

val pp_flex_factor : flex_factor Pp.t

pp_flex_factor is the pretty printer for flex factor values.

val pp_align_items : align_items Pp.t

pp_align_items is the pretty printer for align-items values.

val pp_justify_content : justify_content Pp.t

pp_justify_content is the pretty printer for justify-content values.

Sourceval media_min_width_length : length -> Media.t

media_min_width_length l creates a min-width media condition from a CSS length. Bridges the type gap between Css.length and Media's internal length type.

Sourceval media_not_min_width_length : length -> Media.t

media_not_min_width_length l creates a negated min-width media condition from a CSS length.

Sourceval parse_length : string -> length option

parse_length s parses a CSS length string (including calc() expressions) using the CSS reader. Returns None if parsing fails.

Sourceval parse_color : string -> color option

parse_color s parses a CSS color string (e.g., "rgba(48,163,0,0.14)", "oklch(0.5 0.2 240)") using the CSS reader. Returns None if parsing fails.

Sourceval parse_shadow : string -> shadow option

parse_shadow s parses a CSS shadow string, including comma-separated multi-shadow values. Returns None if parsing fails.

Sourceval parse_font_family : string -> font_family option

parse_font_family s parses a CSS font-family value: a single family, a generic keyword, or a comma-separated stack. Returns None if parsing fails.

Sourceval parse_list_style_type : string -> list_style_type option

parse_list_style_type s parses a CSS list-style-type value (a counter style keyword, a string, or symbols()). Returns None if parsing fails.

Sourceval parse_list_style_image : string -> list_style_image option

parse_list_style_image s parses a CSS list-style-image value (none, a url(), or a gradient). Returns None if parsing fails.

Sourceval parse_background_image : string -> background_image list option

parse_background_image s parses a CSS background-image value, including comma-separated multiple images. Returns None if parsing fails.