Module Css

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.

The main notions are:

Minimal example:

  open 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 (Rem 0.375)
      ]
  in
  to_string (v [ button ])

Custom properties:

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

Interface

Core Concepts - Core CSS system setup and construction:

Declarations - Core value types and declaration building:

Property Categories - Organized CSS properties by functionality:

Rendering & Optimization - CSS output and performance:

Advanced Features - Specialized functionality:

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.

CSS Selectors

Structured representation of CSS selectors for targeting HTML elements.

See https://www.w3.org/TR/selectors-4/ CSS Selectors Level 4.

module Selector : sig ... end

CSS selectors: core types and helpers.

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.

type declaration

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

type statement

The type for CSS statements.

val rule : selector:Selector.t -> ?nested:statement list -> declaration list -> statement

rule ~selector declarations creates a CSS rule statement with the given selector and declarations.

val statement_selector : statement -> Selector.t option

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

val statement_declarations : statement -> declaration list option

statement_declarations stmt returns Some declarations if the statement is a rule, None otherwise.

val 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.

val as_layer : statement -> (string option * statement list) option

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

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

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

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

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

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

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

val 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.

val 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.

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

map f stmts applies f to all rules in stmts, recursively descending into nested containers (media, supports, layers, etc.).

  • Rules are transformed while non-rule statements are preserved
  • Traversal is depth-first, processing nested containers recursively
  • Transformation is applied to all rules at all nesting levels
  • Non-rule statements (at-rules without rule content) maintain their relative order.
val sort : ((Selector.t * declaration list) -> (Selector.t * declaration list) -> int) -> statement list -> statement list

sort cmp stmts sorts rules within stmts using the comparison function cmp, recursively descending into nested containers.

  • Sort is stable: equal elements maintain their relative order
  • Non-rule statements are preserved in their original positions
  • Sorting occurs independently within each container level
  • Nested containers (media, supports, layers) have their rules sorted recursively.
type 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

val 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

val keyframes : string -> keyframe list -> statement

keyframes name frames creates a @keyframes rule.

Example:

  keyframes "pulse"
    [
      {
        keyframe_selector = "50%";
        keyframe_declarations = [ opacity (Float 0.5) ];
      };
    ]

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

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

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

val 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.

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-3/ CSS Conditional Rules Module Level 3 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.

type t

The type for CSS stylesheets.

val empty : t

empty is an empty stylesheet.

val concat : t list -> t

concat stylesheets concatenates multiple stylesheets into one.

val v : statement list -> t

v statements creates a stylesheet from a list of statements.

val rule_statements : t -> statement list

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

val statements : t -> statement list

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

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

fold f acc css folds over all statements in css, recursively descending into nested structures (layers, media queries, containers, and supports rules). The function f is called for each statement in depth-first order.

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

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

media_queries t returns media queries and their rule statements.

val layers : t -> string list

layers t returns the layer names from the stylesheet.

AST Introspection Helpers

val layer_block : string -> t -> statement list option

layer_block name sheet extracts the statements from the named layer @layer name in the stylesheet. Returns None if the layer is not found.

val rules_from_statements : statement list -> (Selector.t * declaration list) list

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

val custom_prop_names : declaration list -> string list

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

val custom_props_from_rules : (Selector.t * declaration list) list -> string list

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

val custom_props : ?layer:string -> t -> string list

custom_props ?layer sheet recursively extracts all custom property names from the stylesheet. If layer is provided, only properties from that layer are extracted. Traverses nested @supports, @media, and other conditional blocks.

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

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

val 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.

val declarations : declaration list -> statement

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

val layer : ?name:string -> statement list -> statement

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

val layer_decl : string list -> statement

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

val layer_of : ?name:string -> t -> t

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

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

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

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

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

val starting_style : statement list -> statement

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

val 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)

type 'a var

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

val var_name : 'a var -> string

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

val var_layer : 'a var -> string option

var_layer v is the optional layer where v is defined.

val 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 =
  1. | V : 'a var -> any_var
    (*

    The type of CSS variables.

    *)
val vars_of_rules : statement list -> any_var list

vars_of_rules statements extracts all CSS variables referenced in rule statements' declarations, returning them sorted and deduplicated.

val vars_of_declarations : declaration list -> any_var list

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

val vars_of_stylesheet : t -> any_var list

vars_of_stylesheet stylesheet extracts all CSS variables referenced in the entire stylesheet, returning them sorted and deduplicated.

val any_var_name : any_var -> string

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

val 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.

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-3/ CSS Values and Units Module Level 3.

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

CSS calc operations.

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

    CSS variable

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

    Unitless number

    *)
  4. | Expr of 'a calc * calc_op * 'a calc
  5. | Nested of 'a calc
    (*

    Explicitly nested calc()

    *)

CSS calc values.

type 'a fallback =
  1. | Empty
    (*

    Empty fallback: var(--name,)

    *)
  2. | None
    (*

    No fallback: var(--name)

    *)
  3. | Fallback of 'a
    (*

    Value fallback: var(--name, value)

    *)
  4. | Var_fallback of string
    (*

    Nested var fallback: var(--name, var(--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 =
  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. | Rlh of float
  14. | Pct of float
  15. | Vw of float
  16. | Vh of float
  17. | Vmin of float
  18. | Vmax of float
  19. | Vi of float
  20. | Vb of float
  21. | Dvh of float
  22. | Dvw of float
  23. | Dvmin of float
  24. | Dvmax of float
  25. | Lvh of float
  26. | Lvw of float
  27. | Lvmin of float
  28. | Lvmax of float
  29. | Svh of float
  30. | Svw of float
  31. | Svmin of float
  32. | Svmax of float
  33. | Ch of float
    (*

    Character units

    *)
  34. | Lh of float
    (*

    Line height units

    *)
  35. | Auto
  36. | None
    (*

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

    *)
  37. | Zero
  38. | Inherit
  39. | Initial
  40. | Unset
  41. | Revert
  42. | Revert_layer
  43. | Fit_content
    (*

    fit-content keyword

    *)
  44. | Content
    (*

    content keyword

    *)
  45. | Max_content
    (*

    max-content keyword

    *)
  46. | Min_content
    (*

    min-content keyword

    *)
  47. | From_font
    (*

    from-font keyword for text-decoration-thickness

    *)
  48. | Clamp of string
    (*

    clamp() function

    *)
  49. | Min of string
    (*

    min() function

    *)
  50. | Max of string
    (*

    max() function

    *)
  51. | Minmax of string
    (*

    minmax() function for grid

    *)
  52. | Var of length var
    (*

    CSS variable reference

    *)
  53. | Calc of length calc
    (*

    Calculated expressions

    *)

CSS length values.

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

module Calc : sig ... end

Builder functions for calc() expressions.

type _ property

GADT for typed CSS properties.

type 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 =
  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 =
  1. | Int of int
  2. | Num of float
  3. | Pct of float
  4. | Var of channel var

CSS channel values (for RGB)

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

CSS alpha values (for HSL/HWB/etc)

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

CSS hue values (for HSL/HWB)

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

CSS color component values

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

CSS percentage values

type length_percentage =
  1. | Length of length
  2. | Pct of float
  3. | Var of length_percentage var
  4. | Calc of length_percentage calc
type 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 =
  1. | Shorter
  2. | Longer
  3. | Increasing
  4. | Decreasing
  5. | Default

CSS hue interpolation options

type system_color =
  1. | AccentColor
    (*

    Background of accented user interface controls

    *)
  2. | AccentColorText
    (*

    Text of accented user interface controls

    *)
  3. | ActiveText
    (*

    Text of active links

    *)
  4. | ButtonBorder
    (*

    Base border color of controls

    *)
  5. | ButtonFace
    (*

    Background color of controls

    *)
  6. | ButtonText
    (*

    Text color of controls

    *)
  7. | Canvas
    (*

    Background of application content or documents

    *)
  8. | CanvasText
    (*

    Text color in application content or documents

    *)
  9. | Field
    (*

    Background of input fields

    *)
  10. | FieldText
    (*

    Text in input fields

    *)
  11. | GrayText
    (*

    Text color for disabled items

    *)
  12. | Highlight
    (*

    Background of selected items

    *)
  13. | HighlightText
    (*

    Text color of selected items

    *)
  14. | LinkText
    (*

    Text of non-active, non-visited links

    *)
  15. | Mark
    (*

    Background of specially marked text

    *)
  16. | MarkText
    (*

    Text that has been specially marked

    *)
  17. | SelectedItem
    (*

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

    *)
  18. | SelectedItemText
    (*

    Text of selected items

    *)
  19. | VisitedText
    (*

    Text of visited links

    *)
  20. | 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 =
  1. | Hex of {
    1. hash : bool;
    2. value : string;
    }
    (*

    hash indicates if # was present

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

    OKLCH color space

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

    Oklab color space

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

    LCH color space

    *)
  10. | Named of color_name
    (*

    Named colors like Red, Blue, etc.

    *)
  11. | System of system_color
    (*

    CSS system colors like ButtonText, Canvas, etc.

    *)
  12. | Var of color var
  13. | Current
  14. | Transparent
  15. | Inherit
  16. | Initial
  17. | Unset
  18. | Revert
  19. | Revert_layer
  20. | 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.

val hex : string -> color

hex s is a hexadecimal color. Accepts with or without leading #. Examples: hex "#3b82f6", hex "ffffff".

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

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

val hsl : float -> float -> float -> color

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

val hsla : float -> float -> float -> float -> color

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

val hwb : float -> float -> float -> color

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

val hwba : float -> float -> float -> float -> color

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

val oklch : float -> float -> float -> color

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

val oklcha : float -> float -> float -> float -> color

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

val oklab : float -> float -> float -> color

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

val oklaba : float -> float -> float -> float -> color

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

val lch : float -> float -> float -> color

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

val lcha : float -> float -> float -> float -> color

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

val color_name : color_name -> color

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

val current_color : color

current_color is the CSS currentcolor value.

val transparent : color

transparent is the CSS transparent value.

val color_mix : ?in_space:color_space -> ?hue:hue_interpolation -> ?percent1:int -> ?percent2:int -> color -> color -> color

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

type angle =
  1. | Deg of float
  2. | Rad of float
  3. | Turn of float
  4. | Grad of float
  5. | Var of angle var
    (*

    CSS variable reference

    *)

CSS angle values

type aspect_ratio =
  1. | Auto
  2. | Ratio of float * float
  3. | Inherit

CSS aspect-ratio values

type 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. | Var of blend_mode var

CSS blend-mode values

type font_feature_settings =
  1. | Normal
  2. | Feature_list of string
  3. | Inherit
  4. | String of string
  5. | Var of font_feature_settings var

CSS font-feature-settings values

type font_variation_settings =
  1. | Normal
  2. | Axis_list of string
  3. | Inherit
  4. | String of string
  5. | Var of font_variation_settings var

CSS font-variation-settings values

val important : declaration -> declaration

important decl is decl marked as !important.

val declaration_is_important : declaration -> bool

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

val declaration_name : declaration -> string

declaration_name decl returns the property name of decl.

val 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.

val string_of_declaration : ?minify:bool -> declaration -> string

string_of_declaration ~minify decl converts a declaration to its string representation. If minify is true (default: false), the output is minified.

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 =
  1. | Border_box
  2. | Content_box
  3. | Inherit

CSS box sizing values.

type field_sizing =
  1. | Content
  2. | Fixed
  3. | Inherit

CSS field sizing values.

type caption_side =
  1. | Top
  2. | Bottom
  3. | Inherit

CSS caption side values.

val width : length -> declaration

width len is the width property.

val height : length -> declaration

height len is the height property.

val min_width : length -> declaration

min_width len is the min-width property.

val max_width : length -> declaration

max_width len is the max-width property.

val min_height : length -> declaration

min_height len is the min-height property.

val max_height : length -> declaration

max_height len is the max-height property.

val padding : length list -> declaration

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

val padding_top : length -> declaration

padding_top len is the padding-top property.

val padding_right : length -> declaration

padding_right len is the padding-right property.

val padding_bottom : length -> declaration

padding_bottom len is the padding-bottom property.

val padding_left : length -> declaration

padding_left len is the padding-left property.

val margin : length list -> declaration

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

val margin_top : length -> declaration

margin_top len is the margin-top property.

val margin_right : length -> declaration

margin_right len is the margin-right property.

val margin_bottom : length -> declaration

margin_bottom len is the margin-bottom property.

val margin_left : length -> declaration

margin_left len is the margin-left property.

val box_sizing : box_sizing -> declaration

box_sizing sizing is the box-sizing property.

val field_sizing : field_sizing -> declaration

field_sizing sizing is the field-sizing property.

val caption_side : caption_side -> declaration

caption_side side is the caption-side property.

val 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 =
  1. | Thin
  2. | Medium
  3. | Thick
  4. | Px of float
  5. | Rem of float
  6. | Em of float
  7. | Ch of float
  8. | Vh of float
  9. | Vw of float
  10. | Vmin of float
  11. | Vmax of float
  12. | Pct of float
  13. | Zero
  14. | Auto
  15. | Max_content
  16. | Min_content
  17. | Fit_content
  18. | From_font
  19. | Calc of border_width calc
  20. | Var of border_width var
  21. | Inherit
val border_inline_start_width : border_width -> declaration

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

val border_inline_end_width : border_width -> declaration

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

val border_inline_start_color : color -> declaration

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

val border_inline_end_color : color -> declaration

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

val padding_inline_start : length -> declaration

padding_inline_start len is the padding-inline-start property.

val padding_inline_end : length -> declaration

padding_inline_end len is the padding-inline-end property.

val padding_inline : length -> declaration

padding_inline len is the padding-inline shorthand property.

val padding_block : length -> declaration

padding_block len is the padding-block shorthand property.

val margin_inline : length -> declaration

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

val margin_inline_start : length -> declaration

margin_inline_start len is the margin-inline-start property.

val margin_inline_end : length -> declaration

margin_inline_end len is the margin-inline-end property.

val margin_block : length -> declaration

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

val margin_block_start : length -> declaration

margin_block_start len is the margin-block-start property.

val 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 =
  1. | Block
  2. | Inline
  3. | Inline_block
  4. | Flex
  5. | Inline_flex
  6. | Grid
  7. | Inline_grid
  8. | None
  9. | Flow_root
  10. | Table
  11. | Table_row
  12. | Table_cell
  13. | Table_caption
  14. | Table_column
  15. | Table_column_group
  16. | Table_header_group
  17. | Table_row_group
  18. | Inline_table
  19. | List_item
  20. | Contents
  21. | Webkit_box
  22. | Inherit
  23. | Initial
  24. | Unset

CSS display values.

type position =
  1. | Static
  2. | Relative
  3. | Absolute
  4. | Fixed
  5. | Sticky

CSS position values.

type visibility =
  1. | Visible
  2. | Hidden
  3. | Collapse

CSS visibility values.

type z_index =
  1. | Auto
  2. | Index of int

CSS z-index values.

type overflow =
  1. | Visible
  2. | Hidden
  3. | Scroll
  4. | Auto
  5. | Clip

CSS overflow values.

val display : display -> declaration

display d is the display property.

val position : position -> declaration

position p is the position property.

val inset : length -> declaration

inset len is the inset property for positioned elements.

val inset_inline : length -> declaration

inset_inline len is the inset-inline logical property.

val inset_inline_start : length -> declaration

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

val inset_inline_end : length -> declaration

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

val inset_block : length -> declaration

inset_block len is the inset-block logical property.

val inset_block_start : length -> declaration

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

val inset_block_end : length -> declaration

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

val top : length -> declaration

top len is the top property for positioned elements.

val right : length -> declaration

right len is the right property for positioned elements.

val bottom : length -> declaration

bottom len is the bottom property for positioned elements.

val left : length -> declaration

left len is the left property for positioned elements.

val z_index : z_index -> declaration

z_index z is the z-index property.

val z_index_auto : declaration

z_index_auto is the z-index property set to auto.

type isolation =
  1. | Auto
  2. | Isolate
  3. | Inherit

CSS isolation values

val isolation : isolation -> declaration

isolation iso is the isolation property for stacking context control.

val visibility : visibility -> declaration

visibility v is the visibility property.

type float_side =
  1. | None
  2. | Left
  3. | Right
  4. | Inline_start
  5. | Inline_end
  6. | Inherit

CSS float side values.

val float : float_side -> declaration

float side is the float property.

type clear =
  1. | None
  2. | Left
  3. | Right
  4. | Both
  5. | Inline_start
  6. | Inline_end

CSS clear values.

val clear : clear -> declaration

clear clr is the clear property.

val overflow : overflow -> declaration

overflow ov is the overflow property.

val overflow_x : overflow -> declaration

overflow_x ov is the overflow-x property.

val overflow_y : overflow -> declaration

overflow_y ov is the overflow-y property.

type content =
  1. | String of string
  2. | None
  3. | Normal
  4. | Open_quote
  5. | Close_quote
  6. | Var of content var

CSS content values

val content : content -> declaration

content c is the content property.

type object_fit =
  1. | Fill
  2. | Contain
  3. | Cover
  4. | None
  5. | Scale_down
  6. | Inherit

CSS object-fit values

val object_fit : object_fit -> declaration

object_fit fit is the object-fit property.

type position_value =
  1. | Center
  2. | Left_top
  3. | Left_center
  4. | Left_bottom
  5. | Right_top
  6. | Right_center
  7. | Right_bottom
  8. | Center_top
  9. | Center_bottom
  10. | XY of length * length
  11. | Inherit
  12. | Initial
  13. | Edge_offset_axis of string * length * string
  14. | Edge_offset_edge_offset of string * length * string * length
val object_position : position_value -> declaration

object_position pos is the object-position property.

type text_overflow =
  1. | Clip
  2. | Ellipsis
  3. | String of string
  4. | Inherit

CSS text-overflow values

val text_overflow : text_overflow -> declaration

text_overflow ov is the text-overflow property.

type text_wrap =
  1. | Wrap
  2. | No_wrap
  3. | Balance
  4. | Pretty
  5. | Inherit

CSS text-wrap values

val text_wrap : text_wrap -> declaration

text_wrap wrap is the text-wrap property.

type backface_visibility =
  1. | Visible
  2. | Hidden
  3. | Inherit

CSS backface-visibility values

val backface_visibility : backface_visibility -> declaration

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

type 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. | Inherit
    (*

    Inherit from parent

    *)
  5. | Var of content_visibility var
    (*

    CSS variable reference

    *)

CSS content-visibility values.

val content_visibility : content_visibility -> declaration

content_visibility vis is the content-visibility property.

type 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.

val quotes : quotes -> declaration

quotes q is the quotes property.

type list_style_position =
  1. | Inside
  2. | Outside
  3. | Inherit

CSS list-style-position values

val 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 =
  1. | Auto
  2. | None
  3. | Inherit

CSS forced-color-adjust values.

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

CSS background-repeat values.

type background_size =
  1. | Auto
  2. | Cover
  3. | Contain
  4. | Px of float
  5. | Rem of float
  6. | Em of float
  7. | Pct of float
  8. | Vw of float
  9. | Vh of float
  10. | Size of length * length
  11. | Inherit
  12. | Initial
  13. | Unset

CSS background-size values.

type background_attachment =
  1. | Scroll
  2. | Fixed
  3. | Local
  4. | Inherit

CSS background-attachment values.

type color_interpolation =
  1. | In_oklab
  2. | In_oklch
  3. | In_srgb
  4. | In_hsl
  5. | In_lab
  6. | In_lch

Color interpolation for gradients

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

Gradient direction values

type gradient_stop =
  1. | Var of gradient_stop var
    (*

    Single complex variable like var(--complex, fallback)

    *)
  2. | Color_percentage of color * percentage option * percentage option
    (*

    Color with optional percentage positions

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

    Color with optional length positions

    *)
  4. | Length of length
    (*

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

    *)
  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. | Direction of gradient_direction
    (*

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

    *)

Gradient stop values

type background_image =
  1. | Url of string
  2. | Linear_gradient of gradient_direction * gradient_stop list
  3. | 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))

    *)
  4. | Radial_gradient of gradient_stop list
  5. | None
  6. | Initial
  7. | Inherit

Background image values

type background_box =
  1. | Border_box
  2. | Padding_box
  3. | Content_box
  4. | Text
  5. | Inherit
type 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 =
  1. | Inherit
  2. | Initial
  3. | Unset
  4. | None
  5. | Var of background var
  6. | Shorthand of background_shorthand
    (*

    CSS background values.

    *)
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.
val color : color -> declaration

color c is the color property.

val background : background -> declaration

background bg is the background shorthand property.

val background_color : color -> declaration

background_color c is the background-color property.

val background_image : background_image -> declaration

background_image img is the background-image property.

val background_position : position_value list -> declaration

background_position pos is the background-position property.

val background_size : background_size -> declaration

background_size sz is the background-size property.

val background_repeat : background_repeat -> declaration

background_repeat rep is the background-repeat property.

val background_attachment : background_attachment -> declaration

background_attachment att is the background-attachment property.

val opacity : float -> 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 : gradient_stop list -> background_image

radial_gradient stops is a radial 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 =
  1. | Row
  2. | Row_reverse
  3. | Column
  4. | Column_reverse

CSS flex direction values.

type flex_wrap =
  1. | Nowrap
  2. | Wrap
  3. | Wrap_reverse

CSS flex wrap values.

type 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. | Rlh of float
  16. | Pct of float
  17. | Vw of float
  18. | Vh of float
  19. | Vmin of float
  20. | Vmax of float
  21. | Vi of float
  22. | Vb of float
  23. | Dvh of float
  24. | Dvw of float
  25. | Dvmin of float
  26. | Dvmax of float
  27. | Lvh of float
  28. | Lvw of float
  29. | Lvmin of float
  30. | Lvmax of float
  31. | Svh of float
  32. | Svw of float
  33. | Svmin of float
  34. | Svmax of float
  35. | Ch of float
  36. | Lh of float
  37. | Num of float
  38. | Zero
  39. | Inherit
  40. | Initial
  41. | Unset
  42. | Revert
  43. | Revert_layer
  44. | Fit_content
  45. | Max_content
  46. | Min_content
  47. | From_font
  48. | Var of flex_basis var
  49. | Calc of flex_basis calc

CSS flex basis values.

type flex =
  1. | Initial
    (*

    0 1 auto

    *)
  2. | Auto
    (*

    1 1 auto

    *)
  3. | None
    (*

    0 0 auto

    *)
  4. | Grow of float
    (*

    Single grow value

    *)
  5. | Basis of flex_basis
    (*

    1 1 <flex-basis>

    *)
  6. | Grow_shrink of float * float
    (*

    grow shrink 0%

    *)
  7. | Full of float * float * flex_basis
    (*

    grow shrink basis

    *)

CSS flex shorthand values.

type 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. | Left
  11. | Right
  12. | Safe_center
  13. | Safe_start
  14. | Safe_end
  15. | Safe_flex_start
  16. | Safe_flex_end
  17. | Safe_left
  18. | Safe_right
  19. | Unsafe_center
  20. | Unsafe_start
  21. | Unsafe_end
  22. | Unsafe_flex_start
  23. | Unsafe_flex_end
  24. | Unsafe_left
  25. | Unsafe_right
  26. | Space_between
  27. | Space_around
  28. | Space_evenly
  29. | Stretch

CSS align-content values. MDN: align-content

type 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. | Unsafe_center
  14. | Unsafe_start
  15. | Unsafe_end
  16. | Unsafe_self_start
  17. | Unsafe_self_end
  18. | Unsafe_flex_start
  19. | Unsafe_flex_end
  20. | Anchor_center

CSS align-items values. MDN: align-items

type justify_content =
  1. | Normal
  2. | Center
  3. | Start
  4. | End
  5. | Flex_start
  6. | Flex_end
  7. | Left
  8. | Right
  9. | Unsafe_center
  10. | Unsafe_start
  11. | Unsafe_end
  12. | Unsafe_flex_start
  13. | Unsafe_flex_end
  14. | Unsafe_left
  15. | Unsafe_right
  16. | Space_between
  17. | Space_around
  18. | Space_evenly
  19. | Stretch

CSS justify-content values. MDN: justify-content

type 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. | Unsafe_center
  15. | Unsafe_start
  16. | Unsafe_end
  17. | Unsafe_self_start
  18. | Unsafe_self_end
  19. | Unsafe_flex_start
  20. | Unsafe_flex_end

CSS align-self values. MDN: align-self

type 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

CSS justify-items values. MDN: justify-items

type 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

CSS justify-self values. MDN: justify-self

Alignment Properties

CSS Box Alignment properties for flexbox and grid layouts.

val 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.

val 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.

val 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.

val 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.

val 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.

val justify_self : justify_self -> declaration

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

val flex_direction : flex_direction -> declaration

flex_direction direction is the flex-direction property.

val flex_wrap : flex_wrap -> declaration

flex_wrap wrap is the flex-wrap property.

val flex : flex -> declaration

flex flex is the flex shorthand property.

val flex_grow : float -> declaration

flex_grow amount is the flex-grow property.

val flex_shrink : float -> declaration

flex_shrink amount is the flex-shrink property.

val flex_basis : length -> declaration

flex_basis basis is the flex-basis property.

val order : int -> declaration

order order is the order property.

type gap = {
  1. row_gap : length option;
  2. column_gap : length option;
}

CSS gap shorthand type.

val gap : gap -> declaration

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

val row_gap : length -> declaration

row_gap gap is the row-gap property.

val 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 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. | Fr of float
  12. | Auto
  13. | Min_content
  14. | Max_content
  15. | Inherit
  16. | Min_max of grid_template * grid_template
  17. | Fit_content of length
  18. | Repeat of int * grid_template list
  19. | Tracks of grid_template list
  20. | Named_tracks of (string option * grid_template) list
  21. | Subgrid
  22. | Masonry

CSS grid template values

type 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. | Span of int
    (*

    span 2, span 3, etc.

    *)

CSS grid line values

val grid_template_columns : grid_template -> declaration

grid_template_columns cols is the grid-template-columns property.

val grid_template_rows : grid_template -> declaration

grid_template_rows rows is the grid-template-rows property.

val grid_template_areas : string -> declaration

grid_template_areas areas is the grid-template-areas property.

val grid_template : grid_template -> declaration

grid_template template is the grid-template shorthand property.

val grid_auto_columns : grid_template -> declaration

grid_auto_columns cols is the grid-auto-columns property.

val grid_auto_rows : grid_template -> declaration

grid_auto_rows rows is the grid-auto-rows property.

type grid_auto_flow =
  1. | Row
  2. | Column
  3. | Dense
  4. | Row_dense
  5. | Column_dense

CSS grid-auto-flow values

val grid_auto_flow : grid_auto_flow -> declaration

grid_auto_flow flow is the grid-auto-flow property.

val grid_row_start : grid_line -> declaration

grid_row_start start is the grid-row-start property.

val grid_row_end : grid_line -> declaration

grid_row_end end_ is the grid-row-end property.

val grid_column_start : grid_line -> declaration

grid_column_start start is the grid-column-start property.

val grid_column_end : grid_line -> declaration

grid_column_end end_ is the grid-column-end property.

val grid_row : (grid_line * grid_line) -> declaration

grid_row (start, end) is the grid-row shorthand property.

val grid_column : (grid_line * grid_line) -> declaration

grid_column (start, end) is the grid-column shorthand property.

val grid_area : string -> declaration

grid_area area is the grid-area property.

type place_items =
  1. | Normal
  2. | Start
  3. | End
  4. | Center
  5. | Stretch
  6. | Align_justify of align_items * justify_items
  7. | Inherit

CSS place-items values

val place_items : place_items -> declaration

place_items items is the place-items shorthand property.

type place_content =
  1. | Normal
  2. | Start
  3. | End
  4. | Center
  5. | Stretch
  6. | Space_between
  7. | Space_around
  8. | Space_evenly
  9. | Align_justify of align_content * justify_content
  10. | Inherit

CSS place-content values

val place_content : place_content -> declaration

place_content content is the place-content shorthand property.

val 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 =
  1. | Weight of int
  2. | Normal
  3. | Bold
  4. | Bolder
  5. | Lighter
  6. | Inherit
  7. | Var of font_weight var
    (*

    CSS variable reference

    *)

CSS font weight values.

type text_align =
  1. | Left
  2. | Right
  3. | Center
  4. | Justify
  5. | Start
  6. | End
  7. | Match_parent
  8. | Inherit

CSS text align values.

type text_decoration_line =
  1. | None
  2. | Underline
  3. | Overline
  4. | Line_through

CSS text decoration values.

type text_decoration_style =
  1. | Solid
  2. | Double
  3. | Dotted
  4. | Dashed
  5. | Wavy
  6. | Inherit
type 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 =
  1. | None
  2. | Shorthand of text_decoration_shorthand
  3. | Inherit
  4. | Var of text_decoration 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 =
  1. | Normal
  2. | Italic
  3. | Oblique
  4. | Inherit

CSS font style values.

type text_transform =
  1. | None
  2. | Capitalize
  3. | Uppercase
  4. | Lowercase
  5. | Full_width
  6. | Full_size_kana
  7. | Inherit
  8. | Var of text_transform var

CSS text transform values.

type text_size_adjust =
  1. | None
  2. | Auto
  3. | Pct of float
  4. | Inherit

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

type 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. | Name of string
  88. | Var of font_family var
  89. | List of font_family list

CSS font-family values

val font_family : font_family -> declaration

font_family fonts is the font-family property.

val font_families : font_family list -> declaration

font_families fonts is the font-family property from a comma-separated list.

val font_size : length -> declaration

font_size size is the font-size property.

val font_weight : font_weight -> declaration

font_weight weight is the font-weight property.

val font_style : font_style -> declaration

font_style style is the font-style property.

type 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. | Inherit
  8. | Var of line_height var
  9. | Calc of line_height calc

CSS line-height values

val 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.

val letter_spacing : length -> declaration

letter_spacing spacing is the letter-spacing property.

val word_spacing : length -> declaration

word_spacing spacing is the word-spacing property.

val text_align : text_align -> declaration

text_align align is the text-align property.

val text_decoration : text_decoration -> declaration

text_decoration decoration is the text-decoration property.

val text_transform : text_transform -> declaration

text_transform transform is the text-transform property.

val text_indent : length -> declaration

text_indent indent is the text-indent property.

type white_space =
  1. | Normal
  2. | Nowrap
  3. | Pre
  4. | Pre_wrap
  5. | Pre_line
  6. | Break_spaces
  7. | Inherit

CSS white-space values

val white_space : white_space -> declaration

white_space space is the white-space property.

type word_break =
  1. | Normal
  2. | Break_all
  3. | Keep_all
  4. | Break_word
  5. | Inherit

CSS word-break values

val word_break : word_break -> declaration

word_break break is the word-break property.

val text_decoration_color : color -> declaration

text_decoration_color color is the text-decoration-color property.

val text_size_adjust : text_size_adjust -> declaration

text_size_adjust adjust is the text-size-adjust property.

val text_decoration_style : text_decoration_style -> declaration

text_decoration_style style is the text-decoration-style property.

val text_decoration_line : text_decoration_line -> declaration

text_decoration_line line is the text-decoration-line property.

val text_underline_offset : length -> declaration

text_underline_offset offset is the text-underline-offset property.

type overflow_wrap =
  1. | Normal
  2. | Break_word
  3. | Anywhere
  4. | Inherit

CSS overflow-wrap values

val overflow_wrap : overflow_wrap -> declaration

overflow_wrap wrap is the overflow-wrap property.

type hyphens =
  1. | None
  2. | Manual
  3. | Auto
  4. | Inherit

CSS hyphens values

val hyphens : hyphens -> declaration

hyphens hyphens is the hyphens property.

type font_stretch =
  1. | Pct of float
    (*

    Percentage values from 50% to 200%

    *)
  2. | Ultra_condensed
  3. | Extra_condensed
  4. | Condensed
  5. | Semi_condensed
  6. | Normal
  7. | Semi_expanded
  8. | Expanded
  9. | Extra_expanded
  10. | Ultra_expanded
  11. | Inherit

CSS font-stretch values

val font_stretch : font_stretch -> declaration

font_stretch stretch is the font-stretch property.

type 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
    (*

    Variable reference

    *)

CSS font-variant-numeric token values

type font_variant_numeric =
  1. | Normal
  2. | Tokens of font_variant_numeric_token list
  3. | Var of font_variant_numeric var
  4. | 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;
    }

CSS font-variant-numeric values

val 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.

val 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.

val 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.

val font_feature_settings : font_feature_settings -> declaration

font_feature_settings settings is the font-feature-settings property.

type shadow =
  1. | Shadow of {
    1. inset : bool;
    2. inset_var : string option;
      (*

      If set, outputs var(--<name>) before shadow values. Used by Tailwind's ring system for dynamic inset toggle.

      *)
    3. h_offset : length;
    4. v_offset : length;
    5. blur : length option;
    6. spread : length option;
    7. color : color option;
    }
  2. | None
  3. | Inherit
  4. | Initial
  5. | Unset
  6. | Revert
  7. | Revert_layer
  8. | Var of shadow var
  9. | List of shadow list

CSS shadow values

val shadow : ?inset:bool -> ?inset_var:string -> ?h_offset:length -> ?v_offset:length -> ?blur:length -> ?spread:length -> ?color:color -> unit -> shadow

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

val inset_ring_shadow : ?h_offset:length -> ?v_offset:length -> ?blur:length -> ?spread:length -> ?color:color -> unit -> shadow

inset_ring_shadow ?h_offset ?v_offset ?blur ?spread ?color () is an inset shadow value suitable for ring utilities. Defaults: h_offset=0px, v_offset=0px, blur=0px, spread=0px, color=Transparent.

type 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. | Inherit

CSS text-shadow values

val text_shadow : text_shadow -> declaration

text_shadow shadow is the text-shadow property.

val font : string -> declaration

font spec is the font shorthand property.

type direction =
  1. | Ltr
  2. | Rtl
  3. | Inherit

CSS direction values

val direction : direction -> declaration

direction dir is the direction property.

type unicode_bidi =
  1. | Normal
  2. | Embed
  3. | Isolate
  4. | Bidi_override
  5. | Isolate_override
  6. | Plaintext
  7. | Inherit

CSS unicode-bidi values

val unicode_bidi : unicode_bidi -> declaration

unicode_bidi bidi is the unicode-bidi property.

type writing_mode =
  1. | Horizontal_tb
  2. | Vertical_rl
  3. | Vertical_lr
  4. | Sideways_lr
  5. | Sideways_rl
  6. | Inherit

CSS writing-mode values

val writing_mode : writing_mode -> declaration

writing_mode mode is the writing-mode property.

val text_decoration_thickness : length -> declaration

text_decoration_thickness thick is the text-decoration-thickness property.

type text_decoration_skip_ink =
  1. | Auto
  2. | None
  3. | All
  4. | Inherit

CSS text-decoration-skip-ink values

val text_decoration_skip_ink : text_decoration_skip_ink -> declaration

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

Borders & Outlines

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

type border_style =
  1. | None
  2. | Solid
  3. | Dashed
  4. | Dotted
  5. | Double
  6. | Groove
  7. | Ridge
  8. | Inset
  9. | Outset
  10. | Hidden
  11. | Var of border_style var
    (*

    CSS variable reference

    *)

CSS border style values.

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

CSS border shorthand type.

type border =
  1. | Inherit
  2. | Initial
  3. | None
  4. | Shorthand of border_shorthand
type outline_style =
  1. | None
  2. | Solid
  3. | Dashed
  4. | Dotted
  5. | Double
  6. | Groove
  7. | Ridge
  8. | Inset
  9. | Outset
  10. | Auto
  11. | Inherit

CSS outline style values.

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

CSS outline shorthand components.

type outline =
  1. | Inherit
  2. | Initial
  3. | None
  4. | Shorthand of outline_shorthand

CSS outline property values.

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.
val border : ?width:border_width -> ?style:border_style -> ?color:color -> unit -> declaration

border border is the border shorthand property.

val border_width : border_width -> declaration

border_width width is the border-width property.

val border_style : border_style -> declaration

border_style style is the border-style property.

val border_color : color -> declaration

border_color color is the border-color property.

val border_radius : length -> declaration

border_radius radius is the border-radius property.

val border_top_left_radius : length -> declaration

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

val border_top_right_radius : length -> declaration

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

val border_bottom_left_radius : length -> declaration

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

val border_bottom_right_radius : length -> declaration

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

val border_top : string -> declaration

border_top border is the border-top property.

val border_right : string -> declaration

border_right border is the border-right property.

val border_bottom : string -> declaration

border_bottom border is the border-bottom property.

val border_left : string -> declaration

border_left border is the border-left property.

val outline : outline -> declaration

outline outline is the outline property.

val outline_width : length -> declaration

outline_width width is the outline-width property.

val outline_style : outline_style -> declaration

outline_style style is the outline-style property.

val outline_color : color -> declaration

outline_color color is the outline-color property.

val outline_offset : length -> declaration

outline_offset offset is the outline-offset property.

val border_top_style : border_style -> declaration

border_top_style s is the border-top-style property.

val border_right_style : border_style -> declaration

border_right_style s is the border-right-style property.

val border_bottom_style : border_style -> declaration

border_bottom_style s is the border-bottom-style property.

val border_left_style : border_style -> declaration

border_left_style s is the border-left-style property.

val border_left_width : border_width -> declaration

border_left_width len is the border-left-width property.

val border_top_width : border_width -> declaration

border_top_width len is the border-top-width property.

val border_right_width : border_width -> declaration

border_right_width len is the border-right-width property.

val border_bottom_width : border_width -> declaration

border_bottom_width len is the border-bottom-width property.

val border_top_color : color -> declaration

border_top_color c is the border-top-color property.

val border_right_color : color -> declaration

border_right_color c is the border-right-color property.

val border_bottom_color : color -> declaration

border_bottom_color c is the border-bottom-color property.

val border_left_color : color -> declaration

border_left_color c is the border-left-color property.

type border_collapse =
  1. | Collapse
  2. | Separate
  3. | Inherit

CSS border-collapse values

val 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 =
  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. | Scale of float * float option
  12. | Scale_x of float
  13. | Scale_y of float
  14. | Scale_z of float
  15. | Scale_3d of float * float * float
  16. | Skew of angle * angle option
  17. | Skew_x of angle
  18. | Skew_y of angle
  19. | Matrix of float * float * float * float * float * float
  20. | Matrix_3d of float * float * float * float * float * float * float * float * float * float * float * float * float * float * float * float
  21. | Perspective of length
  22. | None
  23. | Inherit
  24. | Var of transform var
  25. | List of transform list

CSS transform values

val transform : transform -> declaration

transform t is the transform property with a single transformation.

val transforms : transform list -> declaration

transforms ts is the transform property with multiple transformations.

type transform_origin =
  1. | Center
  2. | Left
  3. | Right
  4. | Top
  5. | Bottom
  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. | X of length
    (*

    Single x-offset, y defaults to 50%.

    *)
  19. | XY of length * length
  20. | XYZ of length * length * length
  21. | Inherit
    (*

    Transform origin (2D or 3D).

    *)
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.

val transform_origin : transform_origin -> declaration

transform_origin origin is the transform-origin property.

val rotate : angle -> declaration

rotate angle is the rotate property.

val perspective : length -> declaration

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

type perspective_origin =
  1. | Perspective_center
  2. | Perspective_top
  3. | Perspective_bottom
  4. | Perspective_left
  5. | Perspective_right
  6. | Perspective_top_left
  7. | Perspective_top_right
  8. | Perspective_bottom_left
  9. | Perspective_bottom_right
  10. | Perspective_xy of length * length
    (*

    Custom x, y coordinates

    *)

CSS perspective-origin values for 3D transforms.

val perspective_origin : perspective_origin -> declaration

perspective_origin origin is the perspective-origin property.

type transform_style =
  1. | Flat
  2. | Preserve_3d
  3. | Inherit

CSS transform-style values

val transform_style : transform_style -> declaration

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

type steps_direction =
  1. | Jump_start
  2. | Jump_end
  3. | Jump_none
  4. | Jump_both
  5. | Start
  6. | End

CSS steps direction values.

type 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. | Var of timing_function var

CSS animation timing function values.

type duration =
  1. | Ms of float
    (*

    milliseconds

    *)
  2. | S of float
    (*

    seconds

    *)
  3. | Var of duration var
    (*

    CSS variable reference

    *)

CSS duration values.

type transition_property_value =
  1. | All
  2. | None
  3. | Property of string

CSS transition property value.

type transition_property = transition_property_value list

CSS transition property (list of property values).

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

CSS transition shorthand values.

type transition =
  1. | Inherit
  2. | Initial
  3. | None
  4. | Var of transition var
  5. | Shorthand of transition_shorthand
    (*

    CSS transition values.

    *)
val transition_shorthand : ?property:transition_property_value -> ?duration:duration -> ?timing_function:timing_function -> ?delay:duration -> unit -> transition

transition_shorthand ?property ?duration ?timing_function ?delay () 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.
val transition : transition -> declaration

transition transition is the transition property.

val transitions : transition list -> declaration

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

val transition_timing_function : timing_function -> declaration

transition_timing_function tf is the transition-timing-function property.

val transition_duration : duration -> declaration

transition_duration dur is the transition-duration property.

val transition_delay : duration -> declaration

transition_delay delay is the transition-delay property.

val transition_property : transition_property -> declaration

transition_property v is the transition-property property.

val transition_behavior : Properties.transition_behavior -> declaration

transition_behavior v is the transition-behavior property.

type animation_fill_mode =
  1. | None
  2. | Forwards
  3. | Backwards
  4. | Both

CSS animation fill mode values

type animation_direction =
  1. | Normal
  2. | Reverse
  3. | Alternate
  4. | Alternate_reverse

CSS animation direction values

type animation_play_state =
  1. | Running
  2. | Paused

CSS animation play state values

type animation_iteration_count =
  1. | Num of float
  2. | Infinite

CSS animation iteration count values

type animation_shorthand = {
  1. name : string 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;
}

CSS animation shorthand values

type animation =
  1. | Inherit
  2. | Initial
  3. | None
  4. | Var of animation var
  5. | Shorthand of animation_shorthand
    (*

    CSS animation values

    *)
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 -> unit -> animation

animation_shorthand ?name ?duration ?timing_function ?delay ?iteration_count ?direction ?fill_mode ?play_state () 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.
val animation : animation -> declaration

animation props is the animation shorthand property.

val animation_name : string -> declaration

animation_name name is the animation-name property.

val animation_duration : duration -> declaration

animation_duration dur is the animation-duration property.

val animation_timing_function : timing_function -> declaration

animation_timing_function tf is the animation-timing-function property.

val animation_delay : duration -> declaration

animation_delay delay is the animation-delay property.

val animation_iteration_count : animation_iteration_count -> declaration

animation_iteration_count count is the animation-iteration-count property.

val animation_direction : animation_direction -> declaration

animation_direction dir is the animation-direction property.

val animation_fill_mode : animation_fill_mode -> declaration

animation_fill_mode mode is the animation-fill-mode property.

val 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.

val box_shadow : shadow -> declaration

box_shadow shadow is the box-shadow property.

val box_shadows : shadow list -> declaration

box_shadows values is the box-shadow property.

type number =
  1. | Num of float
    (*

    Number value

    *)
  2. | Var of number var
    (*

    CSS variable reference

    *)

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

CSS scale property values

val scale : scale -> declaration

scale scale is the scale property.

type translate_value =
  1. | X of length
  2. | XY of length * length
  3. | XYZ of length * length * length
  4. | None
  5. | Var of translate_value var
val translate : translate_value -> declaration

translate v is the translate property.

type filter =
  1. | None
    (*

    No filter

    *)
  2. | Blur of length
    (*

    blur(px)

    *)
  3. | Brightness of number
    (*

    brightness(%)

    *)
  4. | Contrast of number
    (*

    contrast(%)

    *)
  5. | Drop_shadow of shadow
    (*

    drop-shadow(...)

    *)
  6. | Grayscale of number
    (*

    grayscale(%)

    *)
  7. | Hue_rotate of angle
    (*

    hue-rotate(deg)

    *)
  8. | Invert of number
    (*

    invert(%)

    *)
  9. | Opacity of number
    (*

    opacity(%)

    *)
  10. | Saturate of number
    (*

    saturate(%)

    *)
  11. | Sepia of number
    (*

    sepia(%)

    *)
  12. | Url of string
    (*

    url(...)

    *)
  13. | List of filter list
    (*

    Multiple filters

    *)
  14. | Var of filter var
    (*

    Custom filter variable

    *)

CSS filter values

val filter : filter -> declaration

filter values is the filter property.

val backdrop_filter : filter -> declaration

backdrop_filter values is the backdrop-filter property.

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

    top, right, bottom, left

    *)

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

type clip_path =
  1. | Clip_path_none
  2. | Clip_path_url of string
  3. | Clip_path_inset of length * length option * length option * length option
    (*

    inset(top, right?, bottom?, left?) - supports 1-4 values

    *)
  4. | Clip_path_circle of length
    (*

    Circle with radius

    *)
  5. | Clip_path_ellipse of length * length
    (*

    Ellipse with rx, ry

    *)
  6. | Clip_path_polygon of (length * length) list
  7. | Clip_path_path of string
    (*

    SVG path data

    *)

CSS clip-path property values for clipping regions.

val clip : clip -> declaration

clip clip is the clip property (deprecated).

val clip_path : clip_path -> declaration

clip_path path is the clip-path property.

val mask : string -> declaration

mask mask is the mask property.

val mix_blend_mode : blend_mode -> declaration

mix_blend_mode mode is the mix-blend-mode property.

val 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 =
  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

CSS cursor values.

type user_select =
  1. | None
  2. | Auto
  3. | Text
  4. | All
  5. | Contain

CSS user-select values.

type resize =
  1. | None
  2. | Both
  3. | Horizontal
  4. | Vertical
  5. | Block
  6. | Inline
  7. | Inherit

CSS resize values.

type print_color_adjust =
  1. | Economy
  2. | Exact
  3. | Initial
  4. | Inherit
  5. | Unset

CSS print-color-adjust values.

val cursor : cursor -> declaration

cursor cursor is the cursor property.

type 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

CSS pointer-events values

val pointer_events : pointer_events -> declaration

pointer_events events is the pointer-events property.

val user_select : user_select -> declaration

user_select select is the user-select property.

val webkit_user_select : user_select -> declaration

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

val resize : resize -> declaration

resize resize is the resize property.

val print_color_adjust : print_color_adjust -> declaration

print_color_adjust v is the print-color-adjust property.

val background_origin : background_box -> declaration

background_origin v is the background-origin property.

val background_clip : background_box -> declaration

background_clip v is the background-clip property.

Container Queries & Containment

CSS container queries and containment features for component-based responsive design and performance optimization through layout isolation.

aspect_ratio ratio is the aspect-ratio property.

type container_type =
  1. | Size
  2. | Inline_size
  3. | Scroll_state
  4. | Normal

CSS container-type values

val container_type : container_type -> declaration

container_type type_ is the container-type property for container queries.

val container_name : string -> declaration

container_name name is the container-name property.

type contain =
  1. | None
  2. | Strict
  3. | Content
  4. | Size
  5. | Layout
  6. | Style
  7. | Paint
  8. | List of contain list

CSS contain values

val 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.

type webkit_box_orient =
  1. | Horizontal
  2. | Vertical
  3. | Inherit

CSS webkit-box-orient values.

type webkit_line_clamp =
  1. | Lines of int
  2. | Unset

CSS -webkit-line-clamp values.

type 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. | Listbox
    (*

    List box appearance

    *)
  7. | Checkbox
    (*

    Checkbox appearance

    *)
  8. | Radio
    (*

    Radio button appearance

    *)
  9. | Push_button
    (*

    Push button appearance

    *)
  10. | Square_button
    (*

    Square button appearance

    *)
  11. | Inherit
    (*

    Inherit from parent

    *)

CSS -webkit-appearance values.

type webkit_font_smoothing =
  1. | Auto
  2. | None
  3. | Antialiased
  4. | Subpixel_antialiased
  5. | Inherit

CSS -webkit-font-smoothing values.

type moz_osx_font_smoothing =
  1. | Auto
  2. | Grayscale
  3. | Inherit

CSS -moz-osx-font-smoothing values.

val webkit_appearance : webkit_appearance -> declaration

webkit_appearance app is the -webkit-appearance property.

val webkit_font_smoothing : webkit_font_smoothing -> declaration

webkit_font_smoothing smoothing is the -webkit-font-smoothing property.

val moz_osx_font_smoothing : moz_osx_font_smoothing -> declaration

moz_osx_font_smoothing smoothing is the -moz-osx-font-smoothing property.

val webkit_tap_highlight_color : color -> declaration

webkit_tap_highlight_color color is the -webkit-tap-highlight-color property.

val webkit_text_decoration : text_decoration -> declaration

webkit_text_decoration decoration is the WebKit-only -webkit-text-decoration property.

val webkit_text_decoration_color : color -> declaration

webkit_text_decoration_color color is the WebKit-only -webkit-text-decoration-color property.

val webkit_line_clamp : webkit_line_clamp -> declaration

webkit_line_clamp clamp is the WebKit-only -webkit-line-clamp property.

val webkit_box_orient : webkit_box_orient -> declaration

webkit_box_orient orient is the WebKit-only -webkit-box-orient property.

val webkit_hyphens : hyphens -> declaration

webkit_hyphens hyphens is the WebKit-only -webkit-hyphens property.

val 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 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

CSS list-style-type values

type list_style_image =
  1. | None
  2. | Url of string
  3. | Inherit

CSS list-style-image values

val list_style_type : list_style_type -> declaration

list_style_type lst is the list-style-type property.

val list_style_image : list_style_image -> declaration

list_style_image img is the list-style-image property.

type table_layout =
  1. | Auto
  2. | Fixed
  3. | Inherit
type vertical_align =
  1. | Baseline
  2. | Top
  3. | Middle
  4. | Bottom
  5. | Text_top
  6. | Text_bottom
  7. | Sub
  8. | Super
  9. | Px of float
  10. | Rem of float
  11. | Em of float
  12. | Pct of float
  13. | Inherit
val table_layout : table_layout -> declaration

table_layout value is the table-layout property.

val vertical_align : vertical_align -> declaration

vertical_align value is the vertical-align property.

val list_style : string -> declaration

list_style value is the list-style shorthand property.

val border_spacing : length -> declaration

border_spacing value is the border-spacing property.

SVG Properties

Properties specific to SVG rendering and styling.

type svg_paint =
  1. | None
    (*

    No paint

    *)
  2. | Current_color
    (*

    Current color value

    *)
  3. | Color of color
    (*

    Specific color value

    *)
  4. | Url of string * svg_paint option
    (*

    url(#id) with optional fallback

    *)

SVG paint values for fill and stroke properties

val fill : svg_paint -> declaration

fill paint is the SVG fill property.

val stroke : svg_paint -> declaration

stroke paint is the SVG stroke property.

val stroke_width : length -> declaration

stroke_width width is the SVG stroke-width property.

Scroll & Touch

Properties for scroll behavior and touch interaction.

type touch_action =
  1. | Auto
  2. | None
  3. | Pan_x
  4. | Pan_y
  5. | Manipulation
  6. | Inherit

CSS touch-action values

type scroll_snap_strictness =
  1. | Mandatory
  2. | Proximity
  3. | Var of scroll_snap_strictness var

CSS scroll-snap-strictness values

type 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 =
  1. | Axis of scroll_snap_axis
  2. | Axis_with_strictness of scroll_snap_axis * scroll_snap_strictness
  3. | Inherit
  4. | Var of scroll_snap_type var

CSS scroll-snap-type values

type scroll_snap_align =
  1. | None
  2. | Start
  3. | End
  4. | Center

CSS scroll-snap-align values

val touch_action : touch_action -> declaration

touch_action action is the touch-action property.

val scroll_snap_type : scroll_snap_type -> declaration

scroll_snap_type type_ is the scroll-snap-type property.

val scroll_snap_align : scroll_snap_align -> declaration

scroll_snap_align align is the scroll-snap-align property.

type scroll_snap_stop =
  1. | Normal
  2. | Always
  3. | Inherit

CSS scroll-snap-stop values

val scroll_snap_stop : scroll_snap_stop -> declaration

scroll_snap_stop stop is the scroll-snap-stop property.

type scroll_behavior =
  1. | Auto
  2. | Smooth
  3. | Inherit

CSS scroll behavior values

val scroll_behavior : scroll_behavior -> declaration

scroll_behavior behavior is the scroll-behavior property for smooth scrolling.

val scroll_margin : length -> declaration

scroll_margin margin is the scroll-margin property.

val scroll_margin_top : length -> declaration

scroll_margin_top margin is the scroll-margin-top property.

val scroll_margin_right : length -> declaration

scroll_margin_right margin is the scroll-margin-right property.

val scroll_margin_bottom : length -> declaration

scroll_margin_bottom margin is the scroll-margin-bottom property.

val scroll_margin_left : length -> declaration

scroll_margin_left margin is the scroll-margin-left property.

val scroll_padding : length -> declaration

scroll_padding padding is the scroll-padding property.

val scroll_padding_top : length -> declaration

scroll_padding_top padding is the scroll-padding-top property.

val scroll_padding_right : length -> declaration

scroll_padding_right padding is the scroll-padding-right property.

val scroll_padding_bottom : length -> declaration

scroll_padding_bottom padding is the scroll-padding-bottom property.

val scroll_padding_left : length -> declaration

scroll_padding_left padding is the scroll-padding-left property.

type overscroll_behavior =
  1. | Auto
  2. | Contain
  3. | None
  4. | Inherit

CSS overscroll behavior values

val overscroll_behavior : overscroll_behavior -> declaration

overscroll_behavior behavior is the overscroll-behavior property.

val overscroll_behavior_x : overscroll_behavior -> declaration

overscroll_behavior_x behavior is the overscroll-behavior-x property.

val overscroll_behavior_y : overscroll_behavior -> declaration

overscroll_behavior_y behavior is the overscroll-behavior-y property.

val accent_color : color -> declaration

accent_color color is the accent-color property for form controls.

val 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.

val forced_color_adjust : forced_color_adjust -> declaration

forced_color_adjust adjust is the forced-color-adjust property.

type appearance =
  1. | None
  2. | Auto
  3. | Button
  4. | Textfield
  5. | Menulist
  6. | Inherit
val appearance : appearance -> declaration

appearance app is the appearance property.

val tab_size : int -> declaration

tab_size size is the tab-size property.

val 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 _ kind =
  1. | Length : length kind
  2. | Color : color kind
  3. | Rgb : rgb kind
  4. | Int : int kind
  5. | Float : float kind
  6. | Percentage : percentage kind
  7. | Number_percentage : number_percentage kind
  8. | String : string kind
  9. | Duration : duration kind
  10. | Aspect_ratio : aspect_ratio kind
  11. | Border_style : border_style kind
  12. | Outline_style : outline_style kind
  13. | Border : border kind
  14. | Font_weight : font_weight kind
  15. | Line_height : line_height kind
  16. | Font_family : font_family kind
  17. | Font_feature_settings : font_feature_settings kind
  18. | Font_variation_settings : font_variation_settings kind
  19. | Font_variant_numeric : font_variant_numeric kind
  20. | Font_variant_numeric_token : font_variant_numeric_token kind
  21. | Blend_mode : blend_mode kind
  22. | Scroll_snap_strictness : scroll_snap_strictness kind
  23. | Angle : angle kind
  24. | Shadow : shadow kind
  25. | Box_shadow : shadow kind
  26. | Content : content kind
  27. | Gradient_stop : gradient_stop kind
  28. | Gradient_direction : gradient_direction kind
  29. | Animation : animation kind
  30. | Timing_function : timing_function kind
  31. | Transform : transform kind

Value kind GADT for typed custom properties

type meta

The type for CSS variable metadata.

val var_meta : 'a var -> meta option

var_meta v is the optional metadata associated with v.

val meta : unit -> ('a -> meta) * (meta -> 'a option)

meta () is an injection/projection pair for metadata. The injection function converts a value to metadata, the projection function attempts to extract the value back.

val var_ref : ?fallback:'a fallback -> ?default:'a -> ?layer:string -> ?meta:meta -> string -> 'a var

var_ref ?fallback ?default ?layer ?meta 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 =
  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. | Custom_ident : string syntax
  10. | String : string syntax
  11. | Url : string syntax
  12. | Image : string syntax
  13. | Transform_function : string syntax
  14. | Universal : string syntax
  15. | Or : 'a syntax * 'b syntax -> ('a, 'b) Either.t syntax
  16. | Plus : 'a syntax -> 'a list syntax
  17. | Hash : 'a syntax -> 'a list syntax
  18. | Question : 'a syntax -> 'a option syntax
  19. | Brackets : string -> string syntax
    (*

    Type-safe syntax descriptors for CSS @property rules.

    *)
val 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.

val var : ?default:'a -> ?fallback:'a fallback -> ?layer:string -> ?meta:meta -> string -> 'a kind -> 'a -> declaration * 'a var

var ?default ?fallback ?layer name kind value returns a declaration and a variable handle.

  • 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:

  let def_radius, radius_var = var "radius-md" Length (Rem 0.5) in
  rule ~selector:".card" [ def_radius; border_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.

val meta_of_declaration : declaration -> meta option

meta_of_declaration decl extracts metadata from a declaration if it has any.

val 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 (must start with --)

  • parameter value

    CSS value as string

Example: custom_property "--primary-color" "#3b82f6"

See also var (type-safe CSS variable API).

val custom_declaration_name : declaration -> string option

custom_declaration_name decl is the variable name if decl is a custom property declaration, None otherwise.

val 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.

Rendering & Optimization

CSS output generation and performance optimization tools.

Rendering

Functions for converting CSS structures to string output.

type 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)
    *)
val to_string : ?minify:bool -> ?optimize:bool -> ?mode:mode -> ?newline:bool -> t -> string

to_string ?minify ?optimize ?mode ?newline stylesheet renders a complete stylesheet to CSS.

  • If minify is true, the output will be compact (no unnecessary whitespace).
  • If optimize is true, rule-level optimizations are applied (deduplication, merging consecutive rules, combining identical rules).
  • mode controls variable layer emission behavior.
  • If newline is true (default), adds a trailing newline for POSIX compliance.
val pp : ?minify:bool -> ?optimize:bool -> ?mode:mode -> ?newline:bool -> t -> string

pp is to_string.

type parse_error = Reader.parse_error
val pp_parse_error : parse_error -> string

pp_parse_error error formats a parse error as a string, including call stack if available.

val of_string : ?filename:string -> string -> (t, parse_error) result

of_string ?filename css parses a CSS string into a stylesheet. Returns Error error on invalid CSS. The optional filename parameter is used for error reporting (defaults to "<string>").

Optimization

Tools for optimizing CSS output for performance and file size.

val optimize : t -> t

optimize stylesheet applies CSS optimizations to the stylesheet, including merging consecutive identical selectors and combining rules with identical properties. Preserves CSS cascade semantics.

type will_change =
  1. | Will_change_auto
  2. | Scroll_position
  3. | Contents
  4. | Transform
  5. | Opacity
  6. | Properties of string list
    (*

    Custom CSS property names

    *)

CSS will-change property values for performance optimization hints.

val will_change : will_change -> declaration

will_change value is the will-change property for performance optimization.

val inline_style_of_declarations : ?optimize:bool -> ?minify:bool -> ?mode:mode -> ?newline:bool -> 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.

val 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.

val pp_color : color Pp.t

pp_color is the pretty printer for color values.

val pp_angle : angle Pp.t

pp_angle is the pretty printer for angle values.

val 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.

val pp_calc : 'a Pp.t -> 'a calc Pp.t

pp_calc pp_value is the pretty printer for calc expressions.

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_overflow : overflow Pp.t

pp_overflow is the pretty printer for overflow values.

val pp_border_style : border_style Pp.t

pp_border_style is the pretty printer for border-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_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.

module Pp : sig ... end

Printer