Cascade.CssSourceTyped CSS construction.
This library provides types and functions to construct CSS declarations, rules and stylesheets. It avoids stringly-typed CSS by keeping close to the CSS syntax and specifications.
Cascade is scoped to CSS text and CSS ASTs: parsing, printing, minification, structural traversal, structural transforms, structural diffs, and safe optimizations. When a transform needs information beyond CSS text, that information is passed as an explicit closed context record. Theme/default based var() output is part of the current API; Context contains context records for value-oriented transforms.
The main notions are:
declaration is a property/value pair.t is a stylesheet, built with the facade helpers here or with the lower-level Stylesheet AST API when direct inspection is useful.length, color); invalid constructs raise Invalid_argument.Minimal example:
open Cascade.Css
(* Build a ".btn" rule and render a stylesheet from it. *)
let button =
rule ~selector:(Selector.class_ "btn")
[
display Inline_block;
background_color (hex "#3b82f6");
color (hex "#ffffff");
padding [ Rem 0.5 ];
border_radius (radius (Rem 0.375));
]
let css = to_string (v [ button ])Custom properties:
open Cascade.Css
let def, primary = var "primary-color" Color (hex "#3b82f6")
let root = rule ~selector:(Selector.of_string ":root") [ def ]
let card = rule ~selector:(Selector.class_ "card") [ color (Var primary) ]
let css = to_string (v [ root; card ])Start with rule, media, container, supports, v, and to_string. Property helpers are grouped by CSS feature below. Parser building blocks such as cursors, tokens and component values are available from the library root, for example Cascade.Cursor and Cascade.Parser, not through Css.
See https://www.w3.org/Style/CSS/specs.en.html W3C CSS Specifications and https://developer.mozilla.org/en-US/docs/Web/CSS MDN CSS Documentation.
Core CSS system setup and construction tools for building stylesheets.
The facade re-exports the CSS-facing modules users normally combine with the top-level helpers. These are aliases, so odoc links to the focused module page instead of duplicating each full signature here.
Parser building blocks live at the library root (Cascade.Cursor, Cascade.Parser, Cascade.Token, ...), not under Css.
Core building blocks for CSS rules and stylesheet construction.
See https://www.w3.org/TR/css-syntax-3/ CSS Syntax Module Level 3 and https://www.w3.org/TR/css-nesting-1/ CSS Nesting Module Level 1.
type declaration = Declaration.declarationThe type for CSS declarations (property-value pairs).
type statement = Stylesheet.statementThe type for CSS statements.
type cascade_origin = Stylesheet.cascade_origin = Cascade origins from CSS Cascading and Inheritance.
val rule :
selector:Selector.t ->
?nested:statement list ->
?merge_key:string ->
declaration list ->
statementrule ~selector ?nested ?merge_key declarations creates a CSS rule statement with the given selector and declarations. When merge_key is provided, the optimizer can combine this rule with other rules sharing the same key and identical declarations.
statement_selector stmt returns Some selector if the statement is a rule, None otherwise.
as_rule stmt returns Some (selector, declarations, nested) if the statement is a rule, None otherwise. The declarations are the run written before the first nested statement; a run written after one is a nested declarations rule inside nested, at the position it was written.
as_layer stmt returns Some (name, statements) if the statement is a layer, None otherwise.
as_media stmt returns Some (condition, statements) if the statement is a media query, None otherwise.
as_container stmt returns Some (name, condition, statements) if the statement is a container query, None otherwise.
as_supports stmt returns Some (condition, statements) if the statement is a supports query, None otherwise.
is_nested_media stmt returns true if the statement is a media query containing bare declarations (CSS nesting style), false otherwise.
is_nested_supports stmt returns true if the statement is a supports query containing bare declarations (CSS nesting style), false otherwise.
as_declarations stmt returns Some decls if the statement is a bare declarations block (used in CSS nesting), None otherwise.
val unknown_at_rule :
name:string ->
prelude:string ->
?block:string ->
unit ->
(statement, Error.t) resultunknown_at_rule ~name ~prelude ?block () is the at-rule \@name prelude with block as its body, or the reason its parts cannot make one. It is the way to emit an at-rule cascade has no grammar for, such as one a tool of the caller's own defines. Omitting block gives the statement form, \@name prelude;.
name is the at-keyword without its @. block is the text between the at-rule's braces, since an unknown at-rule has no grammar to re-serialise a body from; to_string ~minify:true statements is that text for a block cascade does model, so placing one needs no re-read of a printed sheet.
A part that would not read back as that part is refused rather than printed, and the refusal names one at-rule rather than the sheet it sits in: building each at-rule on its own loses the malformed one, where re-reading an assembled sheet loses every at-rule in it.
with_origin cascade_origin statements records the cascade origin for a stylesheet block. This is an API-level wrapper with no CSS syntax.
as_origin stmt returns Some (origin, statements) if the statement is an origin wrapper, None otherwise.
origin_importance_rank ~important origin returns the cascade precedence rank for the origin/importance criterion. Larger ranks have higher precedence.
val eval_declaration :
?layer_order:string list ->
?layer:string ->
Context.t ->
declaration ->
declarationeval_declaration ctx decl rewrites decl to a more-defined declaration under ctx, preserving unresolved subtrees as CSS syntax.
val eval_value :
?layer_order:string list ->
?layer:string ->
Context.t ->
'a Properties.property ->
'a ->
declarationeval_value ctx property value evaluates value in the CSS declaration context of property, returning the evaluated declaration.
val eval_rule :
?layer_order:string list ->
?layer:string ->
Context.t ->
Stylesheet.rule ->
Stylesheet.ruleeval_rule ctx rule evaluates every declaration in rule and its nested statements.
val eval_stylesheet :
?layer_order:string list ->
?layer:string ->
Context.t ->
Stylesheet.t ->
Stylesheet.teval_stylesheet ctx stylesheet evaluates every declaration in stylesheet.
import_layer_name rule returns the layer name declared by an @import rule: None means no layer, Some [] means an anonymous layer, and Some name is a named layer.
layer_block_name stmt returns the declared name of an @layer block rule. Anonymous layer blocks return Some [].
layer_statement_name_list stmt returns the declared name list for statement-form @layer rules.
val cascade_layer_precedence_rank :
layer_order:string list ->
important:bool ->
string option ->
intcascade_layer_precedence_rank returns the same-origin layer precedence rank for a layer. Larger ranks have higher precedence.
val compare_cascade_layer_candidate :
layer_order:string list ->
Stylesheet.cascade_layer_candidate ->
Stylesheet.cascade_layer_candidate ->
intcompare_cascade_layer_candidate compares same-origin/same-specificity candidates by importance, layer precedence, then source order.
val winning_cascade_layer_candidate :
layer_order:string list ->
Stylesheet.cascade_layer_candidate list ->
Stylesheet.cascade_layer_candidate optionwinning_cascade_layer_candidate returns the winning candidate using compare_cascade_layer_candidate.
val cascade_revert_layer_candidates :
layer_order:string list ->
important:bool ->
current_layer:string option ->
Stylesheet.cascade_layer_candidate list ->
Stylesheet.cascade_layer_candidate listcascade_revert_layer_candidates returns same-importance candidates in lower-priority layers than the current revert-layer declaration.
val compare_cascade_origin_candidate :
Stylesheet.cascade_origin_candidate ->
Stylesheet.cascade_origin_candidate ->
intcompare_cascade_origin_candidate compares same-specificity candidates by origin/importance precedence, then source order.
val winning_cascade_origin_candidate :
Stylesheet.cascade_origin_candidate list ->
Stylesheet.cascade_origin_candidate optionwinning_cascade_origin_candidate returns the winning candidate using compare_cascade_origin_candidate.
val cascade_revert_origin_candidates :
important:bool ->
current_origin:cascade_origin ->
Stylesheet.cascade_origin_candidate list ->
Stylesheet.cascade_origin_candidate listcascade_revert_origin_candidates returns same-importance candidates in the origins exposed by a revert declaration from current_origin.
declared_values ?property declarations returns declared values in source order, optionally filtered to one property.
cascaded_value candidates returns the winning cascaded value payload, or None when no candidate contributes a value.
val compare_cascade_candidate :
layer_order:string list ->
Stylesheet.cascade_candidate ->
Stylesheet.cascade_candidate ->
intcompare_cascade_candidate ~layer_order a b compares full same-property cascade candidates by origin/importance, layer, specificity, scoping proximity, and source order.
val winning_cascade_candidate :
layer_order:string list ->
Stylesheet.cascade_candidate list ->
Stylesheet.cascade_candidate optionwinning_cascade_candidate ~layer_order candidates returns the highest priority full cascade candidate.
val value :
inherits:bool ->
initial:string ->
inherited:string option ->
cascaded:string option ->
Stylesheet.valuevalue ~inherits ~initial ~inherited ~cascaded models the defaulting step from cascaded value to specified value for the non-layout cases represented by this library.
val specified_value_after_revert :
inherits:bool ->
initial:string ->
inherited:string option ->
Stylesheet.cascade_origin_candidate list ->
Stylesheet.valuespecified_value_after_revert chains revert rollbacks through the origin stack until a non-revert winner remains, then defaults.
val specified_value_after_revert_layer :
inherits:bool ->
initial:string ->
inherited:string option ->
layer_order:string list ->
Stylesheet.cascade_layer_candidate list ->
Stylesheet.valuespecified_value_after_revert_layer is the revert-layer analogue, chained through the layer stack.
value_processing_requires_document_context stage reports whether stage needs caller-supplied document, layout, rendering, or device context rather than CSS text alone.
map f stmts applies f to every rule in stmts: the ones at the top level, the ones inside a conditional group at-rule such as @media, @supports, @layer, @container, @scope or @starting-style, however deeply nested, and the ones nested inside a rule.
f returns a rule holding no nested statements, the original nested tree is kept with map applied to it; one holding its own replaces it.val sort :
((Selector.t * declaration list) -> (Selector.t * declaration list) -> int) ->
statement list ->
statement listsort cmp stmts reorders the rules of stmts with cmp, and the rules of every block below them: inside a conditional group at-rule such as @media, @supports, @layer, @container, @scope or @starting-style, however deeply nested, and inside the nested statements of a rule.
cmp calls equal maintain their relative order.@else still follows the @when it answers.type property_info = | Property_info : {name : string;syntax : 'a Variables.syntax;inherits : bool;initial_value : 'a option;} -> property_infoExistential type for property information that preserves type safety
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.keyframeType for keyframe selectors and their declarations
keyframe ~selector ~declarations is a single keyframe whose selector is parsed via Keyframe.selector_of_string (e.g. "from", "to", "50%", "50%, 100%"). Raises Invalid_argument if selector is not a valid keyframe selector.
keyframes name frames creates a @keyframes rule.
Example:
open Cascade.Css
let pulse =
keyframes "pulse"
[
keyframe ~selector:"50%"
~declarations:[ opacity (Opacity_number 0.5) ];
]produces @keyframes pulse { 50% { opacity: 0.5 } }.
as_keyframes stmt returns Some (name, frames) if the statement is a @keyframes animation, None otherwise.
as_font_face stmt returns Some descriptors if the statement is a @font-face rule, None otherwise.
as_import stmt returns Some import_rule if the statement is an @import rule, None otherwise.
At-rules are CSS statements that instruct CSS how to behave. They begin with an at sign (@) followed by an identifier and include everything up to the next semicolon or CSS block.
See https://www.w3.org/TR/css-conditional-5/ CSS Conditional Rules Module Level 5 and https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule MDN At-rules.
Tools for building complete CSS stylesheets from rules and declarations.
See https://www.w3.org/TR/css-cascade-5/ CSS Cascading and Inheritance
Level 5, which gives the origins, the @layer ordering and the CSS-wide keywords the builders below write.
The type for CSS stylesheets.
rule_statements t returns the top-level rule statements from the stylesheet.
statements t returns all top-level statements from the stylesheet.
equal_statement a b is Stylesheet.equal_statement: whether a and b are the same statement, each part read through the equality its own module states.
hash_statement stmt is Stylesheet.hash_statement: a fingerprint consistent with equal_statement, for keying a statement in a hash table without rendering it to CSS text.
fold f acc css folds f over every statement in css and over every statement reachable from one, in source order: a rule nested in a rule, a block at-rule inside a group, and whatever those hold in turn. The walk descends through Stylesheet.statement_children, so it reaches every statement the AST can hold rather than a listed set of at-rules.
Example: Collect all selectors from all rules (including nested ones):
open Cascade
let selectors css =
Css.fold
(fun acc stmt ->
match Css.as_rule stmt with
| Some (sel, _, _) -> Css.Selector.to_string sel :: acc
| None -> acc)
[] cssmedia_queries t is every @media in t, at any depth, paired with the rule statements below its brace. A query inside a group at-rule counts, and a rule nested in another rule or held by an inner group is one of the query's rules; a nested rule keeps the relative selector it was written with.
layers t is every cascade layer t declares, one path per layer (a.b is the sublayer b of a, however it was written), in the order the sheet first names them. Each path is its idents, so a . one ident carries is not the separator between two. A layer named inside a conditional group counts: the group decides whether its contents apply, not whether the layer exists. A sublayer of an anonymous @layer { ... } has no name to report.
This is what a sheet declares, not the order a cascade resolves in. Resolve.layer_order answers that, and leaves out a layer named inside any block the resolver does not enter: a conditional group rule, @starting-style, @scope or an origin wrapper.
layer_block name sheet is the statements of the layer name, wherever it is declared and whatever form declares it: a dotted name, a nested block, or a block inside a conditional group. It is None when no @layer block opens that layer, so a name only an @layer a, b; statement declares is None as well.
rules_of_statements stmts extracts all CSS rules (selector + declarations) from a list of statements, filtering out at-rules and other non-rule statements.
custom_prop_names decls extracts all custom property names from a list of declarations.
theme_guarded ~var_name decl wraps decl so it is only emitted when var_name is present in the theme.
as_theme_guarded decl returns Some (var_name, inner_decl) if decl is a theme-guarded declaration, None otherwise.
custom_props_of_rules rules extracts all custom property names from the declarations in the rules.
custom_props ?layer sheet is the name of every custom property sheet declares for an element: the ones in a style rule or a bare nesting block, at the top level and inside a conditional group at-rule such as @media, @supports, @container, @scope or @starting-style, however deeply nested. A name declared in @keyframes, @page, @position-try or @supports-condition belongs to another cascade origin or to no element at all (CSS Cascading 5 sec. 6.1) and is not among them. When layer is given, the names are those declared inside the @layer of that name.
media ~condition statements creates a @media statement with the given condition.
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.
declarations decls creates a bare declarations block (used in CSS nesting).
layer ?name statements creates a @layer statement with the given statements.
layer_decl names creates a @layer declaration statement that declares layer names without any content (e.g., @layer theme, base, components, utilities;).
layer_of ?name stylesheet wraps an entire stylesheet in @layer, preserving @supports and other at-rules within it.
container ?name ~condition statements creates a @container statement with the given statements.
supports ~condition statements creates a @supports statement with the given condition.
starting_style statements creates a @starting-style statement with the given statements. Used for CSS entry animations.
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.
Core value types and declaration building blocks.
See https://www.w3.org/TR/css-variables-1/ CSS Custom Properties for
Cascading Variables Module Level 1 for var() and https://www.w3.org/TR/css-properties-values-api-1/ CSS Properties and
Values API Level 1 for the @property registration.
type 'a var = 'a Values.varThe type of CSS variable holding values of type 'a.
CSS env() reference.
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.
The type of CSS variables.
vars_of_rules statements is vars_of_stylesheet of statements: a statement list is a stylesheet, and the two answer the same question.
vars_of_declarations decls extracts all CSS variables referenced in the declarations list.
vars_of_stylesheet stylesheet is every variable stylesheet references, from the declarations of every statement it holds: a rule nested in a rule, a rule inside any grouping at-rule, and an at-rule carrying declarations of its own such as @keyframes or @page. Deduplicated, in source order.
any_var_name v is the name of a CSS variable (with -- prefix).
custom_declarations ?layer decls is only the custom property declarations from decls. If layer is provided, only declarations from that layer are returned.
all v is the all shorthand. It resets every longhand to v but the two writing-mode ones CSS Cascading 5 sec. 3.3 excepts.
Fundamental types for CSS values, variables, and calculations that underpin the entire CSS system.
See https://www.w3.org/TR/css-variables-1/ CSS Custom Properties for Cascading Variables Module Level 1 and https://www.w3.org/TR/css-values-4/ CSS Values and Units Module Level 4.
CSS calc operations.
CSS Values 4 sec. 10.7 math constants - emitted at the source byte sequence so pretty pp preserves calc(2 * pi) instead of writing calc(6.28318530718).
type math_arg = Values.math_arg = CSS Values 4 (ED) sec. 9.1 numeric math function arguments.
and math_fn = Values.math_fn = | Sin of angle_arg| Cos of angle_arg| Tan of angle_arg| Asin of math_arg| Acos of math_arg| Atan of math_arg| Atan2 of math_arg * math_arg| Sqrt of math_arg| Exp of math_arg| Log of math_arg * math_arg option| Pow of math_arg * math_arg| Hypot of math_arg list| Sign_n of math_arg| Abs_n of math_arg| Round_n of string * math_arg * math_argSec. 10.9 round(<rounding-strategy>?, A, B).
| Mod_n of math_arg * math_arg| Rem_n of math_arg * math_argCSS Values 4 (ED) sec. 9.1 numeric math functions.
and angle_arg = Values.angle_arg = type 'a calc = 'a Values.calc = | Var of 'a varCSS variable
*)| Val of 'a| Num of floatUnitless number
*)| Math_const of math_constCSS Values 4 sec. 10.7 math constant (pi, e, infinity, -infinity, NaN) preserved verbatim through pretty pp.
| Sibling_indexCSS sibling-index() math function.
| Sibling_countCSS sibling-count() math function.
| Expr of 'a calc * calc_op * 'a calc| Nested of 'a calcExplicitly nested calc()
*)| Parens of 'a calcParenthesized expression
*)| Math_fn of math_fnCSS Values 4 (ED) sec. 9.1 numeric math function call.
*)CSS calc values.
type component_values = Component.t listParsed CSS component values preserved for fallback and invalid-value round-tripping. Prefer typed values in normal user code.
type invalid_value = component_valuesSpec-invalid value fragments preserved until optimization decides whether to drop the containing declaration.
type custom_value = component_valuesCSS custom-property token stream.
type 'a fallback = 'a Values.fallback = | EmptyEmpty fallback: var(--name,)
*)| Empty22-char empty fallback: var(--name, ) -- matches tailwindcss output, likely a bug in tailwindcss
*)| NoneNo fallback: var(--name)
*)| Fallback of 'aValue fallback: var(--name, value)
*)| Syntax_fallback of component_valuesSyntactic declaration-value fallback when it is not a typed value.
*)| Var_fallback of stringNested var fallback: var(--name, var(--fallback))
*)type 'a attr_fallback = 'a Values.attr_fallback = type 'a attr_call = 'a Values.attr_call = {name : string;type_ : attr_type option;fallback : 'a attr_fallback;}Core value types used across CSS properties.
See https://www.w3.org/TR/css-values-4/ CSS Values and Units Module Level 4.
type length = Values.length = | Px of float| Cm of float| Mm of float| Q of float| In of float| Pt of float| Pc of float| Rem of float| Em of float| Ex of float| Cap of float| Ic of float| Ric of float| Rlh of float| Pct of float| Vw of float| Vh of float| Vmin of float| Vmax of float| Vi of float| Vb of float| Dvh of float| Dvw of float| Dvmin of float| Dvmax of float| Lvh of float| Lvw of float| Lvmin of float| Lvmax of float| Svh of float| Svw of float| Svmin of float| Svmax of float| Cqw of floatContainer query width units
*)| Cqh of floatContainer query height units
*)| Cqi of floatContainer query inline-size units
*)| Cqb of floatContainer query block-size units
*)| Cqmin of floatSmaller container query dimension units
*)| Cqmax of floatLarger container query dimension units
*)| Ch of floatCharacter units
*)| Lh of floatLine height units
*)| Dimension of {}Dimension with authored numeric spelling preserved for pretty printing.
*)| Sizesize keyword inside calc-size().
| Auto| Nonenone keyword (e.g., for max-width)
*)| Normalnormal keyword (letter-spacing, word-spacing, line-height)
| Zero| Inherit| Initial| Unset| Revert| Revert_layer| Fit_contentfit-content keyword
*)| Fit_content_arg of lengthfit-content(<length-percentage>); the argument is stored via length because that type already has a Pct of float case for the percentage form.
| Contentcontent keyword
*)| Containcontain keyword (intrinsic sizing)
*)| Max_contentmax-content keyword
*)| Min_contentmin-content keyword
*)| Webkit_max_content-webkit-max-content (legacy intrinsic sizing)
*)| Webkit_min_content-webkit-min-content (legacy intrinsic sizing)
*)| Webkit_fit_content-webkit-fit-content (legacy intrinsic sizing)
*)| Moz_max_content-moz-max-content (legacy intrinsic sizing)
*)| Moz_min_content-moz-min-content (legacy intrinsic sizing)
*)| Moz_fit_content-moz-fit-content (legacy intrinsic sizing)
*)| From_fontfrom-font keyword for text-decoration-thickness
*)| Hairlinehairline line-width keyword for text-decoration-thickness
*)| Thinthin line-width keyword for text-decoration-thickness
*)| Mediummedium line-width keyword for text-decoration-thickness
*)| Thickthick line-width keyword for text-decoration-thickness
*)| Stretchstretch keyword (intrinsic sizing)
*)| Clamp of length * length * lengthCSS clamp(min, val, max).
| Min of length listCSS min(a, b, ...).
| Max of length listCSS max(a, b, ...).
| Minmax of length * lengthCSS minmax(min, max) (grid).
| Round of string * length * lengthCSS round() math function
| Mod of length * lengthCSS mod() math function
| Rem_fn of length * lengthCSS rem() math function
| Hypot of length listCSS hypot() math function
| Abs of lengthCSS abs() math function
| Calc_size of length * length calcCSS calc-size() function
| Anchor_size of string| Anchor of string option * string * length optionCSS anchor() function: optional anchor name, side, and fallback.
| Attr of length attr_callCSS attr() in typed value contexts (CSS Values 5 sec. 8.7).
| Env of length envCSS env() reference.
| Var of length varCSS variable reference
*)| Calc of length calcCalculated expressions
*)CSS length values.
Supports absolute, relative, viewport (including dynamic/large/small), character-based units, keywords, and calculated expressions.
type 'a property = 'a Properties.propertyGADT for typed CSS properties.
type color_space = Values.color_space = CSS color spaces for color-mix()
type color_name = Values.color_name = | Red| Blue| Green| White| Black| Yellow| Cyan| Magenta| Gray| Grey| Orange| Purple| Pink| Silver| Maroon| Fuchsia| Lime| Olive| Teal| Aqua| Alice_blue| Antique_white| Aquamarine| Azure| Beige| Bisque| Blanched_almond| Blue_violet| Brown| Burlywood| Cadet_blue| Chartreuse| Chocolate| Coral| Cornflower_blue| Cornsilk| Crimson| Dark_blue| Dark_cyan| Dark_goldenrod| Dark_gray| Dark_green| Dark_grey| Dark_khaki| Dark_magenta| Dark_olive_green| Dark_orange| Dark_orchid| Dark_red| Dark_salmon| Dark_sea_green| Dark_slate_blue| Dark_slate_gray| Dark_slate_grey| Dark_turquoise| Dark_violet| Deep_pink| Deep_sky_blue| Dim_gray| Dim_grey| Dodger_blue| Firebrick| Floral_white| Forest_green| Gainsboro| Ghost_white| Gold| Goldenrod| Green_yellow| Honeydew| Hot_pink| Indian_red| Indigo| Ivory| Khaki| Lavender| Lavender_blush| Lawn_green| Lemon_chiffon| Light_blue| Light_coral| Light_cyan| Light_goldenrod_yellow| Light_gray| Light_green| Light_grey| Light_pink| Light_salmon| Light_sea_green| Light_sky_blue| Light_slate_gray| Light_slate_grey| Light_steel_blue| Light_yellow| Lime_green| Linen| Medium_aquamarine| Medium_blue| Medium_orchid| Medium_purple| Medium_sea_green| Medium_slate_blue| Medium_spring_green| Medium_turquoise| Medium_violet_red| Midnight_blue| Mint_cream| Misty_rose| Moccasin| Old_lace| Olive_drab| Orange_red| Orchid| Pale_goldenrod| Pale_green| Pale_turquoise| Pale_violet_red| Papaya_whip| Peach_puff| Peru| Plum| Powder_blue| Rebecca_purple| Rosy_brown| Royal_blue| Saddle_brown| Salmon| Sandy_brown| Sea_green| Sea_shell| Sienna| Sky_blue| Slate_blue| Slate_gray| Slate_grey| Snow| Spring_green| Steel_blue| Tan| Thistle| Tomato| Turquoise| Violet| Wheat| White_smoke| Yellow_greenCSS named colors as defined in the CSS Color Module specification.
CSS channel values (for RGB)
type alpha = Values.alpha = CSS alpha values (for HSL/HWB/etc)
CSS hue values (for HSL/HWB)
type component = Values.component = CSS color component values
type percentage = Values.percentage = | Pct of float| Num of float| Var of percentage var| Calc of percentage calcCSS percentage values
type length_percentage = Values.length_percentage = | Length of length| Pct of float| Env of length_percentage env| Var of length_percentage var| Calc of length_percentage calc| Invalid of invalid_valueSpec-invalid input preserved verbatim.
*)CSS length or percentage values.
type number_percentage = Values.number_percentage = | Num of float| Pct of float| Var of number_percentage var| Calc of number_percentage calcCSS number or percentage values (for properties like scale, brightness)
type hue_interpolation = Values.hue_interpolation = CSS hue interpolation options
type system_color = Values.system_color = | Accent_colorBackground of accented user interface controls
*)| Accent_color_textText of accented user interface controls
*)| Active_textText of active links
*)| Button_borderBase border color of controls
*)| Button_faceBackground color of controls
*)| Button_textText color of controls
*)| CanvasBackground of application content or documents
*)| Canvas_textText color in application content or documents
*)| FieldBackground of input fields
*)| Field_textText in input fields
*)| Gray_textText color for disabled items
*)| HighlightBackground of selected items
*)| Highlight_textText color of selected items
*)| Link_textText of non-active, non-visited links
*)| MarkBackground of specially marked text
*)| Mark_textText that has been specially marked
*)| Selected_itemBackground of selected items (e.g., selected checkbox)
*)| Selected_item_textText of selected items
*)| Visited_textText of visited links
*)| Webkit_focus_ring_colorWebKit-specific focus ring color
*)CSS system colors - case-insensitive keywords that map to OS/browser colors. These are semantic colors that adapt to user preferences and system settings.
type color = Values.color = | Hex of {}Hex colour decoded to sRGB byte components (a = 255 when opaque).
| Authored_hex of {}Parsed hex colour preserving the source spelling without the leading #. Optimisation folds this to the canonical semantic colour.
| Rgb of rgb| Rgba of {}| Hsl of {h : hue;s : percentage;l : percentage;a : alpha;}| Hwb of {h : hue;w : percentage;b : percentage;a : alpha;}| Color of {space : color_space;components : component list;alpha : alpha;}| Relative_rgb of color * stringrgb(from <origin> <channels> [/ <alpha>]?) with a parsed origin and an opaque channel-expression tail.
| Relative_color of string * color * string<fn>(from <origin> <c1> <c2> <c3> [/ <alpha>]?) for relative color functions other than rgb().
| Contrast_color of color| Light_dark of color * color| Attribute of string * color option| Lab of {l : percentage option;a : float option;b : float option;alpha : alpha;}Lab color space. l, a and b can be None to represent CSS none.
| Oklch of {l : percentage option;c : float option;h : hue;alpha : alpha;}OKLCH color space. l and c can be None to represent CSS none.
| Oklab of {l : percentage option;a : float option;b : float option;alpha : alpha;}Oklab color space. l, a and b can be None to represent CSS 'none' keyword.
| Lch of {l : percentage option;c : float option;h : hue;alpha : alpha;}LCH color space. l and c can be None to represent CSS none.
| Named of color_nameNamed colors like Red, Blue, etc.
*)| System of system_colorCSS system colors like Button_text, Canvas, etc.
*)| Var of color var| Current| Transparent| Autoauto keyword, e.g. accent-color: auto, caret-color: auto.
| Inherit| Initial| Unset| Revert| Revert_layer| Mix of {in_space : color_space option;hue : hue_interpolation;color1 : color;percent1 : percentage option;color2 : color;percent2 : percentage option;}CSS color values.
hex s is a hexadecimal color. Accepts with or without leading #. Examples: hex "#3b82f6", hex "ffffff". Raises Invalid_argument when s is not one of #rgb, #rrggbb, #rgba or #rrggbbaa; see hex_opt to decide.
hex_opt s is hex without the exception: the colour when s is a hex spelling, and nothing otherwise.
rgb ?alpha r g b is an RGB color (0-255 components) with optional alpha.
hsl h s l is an HSL color with h in degrees, s and l in percentages (0-100).
hsla h s l a is an HSLA color with alpha in 0., 1..
hwb h w b is an HWB color with h in degrees, w and b in percentages (0-100).
hwba h w b a is an HWB color with alpha in 0., 1..
oklch l c h is an OKLCH color. L in percentage (0-100), h in degrees.
oklcha l c h a is an OKLCH color with alpha in 0., 1..
oklch_none_hue l c is an OKLCH color whose hue is none. The hue of an achromatic color is powerless, and none keeps the component missing, so interpolation takes the other color's hue rather than 0.
oklab l a b is an OKLAB color. L in percentage (0-100).
oklaba l a b alpha is an OKLAB color with alpha in 0., 1..
oklaba_none_zeros l a b alpha is like oklaba but uses none for zero a/b components.
lch l c h is an LCH color. L in percentage (0-100), h in degrees.
lcha l c h a is an LCH color with alpha in 0., 1..
color_name n is a named color as defined in the CSS Color specification.
current_color is the CSS currentcolor value.
transparent is the CSS transparent value.
val color_mix :
?in_space:color_space ->
?hue:hue_interpolation ->
?percent1:float ->
?percent2:float ->
color ->
color ->
colorcolor_mix ?in_space ?percent1 ?percent2 c1 c2 is a color-mix value. Defaults: in_space = Srgb, percent1 = None, percent2 = None.
val color_mix_var_percent :
?in_space:color_space ->
?hue:hue_interpolation ->
var_name:string ->
color ->
color ->
colorcolor_mix_var_percent ?in_space ?hue ~var_name c1 c2 is like color_mix but uses a CSS var reference for the first percentage.
val color_mix_var_pct_fallback :
?in_space:color_space ->
?hue:hue_interpolation ->
var_name:string ->
fallback:percentage fallback ->
color ->
color ->
colorcolor_mix_var_pct_fallback ?in_space ?hue ~var_name ~fallback c1 c2 is like color_mix_var_percent but with an explicit fallback on the percentage variable. Used for named opacity modifiers.
type angle = Values.angle = | Deg of float| Rad of float| Turn of float| Grad of float| Round of string * angle * angle| Mod of angle * angle| Rem of angle * angle| Calc of angle calcCalculated angle expressions
*)| Var of angle var| Invalid of invalid_valueSpec-invalid input the parser keeps verbatim; Optimize.drop_invalid drops the declaration on every serialisation.
CSS angle values
type number = Values.number = | Num of floatNumber value
*)| Var of number varCSS variable reference
*)| Calc of number calc| Round of string * number * numberCSS round() math function
| Mod of number * numberCSS mod() math function
| Rem of number * numberCSS rem() math function
| Hypot of number * numberCSS hypot() math function
| Pow of number * numberCSS pow() math function
| Sqrt of numberCSS sqrt() math function
| Abs of numberCSS abs() math function
| Sign of numberCSS sign() math function
| Sin of angleCSS sin() math function
CSS number values (unitless numbers for filters, transforms, etc.)
type aspect_ratio = Properties.aspect_ratio = CSS aspect-ratio values
ratio width height is an aspect-ratio value such as 16 / 9.
auto_ratio width height is an aspect-ratio value such as auto 16 / 9.
type blend_mode = Properties.blend_mode = | Normal| Multiply| Screen| Overlay| Darken| Lighten| Color_dodge| Color_burn| Hard_light| Soft_light| Difference| Exclusion| Hue| Saturation| Color| Luminosity| Plus_darker| Plus_lighter| Inherit| Initial| Unset| Revert| Revert_layer| Var of blend_mode varCSS blend-mode values
The optional value paired with an OpenType feature tag.
type font_feature_setting = Properties.font_feature_setting = {tag : string;value : font_feature_value option;}One OpenType feature tag and its optional value.
type font_feature_settings = Properties.font_feature_settings = | Normal| Feature_list of font_feature_setting list| Inherit| Initial| Unset| Revert| Revert_layer| Var of font_feature_settings varCSS font-feature-settings values.
One OpenType variation axis and its numeric value.
type font_variation_settings = Properties.font_variation_settings = | Normal| Axis_list of font_variation_setting list| Inherit| Initial| Unset| Revert| Revert_layer| Var of font_variation_settings varCSS font-variation-settings values.
important decl is decl marked as !important.
declaration_is_important decl returns true if decl has the !important flag.
declaration_name decl returns the property name of decl.
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.
declaration_value_for_equivalence decl is the minified value of decl, so a structural diff keys a typed property on its shortest spelling and padding: 0.50px and padding: .5px compare equal.
A custom-property token stream, whose bytes declaration_value keeps verbatim, also loses the whitespace CSS reads as nothing: the whitespace CSS Values 4 (ED) sec. 10.8 leaves optional around a math * and /, and the whitespace a closing bracket already accounts for. So --r: 16 / 9 and --r: 16/9 compare equal, while the space sec. 10.8 requires around a math + or -, and the space beside a var(), env() or attr() that sec. 2.5 substitutes textually into its neighbour, keep two spellings apart.
A quoted family name in that stream is rewritten as the equivalent unquoted <ident> sequence, one word or several, when a generic family in the stream proves the stream is a font-family list, where CSS Fonts 4 sec. 2.1.1 spells the one name both ways: --font: ui-sans-serif,"Noto Color Emoji" and --font: ui-sans-serif,Noto Color Emoji compare equal, as do --font: "Arial",sans-serif and --font: Arial,sans-serif. Without that proof the stream is arbitrary tokens, in which one <string> is not an <ident> sequence, and the two spellings keep distinct keys.
Not for emission, where every one of these forms stays verbatim.
CSS properties organized by functionality and usage patterns.
The CSS Box Model defines how element dimensions are calculated and how space is distributed around content. This includes width/height properties, padding, margins, and box sizing behavior.
type box_sizing = Properties.box_sizing = | Border_box| Content_box| Inherit| Initial| Unset| Revert| Revert_layer| Var of box_sizing varCSS box sizing values.
type field_sizing = Properties.field_sizing = | Content| Fixed| Inherit| Initial| Unset| Revert| Revert_layer| Var of field_sizing varCSS field sizing values.
type caption_side = Properties.caption_side = | Top| Bottom| Inherit| Initial| Unset| Revert| Revert_layer| Var of caption_side varCSS caption side values.
width len is the width property.
height len is the height property.
min_width len is the min-width property.
max_width len is the max-width property.
min_height len is the min-height property.
max_height len is the max-height property.
inline_size len is the inline-size logical property.
min_inline_size len is the min-inline-size logical property.
max_inline_size len is the max-inline-size logical property.
block_size len is the block-size logical property.
min_block_size len is the min-block-size logical property.
max_block_size len is the max-block-size logical property.
padding values is the padding shorthand property. Accepts 1-4 values.
padding_top len is the padding-top property.
padding_right len is the padding-right property.
padding_bottom len is the padding-bottom property.
padding_left len is the padding-left property.
margin values is the margin shorthand property. Accepts 1-4 values.
margin_top len is the margin-top property.
margin_right len is the margin-right property.
margin_bottom len is the margin-bottom property.
margin_left len is the margin-left property.
box_sizing sizing is the box-sizing property.
field_sizing sizing is the field-sizing property.
caption_side side is the caption-side property.
aspect_ratio ratio is the aspect-ratio property.
CSS Logical Properties provide writing-mode-relative property equivalents for physical properties. These adapt to different writing directions and text orientations.
type border_width = Properties.border_width = | Thin| Medium| Thick| Px of float| Cm of float| Mm of float| Q of float| In of float| Pt of float| Pc of float| Rem of float| Em of float| Ex of float| Cap of float| Ic of float| Ric of float| Rlh of float| Ch of float| Lh of float| Vh of float| Vw of float| Vmin of float| Vmax of float| Pct of float| Dimension of {}A length in a unit border_width does not name, carrying the authored spelling in repr the way length does.
| Zero| Auto| Max_content| Min_content| Fit_content| From_font| Calc of border_width calc| Min of border_width calc list| Max of border_width calc list| Clamp of border_width calc * border_width calc * border_width calc| Inherit| Initial| Unset| Revert| Revert_layer| Var of border_width varborder_inline_start_width len is the border-inline-start-width property.
border_inline_end_width len is the border-inline-end-width property.
border_block_start_width len is the border-block-start-width property.
border_block_end_width len is the border-block-end-width property.
border_inline_start_color c is the border-inline-start-color property.
border_inline_end_color c is the border-inline-end-color property.
border_block_start_color c is the border-block-start-color property.
border_block_end_color c is the border-block-end-color property.
padding_inline_start len is the padding-inline-start property.
padding_inline_end len is the padding-inline-end property.
padding_inline lens is the padding-inline shorthand property.
padding_block lens is the padding-block shorthand property.
padding_block_start len is the padding-block-start property.
padding_block_end len is the padding-block-end property.
margin_inline len is the margin-inline property with a length value.
margin_inline_start len is the margin-inline-start property.
margin_inline_end len is the margin-inline-end property.
margin_block len is the margin-block property with a length value.
margin_block_start len is the margin-block-start property.
margin_block_end len is the margin-block-end property.
Controls how elements are displayed and positioned in the document flow. This includes the display model, positioning schemes, and stacking context.
type display = Properties.display = | Block| Inline| Inline_block| Flex| Inline_flex| Grid| Inline_grid| Grid_lanes| Inline_grid_lanes| None| Flow_root| Table| Table_row| Table_cell| Table_caption| Table_column| Table_column_group| Table_header_group| Table_row_group| Inline_table| List_item| Contents| Run_in| Ruby| Ruby_base| Ruby_text| Ruby_base_container| Ruby_text_container| Math| Webkit_flex| Webkit_inline_flex| Ms_flexbox| Webkit_box| Moz_box| Moz_inline_box| Inherit| Initial| Unset| Revert| Revert_layer| Multi of display * displayTwo-value <display-outside> <display-inside> syntax per CSS Display 3 sec. 2.1, e.g. inline flow-root or list-item flow-root.
| Var of display varCSS display values.
type position = Properties.position = CSS position values.
type visibility = Properties.visibility = | Visible| Hidden| Collapse| Inherit| Initial| Unset| Revert| Revert_layer| Var of visibility varCSS visibility values.
type z_index = Properties.z_index = CSS z-index values.
type opacity = Properties.opacity = CSS opacity values.
type order = Properties.order = CSS order values (flexbox order).
type overflow = Properties.overflow = CSS overflow values.
type border_spacing = Properties.border_spacing = | Lengths of length list| Var of border_spacing vardisplay d is the display property.
position p is the position property.
inset len is the inset property for positioned elements.
inset_inline len is the inset-inline logical property.
inset_inline_start len is the inset-inline-start logical property.
inset_inline_end len is the inset-inline-end logical property.
inset_block len is the inset-block logical property.
inset_block_start len is the inset-block-start logical property.
inset_block_end len is the inset-block-end logical property.
top len is the top property for positioned elements.
right len is the right property for positioned elements.
bottom len is the bottom property for positioned elements.
left len is the left property for positioned elements.
z_index z is the z-index property.
z_index_auto is the z-index property set to auto.
type isolation = Properties.isolation = CSS isolation values
isolation iso is the isolation property for stacking context control.
type break_value = Properties.break_value = | Auto| Avoid| All| Avoid_page| Page| Left| Right| Recto| Verso| Avoid_column| Column| Avoid_region| Region| Initial| Inherit| Unset| Revert| Revert_layer| Var of break_value varCSS break-before/break-after values for page/column/region breaks.
break_before v is the break-before property.
break_after v is the break-after property.
type break_inside_value = Properties.break_inside_value = | Auto| Avoid| Avoid_page| Avoid_column| Initial| Inherit| Unset| Revert| Revert_layer| Var of break_inside_value varCSS break-inside values.
break_inside v is the break-inside property.
type page_break_value = Properties.page_break_value = | Auto| Always| Avoid| Left| Right| Initial| Inherit| Unset| Revert| Revert_layer| Var of page_break_value varCSS Fragmentation 3 sec. 3.4 deprecated page-break-inside vocabulary.
CSS Fragmentation 3 sec. 3.4 deprecated page-break-before / -after alias vocabulary; the shorter value list makes these their own type rather than overload break_value.
type page_break_inside_value = Properties.page_break_inside_value = | Auto| Avoid| Initial| Inherit| Unset| Revert| Revert_layer| Var of page_break_inside_value varpage_break_before v is the legacy page-break-before property.
page_break_after v is the legacy page-break-after property.
page_break_inside v is the legacy page-break-inside property.
type page_size_name = Properties.page_size_name = | A5| A4| A3| B5| B4| Jis_b5| Jis_b4| Letter| Legal| Ledger| Var of page_size_name vartype page_size_orientation = Properties.page_size_orientation = | Portrait| Landscape| Var of page_size_orientation vartype page_size = Properties.page_size = | Auto| Single of length| Pair of length * length| Named of page_size_name| Named_oriented of page_size_name * page_size_orientation| Oriented of page_size_orientation| Initial| Inherit| Unset| Revert| Revert_layer| Var of page_size varCSS paged-media size descriptor values.
type columns_value = Properties.columns_value = | Auto| Count of int| Width of length| Both of length * int| Auto_count of int| Count_calc of columns_value calcA count given as a math function, with no width beside it
*)| Inherit| Initial| Unset| Revert| Revert_layer| Var of columns_value varCSS columns values for multi-column layout.
columns_count count is a column-count value for the columns shorthand.
columns_width width is a column-width value for the columns shorthand.
columns_both width count is a combined columns shorthand value.
type column_span = Properties.column_span = | None| All| Inherit| Initial| Unset| Revert| Revert_layer| Var of column_span varcolumns v is the columns property for multi-column layout.
column_span v is the column-span property.
type column_width = Properties.column_width = | Auto| Width of length| Inherit| Initial| Unset| Revert| Revert_layer| Var of column_width varCSS Multicol 2 column-width: auto | <length [0,inf]>.
column_width v is the column-width longhand of columns.
type column_count = Properties.column_count = | Auto| Count of int| Calc of column_count calcA math function answering an <integer>
| Inherit| Initial| Unset| Revert| Revert_layer| Var of column_count varCSS Multicol 2 column-count: auto | <integer [1,inf]>.
column_count v is the column-count longhand of columns.
type column_height = Properties.column_height = | Auto| Height of length| Inherit| Initial| Unset| Revert| Revert_layer| Var of column_height varCSS Multicol 2 column-height: auto | <length [0,inf]>.
column_height v is the column-height property.
type column_wrap = Properties.column_wrap = | Auto| Nowrap| Wrap| Inherit| Initial| Unset| Revert| Revert_layer| Var of column_wrap varCSS Multicol 2 column-wrap: auto | nowrap | wrap.
column_wrap v is the column-wrap property.
visibility v is the visibility property.
type float_side = Properties.float_side = | None| Left| Right| Inline_start| Inline_end| Initial| Inherit| Unset| Revert| Revert_layer| Var of float_side varCSS float side values.
float side is the float property.
type clear = Properties.clear = CSS clear values.
clear clr is the clear property.
overflow ov is the overflow property.
overflow_x ov is the overflow-x property.
overflow_y ov is the overflow-y property.
type content = Properties.content = | String of string| Quoted of {}| Image of Properties.background_image| None| Normal| Open_quote| Close_quote| Attr of content attr_call| Counter of string| Counters of string * string| String_ref of string| Content_list of content list| Inherit| Initial| Unset| Revert| Revert_layer| Var of content varCSS content values
content_counters name separator is a counters(name, separator) content item.
content_list items is a space-separated content value.
counter_item ?value name is one named counter item.
type counter_set = Properties.counter_set = | None| Counters of counter_item list| Inherit| Initial| Unset| Revert| Revert_layer| Var of counter_set varcounter_set items is a counter-reset/increment/set list.
content c is the content property.
counter_reset c is the CSS counter-reset property.
counter_increment c is the CSS counter-increment property.
type object_fit = Properties.object_fit = | Fill| Contain| Cover| None| Scale_down| Inherit| Initial| Unset| Revert| Revert_layer| Var of object_fit varCSS object-fit values
object_fit fit is the object-fit property.
type position_value = Properties.position_value = | Center| Top| Bottom| Left| Right| Left_top| Left_center| Left_bottom| Right_top| Right_center| Right_bottom| Center_top| Center_bottom| Top_left| Top_right| Bottom_left| Bottom_right| XY of length * length| Single of lengthSingle length/percentage value for background-position
*)| Inherit| Initial| Unset| Revert| Revert_layer| Edge_offset_axis of string * length_percentage * string| Axis_edge_offset of string * string * length_percentage| Edge_offset_edge_offset of string
* length_percentage
* string
* length_percentage| Var of position_value varobject_position pos is the object-position property.
type text_overflow = Properties.text_overflow = | Clip| Ellipsis| String of string| Pair of text_overflow * text_overflow| Inherit| Initial| Unset| Revert| Revert_layer| Var of text_overflow varCSS text-overflow values
position_xy x y is a two-axis position value.
position_length value is a one-value position.
text_overflow_string value is a custom text-overflow marker.
text_overflow_pair start end_ is the two-value text-overflow form.
text_overflow ov is the text-overflow property.
type text_wrap = Properties.text_wrap = CSS text-wrap values
type text_wrap_mode = Properties.text_wrap_mode = | Wrap| No_wrap| Inherit| Initial| Unset| Revert| Revert_layer| Var of text_wrap_mode vartype text_wrap_style = Properties.text_wrap_style = | Auto| Balance| Pretty| Stable| Inherit| Initial| Unset| Revert| Revert_layer| Var of text_wrap_style vartype text_box_trim = Properties.text_box_trim = | None| Trim_start| Trim_end| Trim_both| Inherit| Initial| Unset| Revert| Revert_layer| Var of text_box_trim vartype text_underline_position_keyword =
Properties.text_underline_position_keyword =
type text_underline_position = Properties.text_underline_position = | Auto| From_font| Position of text_underline_position_keyword list| Inherit| Initial| Unset| Revert| Revert_layer| Var of text_underline_position vartype text_box_edge_keyword = Properties.text_box_edge_keyword = type text_box_edge = Properties.text_box_edge = | Auto| Edge of text_box_edge_keyword * text_box_edge_keyword option| Inherit| Initial| Unset| Revert| Revert_layer| Var of text_box_edge vartype inline_sizing = Properties.inline_sizing = | Normal| Stretch| Inherit| Initial| Unset| Revert| Revert_layer| Var of inline_sizing vartype line_fit_edge_keyword = Properties.line_fit_edge_keyword = type line_fit_edge = Properties.line_fit_edge = | Edge of line_fit_edge_keyword * line_fit_edge_keyword option| Inherit| Initial| Unset| Revert| Revert_layer| Var of line_fit_edge vartype interpolate_size = Properties.interpolate_size = | Numeric_only| Allow_keywords| Inherit| Initial| Unset| Revert| Revert_layer| Var of interpolate_size vartype min_intrinsic_sizing_keyword = Properties.min_intrinsic_sizing_keyword = type min_intrinsic_sizing = Properties.min_intrinsic_sizing = | Sizing of min_intrinsic_sizing_keyword list| Inherit| Initial| Unset| Revert| Revert_layer| Var of min_intrinsic_sizing vartype ruby_merge = Properties.ruby_merge = | Separate| Merge| Auto| Inherit| Initial| Unset| Revert| Revert_layer| Var of ruby_merge vartype ruby_align = Properties.ruby_align = | Start| Center| Space_between| Space_around| Inherit| Initial| Unset| Revert| Revert_layer| Var of ruby_align vartype ruby_overhang = Properties.ruby_overhang = | Auto| Spaces| None| Inherit| Initial| Unset| Revert| Revert_layer| Var of ruby_overhang vartype ruby_position_keyword = Properties.ruby_position_keyword = type ruby_position = Properties.ruby_position = | Position of ruby_position_keyword list| Inherit| Initial| Unset| Revert| Revert_layer| Var of ruby_position vartype text_spacing_trim = Properties.text_spacing_trim = | Normal| Space_all| Trim_start| Space_first| Inherit| Initial| Unset| Revert| Revert_layer| Var of text_spacing_trim vartype hyphenate_limit_chars = Properties.hyphenate_limit_chars = | One of hyphenate_limit_chars_item| Two of hyphenate_limit_chars_item * hyphenate_limit_chars_item| Three of hyphenate_limit_chars_item
* hyphenate_limit_chars_item
* hyphenate_limit_chars_item| Inherit| Initial| Unset| Revert| Revert_layer| Var of hyphenate_limit_chars vartype initial_letter = Properties.initial_letter = | Normal| Drop| Raise| Size of float| Size_sink of float * int| Calc of initial_letter calc * int optionA math function in the size slot
*)| Inherit| Initial| Unset| Revert| Revert_layer| Var of initial_letter vartext_wrap wrap is the text-wrap property.
text_wrap_mode wrap is the CSS text-wrap-mode property.
text_underline_position position is the CSS text-underline-position property.
text_box_edge edge is the CSS text-box-edge property.
inline_sizing sizing is the CSS inline-sizing property.
line_fit_edge edge is the CSS line-fit-edge property.
interpolate_size sizing is the CSS interpolate-size property.
min_intrinsic_sizing sizing is the CSS min-intrinsic-sizing property.
ruby_align align is the CSS ruby-align property.
ruby_merge merge is the CSS ruby-merge property.
ruby_overhang overhang is the CSS ruby-overhang property.
ruby_position position is the CSS ruby-position property.
type backface_visibility = Properties.backface_visibility = | Visible| Hidden| Initial| Inherit| Unset| Revert| Revert_layer| Var of backface_visibility varCSS backface-visibility values
backface_visibility vis is the backface-visibility property (3D transforms).
type content_visibility = Properties.content_visibility = | VisibleContent is visible and rendered
*)| HiddenContent is hidden from rendering
*)| AutoBrowser determines visibility based on relevance
*)| Initial| InheritInherit from parent
*)| Unset| Revert| Revert_layer| Var of content_visibility varCSS content-visibility values.
content_visibility vis is the content-visibility property.
type quotes = Properties.quotes = CSS quotes property values - defines quotation marks for q and blockquote.
quotes q is the quotes property.
type list_style_position = Properties.list_style_position = | Inside| Outside| Inherit| Initial| Unset| Revert| Revert_layer| Var of list_style_position varCSS list-style-position values
list_style_position pos is the list-style-position property.
Properties for controlling foreground colors, background colors, images, and related visual styling for element backgrounds.
type forced_color_adjust = Properties.forced_color_adjust = | Auto| None| Preserve_parent_color| Inherit| Initial| Unset| Revert| Revert_layer| Var of forced_color_adjust varCSS forced-color-adjust values.
type background_repeat = Properties.background_repeat = | Repeat| Space| Round| No_repeat| Repeat_x| Repeat_y| Layers of background_repeat list| Repeat_repeat| Repeat_space| Repeat_round| Repeat_no_repeat| Space_repeat| Space_space| Space_round| Space_no_repeat| Round_repeat| Round_space| Round_round| Round_no_repeat| No_repeat_repeat| No_repeat_space| No_repeat_round| No_repeat_no_repeat| Inherit| Initial| Unset| Revert| Revert_layer| Var of background_repeat varCSS background-repeat values.
type background_size = Properties.background_size = | Auto| Cover| Contain| Length of length| Size of length * length| Layers of background_size list| Inherit| Initial| Unset| Revert| Revert_layer| Var of background_size varCSS background-size values.
background_size_pair width height is a two-value background-size.
type background_attachment = Properties.background_attachment = | Scroll| Fixed| Local| Layers of background_attachment list| Initial| Inherit| Unset| Revert| Revert_layer| Var of background_attachment varCSS background-attachment values.
type hue_interpolation_method = Properties.hue_interpolation_method = CSS Color 5 section 9.1: hue-interpolation method for polar color spaces (lch / oklch / hsl / hwb).
type color_interpolation = Properties.color_interpolation = | In of color_space * hue_interpolation_method option| Var of color_interpolation varColour interpolation for gradients. CSS Color 5 sec. 9 spells one <color-interpolation-method> wherever one appears, over the same fifteen spaces color-mix() takes, so the space is carried rather than named in a constructor of its own. Sec. 9.1 puts the <hue-interpolation-method> after a polar space only.
type gradient_direction = Properties.gradient_direction = | Default_direction| To_top| To_top_right| To_right| To_bottom_right| To_bottom| To_bottom_left| To_left| To_top_left| Angle of angle| With_interpolation of gradient_direction * color_interpolation| Var of gradient_direction varGradient direction values
Shape of a radial gradient
type radial_size = Properties.radial_size = | Closest_side| Farthest_side| Closest_corner| Farthest_corner| Circle_radius of length| Ellipse_radii of length_percentage * length_percentage| Var of radial_size varSize of a radial gradient
type radial_gradient_config = Properties.radial_gradient_config = {shape : radial_shape option;size : radial_size option;position : position_value option;interpolation : color_interpolation option;}Configuration for radial-gradient prefix: shape, size, position, and optional in <color-interpolation-method> clause.
type conic_gradient_config = Properties.conic_gradient_config = {angle : angle option;from <angle> starting angle
position : position_value option;at <position> center
interpolation : color_interpolation option;Optional in <color-interpolation-method> clause.
}Configuration for conic-gradient prefix: starting angle, center, and optional in <color-interpolation-method> clause.
type gradient_position = Properties.gradient_position = | Linear_position of gradient_direction| Radial_position of radial_gradient_config| Conic_position of conic_gradient_config| Var of gradient_position vartype gradient_stop = Properties.gradient_stop = | Color_percentage of color * length_percentage option * length_percentage optionColor with optional percentage positions
*)| Color_length of color * length option * length optionColor with optional length positions
*)| Length of lengthInterpolation hint with length, e.g., "50px"
*)| Channel of channelResidual numeric channel token from custom-property substitution.
*)| List of gradient_stop listMultiple gradient stops - used for var fallbacks
*)| Percentage of percentageInterpolation hint with percentage, e.g., "50%"
*)| Position of gradient_position| Direction of gradient_directionGradient direction for stops, e.g., "to right" or Var
*)| Var of gradient_stop varGradient stop values
gradient_stops stops groups multiple gradient stops, usually for variable fallbacks.
gradient_hint_length value is a length interpolation hint.
gradient_hint_percentage value is a percentage interpolation hint.
val radial_gradient_config :
?shape:radial_shape ->
?size:radial_size ->
?position:position_value ->
?interpolation:color_interpolation ->
unit ->
radial_gradient_configradial_gradient_config ?shape ?size ?position ?interpolation () builds a radial-gradient prefix.
val conic_gradient_config :
?angle:angle ->
?position:position_value ->
?interpolation:color_interpolation ->
unit ->
conic_gradient_configconic_gradient_config ?angle ?position ?interpolation () builds a conic-gradient prefix.
type border_radius = Properties.border_radius = | Radius of {horizontal : length_percentage list;1-4 horizontal radii (top-left, top-right, bottom-right, bottom-left).
*)vertical : length_percentage list option;Optional 1-4 vertical radii after /; when None the horizontal values are used for both axes.
}| Inherit| Initial| Unset| Revert| Revert_layer| Var of border_radius varPer CSS Backgrounds and Borders 3 sec. 4.1.
radius len is a one-value border-radius shorthand value.
For example, border_radius (radius (Rem 0.375)) renders border-radius: 0.375rem.
type object_view_box = Properties.object_view_box = | None| Inset of length * length option * length option * length option| Xywh of {x : length_percentage;y : length_percentage;width : length_percentage;height : length_percentage;rounded : border_radius option;}| Rect of {top : length_percentage;right : length_percentage;bottom : length_percentage;left : length_percentage;rounded : border_radius option;}| Inherit| Initial| Unset| Revert| Revert_layer| Var of object_view_box varval object_view_box_inset :
?right:length ->
?bottom:length ->
?left:length ->
length ->
object_view_boxobject_view_box_inset ?right ?bottom ?left top is an inset() object view box.
object_view_box box is the CSS object-view-box property.
module Webkit_gradient : sig ... endBackground image values
type background_image = Properties.background_image = | Url of string| Quoted of string * char| Linear_gradient of gradient_direction * gradient_stop list| Linear_gradient_var of gradient_stop varLinear gradient using a single variable for all stops including position. Outputs: linear-gradient(var(--tw-gradient-stops))
*)| Radial_gradient of radial_gradient_config * gradient_stop list| Radial_gradient_var of gradient_stop varRadial gradient using a single variable for all stops. Outputs: radial-gradient(var(--tw-gradient-stops))
*)| Conic_gradient of conic_gradient_config * gradient_stop list| Conic_gradient_var of gradient_stop varConic gradient using a single variable for all stops. Outputs: conic-gradient(var(--tw-gradient-stops))
*)| Repeating_linear_gradient of gradient_direction * gradient_stop list| Repeating_radial_gradient of radial_gradient_config * gradient_stop list| Repeating_conic_gradient of conic_gradient_config * gradient_stop listrepeating-{linear,radial,conic}-gradient() CSS Images 4 sec. 3.
| Webkit_linear_gradient of gradient_direction * gradient_stop list| Webkit_repeating_linear_gradient of gradient_direction * gradient_stop list| Webkit_radial_gradient of radial_gradient_config * gradient_stop list| Webkit_repeating_radial_gradient of radial_gradient_config * gradient_stop list| Moz_linear_gradient of gradient_direction * gradient_stop list| Moz_repeating_linear_gradient of gradient_direction * gradient_stop list| Moz_radial_gradient of radial_gradient_config * gradient_stop list| Moz_repeating_radial_gradient of radial_gradient_config * gradient_stop list| O_linear_gradient of gradient_direction * gradient_stop list| O_repeating_linear_gradient of gradient_direction * gradient_stop list| O_radial_gradient of radial_gradient_config * gradient_stop list| O_repeating_radial_gradient of radial_gradient_config * gradient_stop list| Image_set of image_set_option listimage-set(<source>#) CSS Images 4
| Webkit_image_set of image_set_option list-webkit-image-set(<source>#) legacy spelling
| Cross_fade of cross_fade_option listcross-fade(<cf-mixing-image>#) CSS Images 4
| Webkit_gradient of Webkit_gradient.t| List of background_image listComma-separated list of background images
*)| None| Initial| Inherit| Unset| Revert| Revert_layer| Var of background_image varCSS variable reference: var(--my-gradient)
*)and image_set_option = Properties.image_set_option = {source : image_set_source;resolution : string option;<resolution> like "1x" or "300dpi"
mime_type : string option;type("image/avif")
}and cross_fade_option = Properties.cross_fade_option = {image : background_image;percent : percentage option;}type background_box = Properties.background_box = | Border_box| Padding_box| Content_box| Text| Layers of background_box list| Inherit| Initial| Unset| Revert| Revert_layer| Var of background_box varCSS background and mask box values.
type webkit_mask_box = Properties.webkit_mask_box = | Border| Border_box| Content| Content_box| Padding| Padding_box| Text| Layers of webkit_mask_box list| Inherit| Initial| Unset| Revert| Revert_layer| Var of webkit_mask_box vartype webkit_mask_composite = Properties.webkit_mask_composite = | Source_over| Source_in| Source_out| Source_atop| Destination_over| Destination_in| Destination_out| Destination_atop| Xor| Plus_lighter| Clear| Copy| Composites of webkit_mask_composite list| Inherit| Initial| Unset| Revert| Revert_layer| Var of webkit_mask_composite vartype mask_composite = Properties.mask_composite = | Add| Subtract| Intersect| Exclude| Composites of mask_composite list| Inherit| Initial| Unset| Revert| Revert_layer| Var of mask_composite vartype webkit_mask_source_type = Properties.webkit_mask_source_type = | Alpha| Luminance| Auto| Inherit| Initial| Unset| Revert| Revert_layer| Var of webkit_mask_source_type vartype mask_mode = Properties.mask_mode = type mask_type = Properties.mask_type = type mask_box = Properties.mask_box = type mask_layer = Properties.mask_layer = {image : background_image option;position : position_value option;size : background_size option;repeat : background_repeat option;origin : mask_box option;clip : mask_box option;mode : mask_mode option;composite : mask_composite option;}type mask = Properties.mask = | None| Layer of mask_layer| Layers of mask_layer list| Initial| Inherit| Unset| Revert| Revert_layer| Var of mask varval mask_layer :
?image:background_image ->
?position:position_value ->
?size:background_size ->
?repeat:background_repeat ->
?origin:mask_box ->
?clip:mask_box ->
?mode:mask_mode ->
?composite:mask_composite ->
unit ->
mask_layermask_layer ?image ?position ?size ?repeat ?origin ?clip ?mode ?composite () is one layer for the mask shorthand.
mask_layers layers is a comma-separated mask shorthand value.
type background_shorthand = Properties.background_shorthand = {color : color option;image : background_image option;position : position_value option;size : background_size option;repeat : background_repeat option;attachment : background_attachment option;clip : background_box option;origin : background_box option;}CSS background shorthand values.
type background = Properties.background = | Inherit| Initial| Unset| None| Shorthand of background_shorthandCSS background values.
*)| Var of background var| Vars of background var listval 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 ->
backgroundbackground_shorthand ?color ?image ?position ?size ?repeat ?attachment ?clip ?origin () is the background shorthand.
color: background colorimage: background image (url or gradient)position: image positionsize: image size (cover, contain, or specific size)repeat: repeat behavior (repeat, no-repeat, etc.)attachment: scroll behavior (scroll, fixed, local)clip: clipping areaorigin: positioning area.color c is the color property.
background bg is the background shorthand property.
background_color c is the background-color property.
background_image img is the background-image property.
background_position pos is the background-position property.
background_size sz is the background-size property.
background_repeat rep is the background-repeat property.
background_attachment att is the background-attachment property.
opacity op is the opacity property.
val url : string -> background_imageurl path is a URL background image value.
val linear_gradient :
gradient_direction ->
gradient_stop list ->
background_imagelinear_gradient dir stops is a linear gradient background.
val radial_gradient :
?config:radial_gradient_config ->
gradient_stop list ->
background_imageradial_gradient ?config stops is a radial gradient background.
conic_gradient ?config stops is a conic gradient background.
val color_stop : color -> gradient_stopcolor_stop c is a simple color stop.
val color_position : color -> length -> gradient_stopcolor_position c pos is a color stop at a specific position.
Properties for CSS Flexible Box Layout, a one-dimensional layout method for distributing space between items and providing alignment capabilities.
type flex_direction = Properties.flex_direction = | Row| Row_reverse| Column| Column_reverse| Inherit| Initial| Unset| Revert| Revert_layer| Var of flex_direction varCSS flex direction values.
type flex_wrap = Properties.flex_wrap = CSS flex wrap values.
type flex_flow = Properties.flex_flow = | Flow of flex_direction option * flex_wrap option| Inherit| Initial| Unset| Revert| Revert_layer| Var of flex_flow vartype flex_factor = Properties.flex_factor = | Number of float| Inherit| Initial| Unset| Revert| Revert_layer| Calc of flex_factor calc| Var of flex_factor vartype flex_basis = Properties.flex_basis = | Auto| Content| Px of float| Cm of float| Mm of float| Q of float| In of float| Pt of float| Pc of float| Rem of float| Em of float| Ex of float| Cap of float| Ic of float| Ric of float| Rlh of float| Pct of float| Vw of float| Vh of float| Vmin of float| Vmax of float| Vi of float| Vb of float| Dvh of float| Dvw of float| Dvmin of float| Dvmax of float| Lvh of float| Lvw of float| Lvmin of float| Lvmax of float| Svh of float| Svw of float| Svmin of float| Svmax of float| Ch of float| Lh of float| Num of float| Zero| Inherit| Initial| Unset| Revert| Revert_layer| Fit_content| Fit_content_arg of length| Max_content| Min_content| Clamp of length * length * length| Min of length list| Max of length list| Round of string * length * length| Mod of length * length| Rem_fn of length * length| Hypot of length list| Abs of length| Dimension of {}| Calc of flex_basis calc| Var of flex_basis varCSS flex basis values.
type flex = Properties.flex = | Initial0 1 auto
*)| Inherit| Unset| Revert| Revert_layer| Auto1 1 auto
*)| None0 0 auto
*)| Grow of flex_factorSingle grow value
*)| Basis of flex_basis1 1 <flex-basis>
*)| Grow_shrink of flex_factor * flex_factorgrow shrink 0%
*)| Full of flex_factor * flex_factor * flex_basisgrow shrink basis
*)| Var of flex varCSS flex shorthand values.
type font_size = Properties.font_size = CSS font-size values. MDN: font-size
CSS Box Alignment properties for flexbox and grid layouts.
type align_content = Properties.align_content = | Normal| Baseline| First_baseline| Last_baseline| Center| Start| End| Flex_start| Flex_end| Safe_center| Safe_start| Safe_end| Safe_flex_start| Safe_flex_end| Unsafe_center| Unsafe_start| Unsafe_end| Unsafe_flex_start| Unsafe_flex_end| Space_between| Space_around| Space_evenly| Stretch| Inherit| Initial| Unset| Revert| Revert_layer| Var of align_content varCSS align-content values. MDN: align-content
type align_items = Properties.align_items = | Normal| Stretch| Baseline| First_baseline| Last_baseline| Center| Start| End| Self_start| Self_end| Flex_start| Flex_end| Safe_center| Safe_start| Safe_end| Safe_flex_start| Safe_flex_end| Unsafe_center| Unsafe_start| Unsafe_end| Unsafe_self_start| Unsafe_self_end| Unsafe_flex_start| Unsafe_flex_end| Anchor_center| Inherit| Initial| Unset| Revert| Revert_layer| Var of align_items varCSS align-items values. MDN: align-items
type justify_content = Properties.justify_content = | Normal| Center| Start| End| Flex_start| Flex_end| Left| Right| Safe_center| Safe_start| Safe_end| Safe_flex_start| Safe_flex_end| Safe_left| Safe_right| Unsafe_center| Unsafe_start| Unsafe_end| Unsafe_flex_start| Unsafe_flex_end| Unsafe_left| Unsafe_right| Space_between| Space_around| Space_evenly| Stretch| Inherit| Initial| Unset| Revert| Revert_layer| Var of justify_content varCSS justify-content values. MDN: justify-content
type align_self = Properties.align_self = | Auto| Normal| Stretch| Baseline| First_baseline| Last_baseline| Center| Start| End| Self_start| Self_end| Flex_start| Flex_end| Safe_center| Safe_start| Safe_end| Safe_flex_start| Safe_flex_end| Unsafe_center| Unsafe_start| Unsafe_end| Unsafe_self_start| Unsafe_self_end| Unsafe_flex_start| Unsafe_flex_end| Inherit| Initial| Unset| Revert| Revert_layer| Var of align_self varCSS align-self values. MDN: align-self
type justify_items = Properties.justify_items = | Normal| Stretch| Baseline| First_baseline| Last_baseline| Center| Start| End| Self_start| Self_end| Flex_start| Flex_end| Left| Right| Safe_center| Safe_start| Safe_end| Safe_self_start| Safe_self_end| Safe_flex_start| Safe_flex_end| Safe_left| Safe_right| Unsafe_center| Unsafe_start| Unsafe_end| Unsafe_self_start| Unsafe_self_end| Unsafe_flex_start| Unsafe_flex_end| Unsafe_left| Unsafe_right| Anchor_center| Legacy| Legacy_center| Legacy_left| Legacy_right| Inherit| Initial| Unset| Revert| Revert_layer| Var of justify_items varCSS justify-items values. MDN: justify-items
type justify_self = Properties.justify_self = | Auto| Normal| Stretch| Baseline| First_baseline| Last_baseline| Center| Start| End| Self_start| Self_end| Flex_start| Flex_end| Left| Right| Safe_center| Safe_start| Safe_end| Safe_self_start| Safe_self_end| Safe_flex_start| Safe_flex_end| Safe_left| Safe_right| Unsafe_center| Unsafe_start| Unsafe_end| Unsafe_self_start| Unsafe_self_end| Unsafe_flex_start| Unsafe_flex_end| Unsafe_left| Unsafe_right| Anchor_center| Inherit| Initial| Unset| Revert| Revert_layer| Var of justify_self varCSS justify-self values. MDN: justify-self
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.
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.
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.
align_self alignment is the align-self property. Overrides align-items for an individual item. Common values: Auto, Normal, Baseline, Center, Start, End, Stretch.
justify_items justification is the justify-items property. Sets default justification for all items. Common values: Normal, Baseline, Center, Start, End, Stretch, Legacy.
justify_self justification is the justify-self property. Sets justification for an individual item on the inline (main) axis.
flex_direction direction is the flex-direction property.
flex_wrap wrap is the flex-wrap property.
flex_flow flow is the CSS flex-flow property.
flex flex is the flex shorthand property.
flex_grow amount is the flex-grow property.
flex_shrink amount is the flex-shrink property.
flex_basis basis is the flex-basis property.
order order is the order property.
type gap = Properties.gap = CSS gap shorthand type.
gap gap is the gap property shorthand (applies to both row and column gaps).
row_gap gap is the row-gap property.
column_gap gap is the column-gap property.
Properties for CSS Grid Layout, a two-dimensional layout system optimized for user interface design with explicit row and column positioning.
type repeat_count = Properties.repeat_count = | Count of int| Auto_fill| Auto_fit| Var of repeat_count varrepeat() count argument: an integer or auto-fill / auto-fit (CSS Grid 1 sec. 7.2.3.1).
type grid_auto_flow_component = Properties.grid_auto_flow_component = | Axis of [ `Row | `Column ]| Dense| Var of grid_auto_flow_component varOne component in a grid-auto-flow value.
type grid_auto_flow = Properties.grid_auto_flow = | Row| Column| Dense| Row_dense| Column_dense| Components of grid_auto_flow_component list| Inherit| Initial| Unset| Revert| Revert_layer| Var of grid_auto_flow varCSS grid-auto-flow values
type grid_flex_math = Properties.grid_flex_math = CSS grid template values
type grid_template = Properties.grid_template = | None| Px of float| Rem of float| Em of float| Pct of float| Vw of float| Vh of float| Vmin of float| Vmax of float| Zero| Length of length| Fr of float| Flex_math of grid_flex_math| Auto| Min_content| Max_content| Inherit| Initial| Unset| Revert| Revert_layer| Min_max of grid_template * grid_template| Fit_content of length| Repeat of repeat_count * grid_template list| Tracks of grid_template list| Split of grid_template * grid_template| Auto_flow_columns of grid_template * grid_auto_flow * grid_template option<grid-template-rows> / auto-flow [dense]? <grid-auto-columns>?.
| Auto_flow_rows of grid_auto_flow * grid_template option * grid_templateauto-flow [dense]? <grid-auto-rows>? / <grid-template-columns>.
| Named_tracks of (string option * grid_template) list| Line_names of string list[col-start a b] line-names block, kept as its own track-list element so the printer preserves the surrounding track positions.
| Template of string| Subgrid| MasonryCSS Grid 3 (ED) removed this value, and it stays because Firefox ships it behind a pref: refusing it would drop a declaration a shipping browser renders.
*)| Var of grid_template vartype grid_template_areas = Properties.grid_template_areas = | No_areas| Areas of string| Inherit| Initial| Unset| Revert| Revert_layer| Var of grid_template_areas varCSS grid-template-areas values
type grid_line = Properties.grid_line = | Autoauto
*)| Num of int1, 2, 3, ... or -1, -2, ...
*)| Name of string"header-start", "main-end", etc.
*)| Num_name of int * string<integer> <custom-ident>
*)| Span of intspan 2, span 3, etc.
*)| Span_name of stringspan <custom-ident>
*)| Span_num_name of int * stringspan <integer> <custom-ident>
*)| Calc of grid_line calccalc(12 * -1), etc.
*)| Calc_name of grid_line calc * stringcalc(2) <custom-ident>
*)| Var of grid_line varCSS grid line values
type grid_line_pair = Properties.grid_line_pair = | Lines of grid_line * grid_line| Var of grid_line_pair vargrid_tracks tracks is a track list.
grid_repeat count tracks is a repeat(...) track list item.
grid_lines start end_ is a grid line pair for row/column shorthands.
grid_template_columns cols is the grid-template-columns property.
grid_template_rows rows is the grid-template-rows property.
grid_template_areas areas is the grid-template-areas property.
grid_template template is the grid-template shorthand property.
grid_auto_columns cols is the grid-auto-columns property.
grid_auto_rows rows is the grid-auto-rows property.
grid_auto_flow flow is the grid-auto-flow property.
grid_row_start start is the grid-row-start property.
grid_row_end end_ is the grid-row-end property.
grid_column_start start is the grid-column-start property.
grid_column_end end_ is the grid-column-end property.
grid_row v is the grid-row shorthand property.
grid_column v is the grid-column shorthand property.
grid_area area is the grid-area property.
type place_items = Properties.place_items = | Normal| Start| End| Center| Stretch| Baseline| First_baseline| Last_baseline| Start_safe| End_safe| Center_safe| Stretch_stretchExplicit stretch on both axes.
*)| Align_justify of align_items * justify_items| Inherit| Initial| Unset| Revert| Revert_layer| Var of place_items varCSS place-items values
place_items items is the place-items shorthand property.
type place_content = Properties.place_content = | Normal| Start| End| Center| Stretch| Space_between| Space_around| Space_evenly| Safe_center| Safe_start| Safe_end| Safe_stretch| Unsafe_center| Unsafe_start| Unsafe_end| Unsafe_stretch| Align_justify of align_content * justify_content| Inherit| Initial| Unset| Revert| Revert_layer| Var of place_content varCSS place-content values
place_content content is the place-content shorthand property.
place_self self_ is the place-self shorthand property.
Properties for controlling text appearance, fonts, and text layout. This includes font properties, text decoration, alignment, and spacing.
type font_weight = Properties.font_weight = | Weight of float| Normal| Bold| Bolder| Lighter| Calc of font_weight calc| Inherit| Initial| Unset| Revert| Revert_layer| Var of font_weight varCSS font weight values.
type text_align = Properties.text_align = | Left| Right| Center| Justify| Start| End| Match_parent| Webkit_match_parent| Inherit| Initial| Unset| Revert| Revert_layer| Var of text_align varCSS text align values.
type text_decoration_line = Properties.text_decoration_line = | None| Underline| Overline| Line_through| Blink| Spelling_error| Grammar_error| Inherit| Initial| Unset| Revert| Revert_layer| Var of text_decoration_line vartype text_decoration_style = Properties.text_decoration_style = | Solid| Double| Dotted| Dashed| Wavy| Inherit| Initial| Unset| Revert| Revert_layer| Var of text_decoration_style vartype text_decoration_shorthand = Properties.text_decoration_shorthand = {lines : text_decoration_line list;style : text_decoration_style option;color : color option;thickness : length option;}type text_decoration = Properties.text_decoration = | None| Shorthand of text_decoration_shorthand| Inherit| Initial| Unset| Revert| Revert_layer| Var of text_decoration varCSS text decoration values.
type text_emphasis_shape = Properties.text_emphasis_shape = type text_emphasis_style = Properties.text_emphasis_style = | None| Mark of text_emphasis_fill option * text_emphasis_shape option| String of string| Inherit| Initial| Unset| Revert| Revert_layer| Var of text_emphasis_style vartype text_emphasis = Properties.text_emphasis = | Emphasis of text_emphasis_style option * color option| Inherit| Initial| Unset| Revert| Revert_layer| Var of text_emphasis vartype text_emphasis_position = Properties.text_emphasis_position = | Position of text_emphasis_line * text_emphasis_side option| Inherit| Initial| Unset| Revert| Revert_layer| Var of text_emphasis_position vartype text_orientation = Properties.text_orientation = | Mixed| Upright| Sideways| Inherit| Initial| Unset| Revert| Revert_layer| Var of text_orientation vartype glyph_orientation_vertical = Properties.glyph_orientation_vertical = | Auto| Angle of angle| Inherit| Initial| Unset| Revert| Revert_layer| Var of glyph_orientation_vertical vartype line_break = Properties.line_break = | Auto| Loose| Normal| Strict| Anywhere| Inherit| Initial| Unset| Revert| Revert_layer| Var of line_break varval text_decoration_shorthand :
?lines:text_decoration_line list ->
?style:text_decoration_style ->
?color:color ->
?thickness:length ->
unit ->
text_decorationtext_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 colorthickness: line thickness.type font_style = Properties.font_style = | Normal| Italic| Oblique| Oblique_angle of angle| Oblique_range of angle * angle| Inherit| Initial| Unset| Revert| Revert_layer| Var of font_style varCSS font style values.
type text_transform = Properties.text_transform = | None| Case of text_transform_case| Combo of {case : text_transform_case option;full_width : bool;full_size_kana : bool;}| Inherit| Initial| Unset| Revert| Revert_layer| Var of text_transform varCSS text transform values.
type text_size_adjust = Properties.text_size_adjust = | None| Auto| Pct of float| Calc of text_size_adjust calcA math function answering a <percentage>
| Inherit| Initial| Unset| Revert| Revert_layer| Var of text_size_adjust varCSS text-size-adjust values (including vendor prefixes).
type font_family = Properties.font_family = | Sans_serif| Serif| Monospace| Cursive| Fantasy| System_ui| Ui_sans_serif| Ui_serif| Ui_monospace| Ui_rounded| Emoji| Math| Fangsong| Inter| Roboto| Open_sans| Lato| Montserrat| Poppins| Source_sans_pro| Raleway| Oswald| Noto_sans| Ubuntu| Playfair_display| Merriweather| Lora| PT_sans| PT_serif| Nunito| Nunito_sans| Work_sans| Rubik| Fira_sans| Fira_code| JetBrains_mono| IBM_plex_sans| IBM_plex_serif| IBM_plex_mono| Source_code_pro| Space_mono| DM_sans| DM_serif_display| Bebas_neue| Barlow| Mulish| Josefin_sans| Helvetica| Helvetica_neue| Arial| Verdana| Tahoma| Trebuchet_ms| Times_new_roman| Times| Georgia| Cambria| Garamond| Courier_new| Courier| Lucida_console| SF_pro| SF_pro_display| SF_pro_text| SF_mono| NY| Segoe_ui| Segoe_ui_emoji| Segoe_ui_symbol| Apple_color_emoji| Noto_color_emoji| Android_emoji| Twemoji_mozilla| Menlo| Monaco| Consolas| Liberation_mono| SFMono_regular| Cascadia_code| Cascadia_mono| Victor_mono| Inconsolata| Hack| Inherit| Initial| Unset| Revert| Revert_layer| Name of string| List of font_family list| Var of font_family var| Invalid of invalid_valueCSS-wide keyword mixed in a <custom-ident># list, preserved verbatim and dropped by Optimize.drop_invalid on every serialisation.
CSS font-family values
font_stack fonts is a comma-separated font-family stack.
font_family fonts is the font-family property.
font_families fonts is the font-family property from a comma-separated list. Raises Invalid_argument when fonts is empty.
font_size size is the font-size property.
font_weight weight is the font-weight property.
font_style style is the font-style property.
type line_height = Properties.line_height = | Normal| Px of float| Rem of float| Em of float| Pct of float| Num of float| Number of {}| Inherit| Initial| Unset| Revert| Revert_layer| Min of line_height list| Max of line_height list| Clamp of line_height * line_height * line_heightCSS Values 4 sec. 10.2 comparison functions over the <length-percentage> half of the grammar. A length beside a percentage resolves only at used-value time, so the call stands here rather than folding to one of its arguments.
| Calc of line_height calc| Var of line_height varCSS line-height values
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.
letter_spacing spacing is the letter-spacing property.
word_spacing spacing is the word-spacing property.
text_align align is the text-align property.
text_decoration decoration is the text-decoration property.
text_transform transform is the text-transform property.
type text_indent_value = Properties.text_indent_value = | Indent of {length : length_percentage;hanging : bool;each_line : bool;}| Inherit| Initial| Unset| Revert| Revert_layer| Var of text_indent_value vartext_indent indent is the text-indent property.
type white_space = Properties.white_space = | Normal| Nowrap| Pre| Pre_wrap| Pre_line| Break_spaces| Collapse| Preserve_nowrap| Inherit| Initial| Unset| Revert| Revert_layer| Var of white_space varCSS white-space values
white_space space is the white-space property.
type word_break = Properties.word_break = | Normal| Break_all| Keep_all| Break_word| Auto_phrase| Inherit| Initial| Unset| Revert| Revert_layer| Var of word_break varCSS word-break values
word_break break is the word-break property.
text_decoration_color color is the text-decoration-color property.
text_size_adjust adjust is the text-size-adjust property.
text_decoration_style style is the text-decoration-style property.
text_decoration_line line is the text-decoration-line property.
text_underline_offset offset is the text-underline-offset property.
text_emphasis emphasis is the text-emphasis property.
text_emphasis_style style is the text-emphasis-style property.
text_emphasis_color color is the text-emphasis-color property.
text_emphasis_position position is the text-emphasis-position property.
text_orientation orientation is the text-orientation property.
glyph_orientation_vertical orientation is the CSS glyph-orientation-vertical property.
type overflow_wrap = Properties.overflow_wrap = | Normal| Break_word| Anywhere| Inherit| Initial| Unset| Revert| Revert_layer| Var of overflow_wrap varCSS overflow-wrap values
overflow_wrap wrap is the overflow-wrap property.
line_break break is the line-break property.
type hyphens = Properties.hyphens = CSS hyphens values
hyphens hyphens is the hyphens property.
type font_stretch = Properties.font_stretch = | Pct of floatPercentage values from 50% to 200%
*)| Calc of font_stretch calcA math function answering a <percentage>
| Ultra_condensed| Extra_condensed| Condensed| Semi_condensed| Normal| Semi_expanded| Expanded| Extra_expanded| Ultra_expanded| Inherit| Initial| Unset| Revert| Revert_layer| Var of font_stretch varCSS font-stretch values
type font_shorthand = Properties.font_shorthand = {style : font_style option;variant : font_variant_css21 option;weight : font_weight option;stretch : font_stretch option;size : font_size;line_height : line_height option;family : font_family;}type font = Properties.font = | Shorthand of font_shorthand| Caption| Icon| Menu| Message_box| Small_caption| Status_bar| Inherit| Initial| Unset| Revert| Revert_layer| Var of font varfont_stretch stretch is the font-stretch property.
type font_optical_sizing = Properties.font_optical_sizing = | Auto| None| Inherit| Initial| Unset| Revert| Revert_layer| Var of font_optical_sizing varfont_optical_sizing sizing is the font-optical-sizing property.
type font_kerning = Properties.font_kerning = | Auto| Normal| None| Inherit| Initial| Unset| Revert| Revert_layer| Var of font_kerning varfont_kerning kerning is the font-kerning property.
type font_language_override = Properties.font_language_override = | Normal| String of string| Inherit| Initial| Unset| Revert| Revert_layer| Var of font_language_override varfont_language_override override is the font-language-override property.
type font_synthesis_style = Properties.font_synthesis_style = | Auto| None| Oblique_only| Inherit| Initial| Unset| Revert| Revert_layer| Var of font_synthesis_style varfont_synthesis_style style is the font-synthesis-style property.
type font_synthesis_weight = Properties.font_synthesis_weight = | Auto| None| Inherit| Initial| Unset| Revert| Revert_layer| Var of font_synthesis_weight varfont_synthesis_weight weight is the font-synthesis-weight property.
type font_synthesis_small_caps = Properties.font_synthesis_small_caps = | Auto| None| Inherit| Initial| Unset| Revert| Revert_layer| Var of font_synthesis_small_caps varfont_synthesis_small_caps small_caps is the font-synthesis-small-caps property.
type font_synthesis_position = Properties.font_synthesis_position = | Auto| None| Inherit| Initial| Unset| Revert| Revert_layer| Var of font_synthesis_position varfont_synthesis_position position is the font-synthesis-position property.
type font_variant_ligature = Properties.font_variant_ligature = type font_variant_ligatures = Properties.font_variant_ligatures = | Normal| None| Ligatures of font_variant_ligature list| Inherit| Initial| Unset| Revert| Revert_layer| Var of font_variant_ligatures varfont_variant_ligatures ligatures is the font-variant-ligatures property.
type font_variant_caps = Properties.font_variant_caps = | Normal| Small_caps| All_small_caps| Petite_caps| All_petite_caps| Unicase| Titling_caps| Inherit| Initial| Unset| Revert| Revert_layer| Var of font_variant_caps varfont_variant_caps caps is the font-variant-caps property.
type font_variant_position = Properties.font_variant_position = | Normal| Sub| Super| Inherit| Initial| Unset| Revert| Revert_layer| Var of font_variant_position varfont_variant_position position is the font-variant-position property.
type east_asian_feature = Properties.east_asian_feature = type font_variant_east_asian = Properties.font_variant_east_asian = | Normal| Features of east_asian_feature list| Inherit| Initial| Unset| Revert| Revert_layer| Var of font_variant_east_asian varfont_variant_east_asian east_asian is the font-variant-east-asian property.
type font_size_adjust_metric = Properties.font_size_adjust_metric = CSS font-size-adjust metric keywords
type font_size_adjust = Properties.font_size_adjust = | None| Number of float| Calc of font_size_adjust calc| From_font| Metric_number of font_size_adjust_metric * float| Metric_from_font of font_size_adjust_metric| Inherit| Initial| Unset| Revert| Revert_layer| Var of font_size_adjust varCSS font-size-adjust values
type font_variant_emoji = Properties.font_variant_emoji = | Normal| Text| Emoji| Unicode| Inherit| Initial| Unset| Revert| Revert_layer| Var of font_variant_emoji varCSS font-variant-emoji values
type font_variant_numeric_token = Properties.font_variant_numeric_token = | NormalReset to normal font variant
*)| Lining_nums| Oldstyle_nums| Proportional_nums| Tabular_nums| Diagonal_fractions| Stacked_fractions| Ordinal| Slashed_zero| Var of font_variant_numeric_token varCSS font-variant-numeric values
*)CSS font-variant-numeric token values
type font_variant_numeric = Properties.font_variant_numeric = | Normal| Inherit| Initial| Unset| Revert| Revert_layer| Tokens of font_variant_numeric_token list| Composed of {ordinal : font_variant_numeric_token option;slashed_zero : font_variant_numeric_token option;numeric_figure : font_variant_numeric_token option;numeric_spacing : font_variant_numeric_token option;numeric_fraction : font_variant_numeric_token option;}| Var of font_variant_numeric varfont_variant_numeric numeric is the font-variant-numeric property using a list of tokens or a composed value.
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_numericfont_variant_numeric_composed ... is a composed font-variant-numeric value using CSS variables for style composition.
font_feature_settings settings is the font-feature-settings property.
type shadow_body = Properties.shadow_body = {h_offset : length;v_offset : length;blur : length option;spread : length option;color : color option;}CSS shadow values
The <length>{2,4} && <color>? part of a single <shadow>.
and inset = Properties.inset = | Var of shadow varinset var(--x): the whole body from one var.
| Body of shadow_bodyinset 2px 4px red: a concrete inset body.
| Toggle of {name : string;no_fallback : bool;body : shadow_body;}var(--name) <body>: a dynamic inset toggle (Tailwind's ring system).
and shadow = Properties.shadow = | Shadow of shadow_bodyA non-inset shadow.
*)| Inset of insetAn inset shadow.
*)| None| Inherit| Initial| Unset| Revert| Revert_layer| List of shadow list| Var of shadow varval shadow :
?inset:bool ->
?inset_var:string ->
?inset_var_no_fallback:bool ->
?h_offset:length ->
?v_offset:length ->
?blur:length ->
?spread:length ->
?color:color ->
unit ->
shadowshadow ?inset ?inset_var ?inset_var_no_fallback ?h_offset ?v_offset ?blur ?spread ?color () is a shadow value with optional parameters. When inset_var is set, outputs var(--<name>,) (with empty fallback) or var(--<name>) (no fallback, when inset_var_no_fallback is true) before the shadow values. Used by Tailwind's ring system. Defaults: inset=false, inset_var=None, inset_var_no_fallback=false, h_offset=0px, v_offset=0px, blur=0px, spread=0px, color=Transparent.
type text_shadow = Properties.text_shadow = CSS text-shadow values
text_shadow_value ?blur ?color x y is a single text-shadow value.
text_shadow shadow is the text-shadow property.
text_shadows shadows is the text-shadow property with multiple shadows.
font spec is the font shorthand property.
type direction = Properties.direction = CSS direction values
direction dir is the direction property.
type unicode_bidi = Properties.unicode_bidi = | Normal| Embed| Isolate| Bidi_override| Isolate_override| Plaintext| Inherit| Initial| Unset| Revert| Revert_layer| Var of unicode_bidi varCSS unicode-bidi values
unicode_bidi bidi is the unicode-bidi property.
type writing_mode = Properties.writing_mode = | Horizontal_tb| Vertical_rl| Vertical_lr| Sideways_lr| Sideways_rl| Inherit| Initial| Unset| Revert| Revert_layer| Var of writing_mode varCSS writing-mode values
type text_combine_upright = Properties.text_combine_upright = | None| All| Digits of int option| Inherit| Initial| Unset| Revert| Revert_layer| Var of text_combine_upright varwriting_mode mode is the writing-mode property.
text_combine_upright value is the CSS text-combine-upright property.
text_decoration_thickness thick is the text-decoration-thickness property.
type text_decoration_skip_ink = Properties.text_decoration_skip_ink = | Auto| None| All| Inherit| Initial| Unset| Revert| Revert_layer| Var of text_decoration_skip_ink varCSS text-decoration-skip-ink values
text_decoration_skip_ink skip is the text-decoration-skip-ink property.
type text_decoration_skip = Properties.text_decoration_skip = | None| Auto| Inherit| Initial| Unset| Revert| Revert_layer| Var of text_decoration_skip varCSS Text Decoration 4 text-decoration-skip: the shorthand over the four longhands below.
text_decoration_skip v is the text-decoration-skip shorthand.
type text_decoration_skip_self = Properties.text_decoration_skip_self = | None| Objects| Inherit| Initial| Unset| Revert| Revert_layer| Var of text_decoration_skip_self varSec. 2.5.1 text-decoration-skip-self: whether the box's own decoration skips it.
text_decoration_skip_self v is the text-decoration-skip-self property.
type text_decoration_skip_box = Properties.text_decoration_skip_box = | All| None| Inherit| Initial| Unset| Revert| Revert_layer| Var of text_decoration_skip_box varSec. 2.5.2 text-decoration-skip-box: whether an ancestor's decoration skips the box's edges.
text_decoration_skip_box v is the text-decoration-skip-box property.
type text_decoration_skip_inset = Properties.text_decoration_skip_inset = | None| Auto| Inherit| Initial| Unset| Revert| Revert_layer| Var of text_decoration_skip_inset varSec. 2.5.3 text-decoration-skip-inset: whether the decoration is inset from the glyph edges.
text_decoration_skip_inset v is the text-decoration-skip-inset property.
Sec. 2.5.4: one span of spaces a decoration skips.
type text_decoration_skip_spaces = Properties.text_decoration_skip_spaces = | Spaces of text_decoration_skip_space list| Inherit| Initial| Unset| Revert| Revert_layer| Var of text_decoration_skip_spaces varSec. 2.5.4 text-decoration-skip-spaces.
text_decoration_skip_spaces v is the text-decoration-skip-spaces property.
type text_emphasis_skip_keyword = Properties.text_emphasis_skip_keyword = One class of character the emphasis marks skip, for CSS Text Decoration 4 text-emphasis-skip.
type text_emphasis_skip = Properties.text_emphasis_skip = | Skip of text_emphasis_skip_keyword list| Inherit| Initial| Unset| Revert| Revert_layer| Var of text_emphasis_skip varSec. 4.3 text-emphasis-skip.
text_emphasis_skip v is the text-emphasis-skip property.
type white_space_collapse = Properties.white_space_collapse = | Collapse| Discard| Preserve| Preserve_breaks| Preserve_spaces| Break_spaces| Inherit| Initial| Unset| Revert| Revert_layer| Var of white_space_collapse varCSS Text 4 white-space-collapse: how white space and line breaks collapse.
white_space_collapse v is the white-space-collapse property.
line_height_step v is the line-height-step property.
type font_palette = Properties.font_palette = | Normal| Light| Dark| Palette of string| Initial| Inherit| Unset| Revert| Revert_layer| Var of font_palette varCSS Fonts 4 font-palette.
font_palette v is the font-palette property.
type font_synthesis_feature = Properties.font_synthesis_feature = One face the browser may synthesise, for CSS Fonts 4 font-synthesis.
type font_synthesis = Properties.font_synthesis = | None| Features of font_synthesis_feature list| Initial| Inherit| Unset| Revert| Revert_layer| Var of font_synthesis varCSS Fonts 4 font-synthesis.
font_synthesis v is the font-synthesis shorthand.
font_size_adjust v is the font-size-adjust property.
font_variant_emoji v is the font-variant-emoji property.
type font_variant_alternates_item = Properties.font_variant_alternates_item = One feature of CSS Fonts 4 font-variant-alternates.
type font_variant_alternates = Properties.font_variant_alternates = | Normal| Alternates of font_variant_alternates_item list| Inherit| Initial| Unset| Revert| Revert_layer| Var of font_variant_alternates varCSS Fonts 4 font-variant-alternates.
font_variant_alternates v is the font-variant-alternates property.
type font_variant_shorthand = Properties.font_variant_shorthand = {ligatures : font_variant_ligature list;alternates : font_variant_alternates_item list;caps : font_variant_caps option;numeric : font_variant_numeric_token list;east_asian : east_asian_feature list;position : font_variant_position option;emoji : font_variant_emoji option;}The slots of the CSS Fonts 4 font-variant shorthand.
type font_variant = Properties.font_variant = | Normal| None| Shorthand of font_variant_shorthand| Inherit| Initial| Unset| Revert| Revert_layer| Var of font_variant varCSS Fonts 4 font-variant.
font_variant v is the font-variant shorthand.
text_wrap_style v is the text-wrap-style property.
text_box_trim v is the text-box-trim property.
type text_box = Properties.text_box = | Normal| Box of text_box_trim option * text_box_edge option| Inherit| Initial| Unset| Revert| Revert_layer| Var of text_box varCSS Inline 3 text-box: normal | <'text-box-trim'> || <'text-box-edge'>.
text_box v is the text-box shorthand.
text_spacing_trim v is the text-spacing-trim property.
hyphenate_limit_chars v is the hyphenate-limit-chars property.
initial_letter v is the initial-letter property.
type initial_letter_align_keyword = Properties.initial_letter_align_keyword = One alignment point of CSS Inline 3 initial-letter-align.
type initial_letter_align = Properties.initial_letter_align = | Align of initial_letter_align_keyword list| Inherit| Initial| Unset| Revert| Revert_layer| Var of initial_letter_align varCSS Inline 3 initial-letter-align.
initial_letter_align v is the initial-letter-align property.
type initial_letter_wrap = Properties.initial_letter_wrap = | None| First| All| Grid| Length of length_percentage| Inherit| Initial| Unset| Revert| Revert_layer| Var of initial_letter_wrap varCSS Inline 3 initial-letter-wrap.
initial_letter_wrap v is the initial-letter-wrap property.
type shape_image_threshold = Properties.shape_image_threshold = | Number of float| Calc of shape_image_threshold calc| Inherit| Initial| Unset| Revert| Revert_layer| Var of shape_image_threshold varCSS Shapes 1 shape-image-threshold: the alpha above which a pixel of the shape image is inside the shape.
shape_image_threshold v is the shape-image-threshold property.
shape_margin v is the shape-margin property.
shape_outside v is the shape-outside property, held as the authored text of its shape.
CSS Box 4 <visual-box>: the box edge an overflow clip margin is measured from.
type overflow_clip_margin = Properties.overflow_clip_margin = | Clip_margin of overflow_clip_box option * length option| Initial| Inherit| Unset| Revert| Revert_layer| Var of overflow_clip_margin varCSS Overflow 4 overflow-clip-margin: <visual-box> || <length>.
overflow_clip_margin v is the overflow-clip-margin property.
type overflow_anchor = Properties.overflow_anchor = | Auto| None| Initial| Inherit| Unset| Revert| Revert_layer| Var of overflow_anchor varCSS Scroll Anchoring 1 overflow-anchor.
overflow_anchor v is the overflow-anchor property.
overflow_block v is the overflow-block property.
overflow_inline v is the overflow-inline property.
type image_orientation = Properties.image_orientation = | None| From_image| Initial| Inherit| Unset| Revert| Revert_layer| Var of image_orientation varCSS Images 3 image-orientation.
image_orientation v is the image-orientation property.
type image_rendering = Properties.image_rendering = | Auto| Smooth| High_quality| Crisp_edges| Pixelated| Initial| Inherit| Unset| Revert| Revert_layer| Var of image_rendering varCSS Images 3 image-rendering.
image_rendering v is the image-rendering property.
CSS Values 4 <resolution>.
type image_resolution = Properties.image_resolution = | Resolution of resolution| From_image| From_image_resolution of resolution| Snap of resolution| From_image_snap| From_image_snap_resolution of resolution| Initial| Inherit| Unset| Revert| Revert_layer| Var of image_resolution varCSS Images 4 image-resolution: [ from-image || <resolution> ] && snap?.
image_resolution v is the image-resolution property.
One axis whose margins CSS Box 4 margin-trim trims.
type margin_trim_edge = Properties.margin_trim_edge = One edge whose margin CSS Box 4 margin-trim trims.
type margin_trim = Properties.margin_trim = | None| Block| Inline| Axes of margin_trim_axis list| Edges of margin_trim_edge list| Initial| Inherit| Unset| Revert| Revert_layer| Var of margin_trim varCSS Box 4 margin-trim.
margin_trim v is the margin-trim property.
type overlay = Properties.overlay = CSS Positioned Layout 4 overlay: whether the box is in the top layer.
overlay v is the overlay property.
type animation_composition_item = Properties.animation_composition_item = How one animation composes with the value beneath it, for CSS Animations 2 animation-composition.
type animation_composition = Properties.animation_composition = | Compositions of animation_composition_item list| Initial| Inherit| Unset| Revert| Revert_layer| Var of animation_composition varCSS Animations 2 animation-composition.
animation_composition v is the animation-composition property.
One physical edge a <position> offsets from, for CSS Backgrounds 4 background-position-x.
type background_position_axis = Properties.background_position_axis = | Center| Edge of position_axis_edge| Offset of length_percentage| Edge_offset of position_axis_edge * length_percentage| Layers of background_position_axis listCSS Backgrounds 4 sec. 3.6 spells the axis longhand with the same # the pair carries, so it names one position per background layer.
| Inherit| Initial| Unset| Revert| Revert_layer| Var of background_position_axis varOne axis of CSS Backgrounds 4 background-position-x.
background_position_x v is the background-position-x property.
background_position_y v is the background-position-y property.
webkit_mask_position_x v is the -webkit-mask-position-x property.
webkit_mask_position_y v is the -webkit-mask-position-y property.
moz_orient v is the -moz-orient property.
type webkit_text_stroke = Properties.webkit_text_stroke = {width : border_width option;color : color option;}-webkit-text-stroke: a width and a colour, either of which may be absent. No CSS specification defines it.
webkit_text_stroke v is the -webkit-text-stroke shorthand.
page_size v is the size descriptor of an @page rule.
grid v is the grid shorthand.
Properties for styling element borders, outlines, and related decorative features including border radius for rounded corners.
type border_style = Properties.border_style = | None| Solid| Dashed| Dotted| Double| Groove| Ridge| Inset| Outset| Hidden| Inherit| Initial| Unset| Revert| Revert_layer| Var of border_style varCSS border style values.
type border_shorthand = Properties.border_shorthand = {width : border_width option;style : border_style option;color : color option;}CSS border shorthand type.
type border = Properties.border = | Inherit| Initial| Unset| Revert| Revert_layer| None| Shorthand of border_shorthand| Var of border varCSS border property values.
type logical_border_color = Properties.logical_border_color = | Single of color| Pair of color * color| Inherit| Initial| Unset| Revert| Revert_layer| Var of logical_border_color varlogical_border_color color is a one-value logical border color.
logical_border_colors start end_ is a two-value logical border color.
type logical_border_width = Properties.logical_border_width = | Single of border_width| Pair of border_width * border_width| Inherit| Initial| Unset| Revert| Revert_layer| Var of logical_border_width varlogical_border_width w is a one-value logical border width.
logical_border_widths start end_ is a two-value logical border width.
type logical_border_style = Properties.logical_border_style = | Single of border_style| Pair of border_style * border_style| Inherit| Initial| Unset| Revert| Revert_layer| Var of logical_border_style varlogical_border_style s is a one-value logical border style.
logical_border_styles start end_ is a two-value logical border style.
type outline_style = Properties.outline_style = | None| Solid| Dashed| Dotted| Double| Groove| Ridge| Inset| Outset| Auto| Inherit| Initial| Unset| Revert| Revert_layer| Var of outline_style varCSS outline style values.
type outline_shorthand = Properties.outline_shorthand = {width : border_width option;style : outline_style option;color : color option;}CSS outline shorthand components.
type outline = Properties.outline = | Inherit| Initial| Unset| Revert| Revert_layer| None| Shorthand of outline_shorthand| Var of outline varCSS outline property values.
val outline_shorthand :
?width:border_width ->
?style:outline_style ->
?color:color ->
unit ->
outlineoutline_shorthand ?width ?style ?color () is the outline shorthand.
val border_shorthand :
?width:border_width ->
?style:border_style ->
?color:color ->
unit ->
borderborder_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 ->
declarationborder border is the border shorthand property.
column_rule v is the column-rule shorthand property.
CSS Gaps 1 gives each gap decoration longhand a comma-separated list, one entry per rule line, where column_rule writes one.
CSS Logical 1 gives the flow-relative borders the same shorthand shape the physical ones have.
border_block_start v is the border-block-start shorthand.
border_block_end v is the border-block-end shorthand.
border_inline v is the border-inline shorthand.
border_inline_start v is the border-inline-start shorthand.
border_inline_end v is the border-inline-end shorthand.
column_rule_width v is the column-rule-width longhand, one entry per gap decoration line.
column_rule_style v is the column-rule-style longhand, one entry per gap decoration line.
column_rule_color v is the column-rule-color longhand, one entry per gap decoration line.
type border_image_slice_item = Properties.border_image_slice_item = | Number of number| Pct of float| Calc of border_image_slice_item calcOne offset of CSS Backgrounds 3 border-image-slice, a number in units of the image's own pixels or a percentage of its size.
type border_image_slice_offsets = Properties.border_image_slice_offsets = {offsets : border_image_slice_item list;fill : bool;}Sec. 5.2: the one to four offsets and the fill keyword.
type border_image_slice = Properties.border_image_slice = | Slices of border_image_slice_offsets| Inherit| Initial| Unset| Revert| Revert_layer| Var of border_image_slice varSec. 5.2 border-image-slice.
border_image_slice v is the border-image-slice property.
type border_image_width_item = Properties.border_image_width_item = Sec. 5.3: one border-image-width, which unlike a border width takes a bare number as a multiple of the border width.
type border_image_width = Properties.border_image_width = | Widths of border_image_width_item list| Inherit| Initial| Unset| Revert| Revert_layer| Var of border_image_width varSec. 5.3 border-image-width.
border_image_width v is the border-image-width property.
type border_image_outset_item = Properties.border_image_outset_item = Sec. 5.4: one border-image-outset, a number or a length.
type border_image_outset = Properties.border_image_outset = | Outsets of border_image_outset_item list| Inherit| Initial| Unset| Revert| Revert_layer| Var of border_image_outset varSec. 5.4 border-image-outset.
border_image_outset v is the border-image-outset property.
type border_image_repeat_keyword = Properties.border_image_repeat_keyword = Sec. 5.5: how the middle of an edge is filled.
type border_image_repeat = Properties.border_image_repeat = | Repeats of border_image_repeat_keyword list| Inherit| Initial| Unset| Revert| Revert_layer| Var of border_image_repeat varSec. 5.5 border-image-repeat: the block edge then the inline edge.
border_image_repeat v is the border-image-repeat property.
border_image_source v is the border-image-source property.
CSS Masking 1 mask-border-mode: which channel of the source image is the mask.
type border_image = Properties.border_image = {source : background_image option;slice : border_image_slice_offsets option;width : border_image_width_item list option;outset : border_image_outset_item list option;repeat : border_image_repeat_keyword list option;mode : mask_border_mode option;}CSS Backgrounds 3 border-image and CSS Masking 1 mask-border, which share every slot but the mode only the mask carries.
border_image v is the border-image shorthand.
mask_border v is the mask-border shorthand, which takes what border-image takes plus the mode slot.
border_width width is the border-width property.
border_style style is the border-style property.
border_color color is the border-color property.
border_block v is the border-block shorthand property.
border_inline_color v is the border-inline-color property.
border_block_color v is the border-block-color property.
border_inline_width v is the border-inline-width property.
border_block_width v is the border-block-width property.
border_radius v is the border-radius property; takes a typed value with 1-4 horizontal radii and optional 1-4 vertical radii separated by val-/.
border_top_left_radius radius is the border-top-left-radius property.
border_top_right_radius radius is the border-top-right-radius property.
border_bottom_left_radius radius is the border-bottom-left-radius property.
border_bottom_right_radius radius is the border-bottom-right-radius property.
border_top border is the border-top property.
border_right border is the border-right property.
border_bottom border is the border-bottom property.
border_left border is the border-left property.
outline outline is the outline property.
outline_width width is the outline-width property.
outline_style style is the outline-style property.
outline_color color is the outline-color property.
outline_offset offset is the outline-offset property.
border_top_style s is the border-top-style property.
border_right_style s is the border-right-style property.
border_bottom_style s is the border-bottom-style property.
border_left_style s is the border-left-style property.
border_inline_style s is the border-inline-style property.
border_block_style s is the border-block-style property.
border_inline_start_style s is the border-inline-start-style property.
border_inline_end_style s is the border-inline-end-style property.
border_block_start_style s is the border-block-start-style property.
border_block_end_style s is the border-block-end-style property.
border_start_start_radius len is the border-start-start-radius property.
border_start_end_radius len is the border-start-end-radius property.
border_end_start_radius len is the border-end-start-radius property.
border_end_end_radius len is the border-end-end-radius property.
border_left_width len is the border-left-width property.
border_top_width len is the border-top-width property.
border_right_width len is the border-right-width property.
border_bottom_width len is the border-bottom-width property.
border_top_color c is the border-top-color property.
border_right_color c is the border-right-color property.
border_bottom_color c is the border-bottom-color property.
border_left_color c is the border-left-color property.
type border_collapse = Properties.border_collapse = | Collapse| Separate| Inherit| Initial| Unset| Revert| Revert_layer| Var of border_collapse varCSS border-collapse values
border_collapse value is the border-collapse property.
Properties for 2D/3D transformations, CSS animations, and transitions. Based on multiple CSS specification modules for comprehensive animation support.
type transform = Properties.transform = | Translate of length * length option| Translate_x of length| Translate_y of length| Translate_z of length| Translate_3d of length * length * length| Rotate of angle| Rotate_x of angle| Rotate_y of angle| Rotate_z of angle| Rotate_3d of float * float * float * angle| Rotate_axis of float * float * float * angle| Scale of number_percentage * number_percentage option| Scale_space of number_percentage * number_percentage| Scale_x of number_percentage| Scale_y of number_percentage| Scale_z of number_percentage| Scale_3d of number_percentage * number_percentage * number_percentage| Skew of angle * angle option| Skew_x of angle| Skew_y of angle| Matrix of float * float * float * float * float * float| Matrix_3d of float
* float
* float
* float
* float
* float
* float
* float
* float
* float
* float
* float
* float
* float
* float
* float| Perspective of length| None| Inherit| Initial| Unset| Revert| Revert_layer| List of transform list| Var of transform varCSS transform values
transform_list items is a multi-function transform value.
transform t is the transform property with a single transformation.
transforms ts is the transform property with multiple transformations.
type transform_origin = Properties.transform_origin = | Center| Center_center| Left| Right| Top| Bottom| Left_top| Left_center| Left_bottom| Right_top| Right_center| Right_bottom| Center_top| Center_bottom| Top_left| Top_right| Bottom_left| Bottom_right| Position of position_value| X of lengthSingle x-offset, y defaults to 50%.
*)| XY of length * length| XYZ of length * length * length| Position_z of position_value * length| Initial| InheritTransform origin (2D or 3D).
*)| Unset| Revert| Revert_layer| Var of transform_origin varval origin : length -> length -> transform_originorigin x y is a transform-origin helper for 2D positions.
val origin3d : length -> length -> length -> transform_originorigin3d x y z is a transform-origin helper for 3D positions.
transform_origin origin is the transform-origin property.
type transform_box = Properties.transform_box = | Content_box| Border_box| Fill_box| Stroke_box| View_box| Initial| Inherit| Unset| Revert| Revert_layer| Var of transform_box varCSS transform-box property values
transform_box value is the transform-box property.
type rotate_value = Properties.rotate_value = CSS rotate property values
rotate v is the rotate property.
perspective perspective is the perspective property (3D transforms).
type perspective_origin = position_valueCSS perspective-origin values for 3D transforms.
perspective_origin origin is the perspective-origin property.
type transform_style = Properties.transform_style = | Flat| Preserve_3d| Initial| Inherit| Unset| Revert| Revert_layer| Var of transform_style varCSS transform-style values
transform_style style is the transform-style property (3D transforms).
type steps_direction = Properties.steps_direction = | Jump_start| Jump_end| Jump_none| Jump_both| Start| End| Var of steps_direction varCSS steps direction values.
type timing_function = Properties.timing_function = | Ease| Linear| Ease_in| Ease_out| Ease_in_out| Step_start| Step_end| Steps of int * steps_direction option| Cubic_bezier of float * float * float * float| Linear_function of string| Timing_functions of timing_function list| Inherit| Initial| Unset| Revert| Revert_layer| Var of timing_function varCSS animation timing function values.
type duration = Values.duration = | Ms of floatmilliseconds
*)| S of floatseconds
*)| Autoanimation-duration only
| Durations of duration listcomma-separated list of durations
*)| Round of string * duration * duration| Mod of duration * duration| Rem of duration * duration| Inherit| Initial| Unset| Revert| Revert_layer| Var of duration varCSS variable reference
*)| Calc of duration calcCSS duration values.
type transition_property_value = Properties.transition_property_value = | All| None| Property of string| Initial| Inherit| Unset| Revert| Revert_layer| Var of transition_property_value varCSS transition property value.
type transition_property = transition_property_value listCSS transition property (list of property values).
type transition_behavior = Properties.transition_behavior = | Normal| Allow_discrete| Behaviors of transition_behavior listThe <transition-behavior-value># list of two or more behaviours.
| Inherit| Initial| Unset| Revert| Revert_layer| Var of transition_behavior varCSS transition-behavior values (Transitions Level 2).
type transition_shorthand = Properties.transition_shorthand = {property : transition_property_value;duration : duration option;timing_function : timing_function option;delay : duration option;behavior : transition_behavior option;}CSS transition shorthand values.
type transition = Properties.transition = | Inherit| Initial| Unset| Revert| Revert_layer| None| Shorthand of transition_shorthandCSS transition values.
*)| Var of transition varval transition_shorthand :
?property:transition_property_value ->
?duration:duration ->
?timing_function:timing_function ->
?delay:duration ->
?behavior:transition_behavior ->
unit ->
transitiontransition_shorthand ?property ?duration ?timing_function ?delay ?behavior () is the transition shorthand.
property: CSS property to transition (defaults to All)duration: transition durationtiming_function: easing function (ease, linear, ease-in, etc.)delay: delay before transition startsbehavior: transition-behavior (Transitions Level 2).transition transition is the transition property.
transitions values is the transition property from a comma-separated list.
transition_timing_function tf is the transition-timing-function property.
transition_duration dur is the transition-duration property.
transition_delay delay is the transition-delay property.
transition_property v is the transition-property property.
transition_behavior v is the transition-behavior property.
type animation_fill_mode = Properties.animation_fill_mode = | None| Forwards| Backwards| Both| Fill_modes of animation_fill_mode list| Initial| Inherit| Unset| Revert| Revert_layer| Var of animation_fill_mode varCSS animation fill mode values
type animation_direction = Properties.animation_direction = | Normal| Reverse| Alternate| Alternate_reverse| Directions of animation_direction list| Initial| Inherit| Unset| Revert| Revert_layer| Var of animation_direction varCSS animation direction values
type animation_play_state = Properties.animation_play_state = | Running| Paused| States of animation_play_state list| Initial| Inherit| Unset| Revert| Revert_layer| Var of animation_play_state varCSS animation play state values
type animation_iteration_count = Properties.animation_iteration_count = | Count of number| Infinite| Counts of animation_iteration_count list| Initial| Inherit| Unset| Revert| Revert_layer| Var of animation_iteration_count varCSS animation iteration count values
type animation_name = Properties.animation_name = | None| Name of string| Ambiguous of string| Quoted of string| Names of animation_name list| Initial| Inherit| Unset| Revert| Revert_layer| Var of animation_name vartype animation_shorthand = Properties.animation_shorthand = {name : animation_name option;duration : duration option;timing_function : timing_function option;delay : duration option;iteration_count : animation_iteration_count option;direction : animation_direction option;fill_mode : animation_fill_mode option;play_state : animation_play_state option;timeline : animation_timeline option;}CSS animation shorthand values
and animation_timeline = Properties.animation_timeline = | None| Auto| Name of string| Scroll of string| View of string| Timelines of animation_timeline list| Initial| Inherit| Unset| Revert| Revert_layer| Var of animation_timeline vartype animation = Properties.animation = | Inherit| Initial| None| Shorthand of animation_shorthand| Var of animation varval animation_shorthand :
?name:string ->
?duration:duration ->
?timing_function:timing_function ->
?delay:duration ->
?iteration_count:animation_iteration_count ->
?direction:animation_direction ->
?fill_mode:animation_fill_mode ->
?play_state:animation_play_state ->
?timeline:animation_timeline ->
unit ->
animationanimation_shorthand ?name ?duration ?timing_function ?delay ?iteration_count ?direction ?fill_mode ?play_state ?timeline () is the animation shorthand.
name: animation nameduration: animation durationtiming_function: easing functiondelay: delay before animation startsiteration_count: number of iterations (or Infinite)direction: animation direction (normal, reverse, alternate, etc.)fill_mode: how styles apply before/after animationplay_state: running or pausedtimeline: animation timeline.animation props is the animation shorthand property.
animation_name name is the animation-name property.
animation_duration dur is the animation-duration property.
animation_timing_function tf is the animation-timing-function property.
animation_delay delay is the animation-delay property.
animation_iteration_count count is the animation-iteration-count property.
animation_direction dir is the animation-direction property.
animation_fill_mode mode is the animation-fill-mode property.
animation_play_state state is the animation-play-state property.
Properties for visual effects including shadows, filters, clipping, and other advanced rendering features.
box_shadow shadow is the box-shadow property.
box_shadows values is the box-shadow property. Raises Invalid_argument when values is empty.
type scale = Properties.scale = | X of number_percentage| XY of number_percentage * number_percentage| XYZ of number_percentage * number_percentage * number_percentage| None| Inherit| Initial| Unset| Revert| Revert_layer| Var of scale varCSS scale property values
scale scale is the scale property.
type translate_value = Properties.translate_value = translate v is the translate property.
type filter_function = Properties.filter_function = Filter functions with an optional argument.
type filter = Properties.filter = | NoneNo filter
*)| Omitted of filter_functionFunction with its argument omitted.
*)| Blur of lengthblur(px)
*)| Brightness of number_percentagebrightness(%)
*)| Contrast of number_percentagecontrast(%)
*)| Drop_shadow of shadowdrop-shadow(...)
*)| Grayscale of number_percentagegrayscale(%)
*)| Hue_rotate of anglehue-rotate(deg)
*)| Invert of number_percentageinvert(%)
*)| Opacity of number_percentageopacity(%)
*)| Saturate of number_percentagesaturate(%)
*)| Sepia of number_percentagesepia(%)
*)| Url of stringurl(...)
*)| List of filter listMultiple filters
*)| Inherit| Initial| Unset| Revert| Revert_layer| Var of filter varCSS filter values
filter values is the filter property.
filter_var_empty name creates a filter var reference with empty fallback, i.e., var(--name, ). Used for composable filter utilities.
background_image_var_none name creates a background_image var reference with no fallback, i.e., var(--name). Used for mask gradient utilities.
minify_color c shortens hex colors (e.g., #0088cc to #08c) and converts named colors to shorter hex equivalents when possible.
val minify_background_image : background_image -> background_imageminify_background_image img converts named colors in gradient stops to their shortest hex form, matching Lightning CSS behavior.
backdrop_filter values is the backdrop-filter property.
webkit_backdrop_filter values is the -webkit-backdrop-filter property.
type clip = Properties.clip = CSS clip property values (deprecated, but needed for sr-only).
type clip_geometry_box = Properties.clip_geometry_box = type clip_path_extent = Properties.clip_path_extent = | Extent_length of length| Closest_side| Farthest_sidetype clip_path = Properties.clip_path = | Clip_path_none| Clip_path_url of string| Clip_path_inset of {top : length_percentage;right : length_percentage option;bottom : length_percentage option;left : length_percentage option;rounded : border_radius option;}| Clip_path_circle of {radius : clip_path_extent option;position : position_value option;}| Clip_path_ellipse of {rx : clip_path_extent option;ry : clip_path_extent option;position : position_value option;}| Clip_path_polygon of {fill_rule : clip_path_fill_rule option;points : (length * length) list;spaced : bool;}| Clip_path_path of string| Clip_path_shape of string| Clip_path_box of clip_geometry_box| Clip_path_with_box of {shape : clip_path;box : clip_geometry_box;box_first : bool;}| Clip_path_xywh of {x : length_percentage;y : length_percentage;width : length_percentage;height : length_percentage;rounded : border_radius option;}xywh(<length-percentage>{4} [round <border-radius>]?) - CSS Shapes 2.
| Clip_path_rect of {top : length_percentage;right : length_percentage;bottom : length_percentage;left : length_percentage;rounded : border_radius option;}rect(<length-percentage>{4} [round <border-radius>]?) - CSS Shapes 2.
| Inherit| Initial| Unset| Revert| Revert_layer| Var of clip_path var| Invalid of invalid_valueSpec-invalid <basic-shape> preserved verbatim.
CSS clip-path property values for clipping regions.
clip clip is the clip property (deprecated).
clip_path path is the clip-path property.
mask mask is the mask property.
webkit_mask_image img is the -webkit-mask-image property.
mask_image img is the mask-image property.
webkit_mask_composite v is the -webkit-mask-composite property.
mask_composite v is the mask-composite property.
webkit_mask_source_type v is the -webkit-mask-source-type property.
mask_mode v is the mask-mode property.
mask_type v is the mask-type property.
webkit_mask_size v is the -webkit-mask-size property.
mask_size v is the mask-size property.
webkit_mask_position v is the -webkit-mask-position property.
mask_position v is the mask-position property.
webkit_mask_repeat v is the -webkit-mask-repeat property.
mask_repeat v is the mask-repeat property.
webkit_mask_clip v is the -webkit-mask-clip property.
mask_clip v is the mask-clip property.
webkit_mask_origin v is the -webkit-mask-origin property.
mask_origin v is the mask-origin property.
mix_blend_mode mode is the mix-blend-mode property.
background_blend_mode values is the background-blend-mode property.
Properties that affect user interaction with elements including cursor appearance, user selection behavior, and pointer events.
type cursor = Properties.cursor = | Auto| Default| None| Help| Pointer| Progress| Wait| Cell| Crosshair| Text| Vertical_text| Alias| Copy| Move| No_drop| Not_allowed| Grab| Grabbing| E_resize| N_resize| Ne_resize| Nw_resize| S_resize| Se_resize| Sw_resize| W_resize| Ew_resize| Ns_resize| Nesw_resize| Nwse_resize| Col_resize| Row_resize| All_scroll| Zoom_in| Zoom_out| Url of string * (float * float) option * cursor| Inherit| Initial| Unset| Revert| Revert_layer| Var of cursor varCSS cursor values.
cursor_url ?hotspot ~fallback url is a URL cursor with its required fallback.
type user_select = Properties.user_select = | None| Auto| Text| All| Contain| Inherit| Initial| Unset| Revert| Revert_layer| Var of user_select varCSS user-select values.
type resize = Properties.resize = CSS resize values.
type print_color_adjust = Properties.print_color_adjust = | Economy| Exact| Initial| Inherit| Unset| Revert| Revert_layer| Var of print_color_adjust varCSS print-color-adjust values.
cursor cursor is the cursor property.
type interactivity = Properties.interactivity = | Auto| Inert| Inherit| Initial| Unset| Revert| Revert_layer| Var of interactivity varinteractivity interactivity is the CSS interactivity property.
type caret_animation = Properties.caret_animation = | Auto| Manual| Inherit| Initial| Unset| Revert| Revert_layer| Var of caret_animation varcaret_animation animation is the CSS caret-animation property.
type caret_shape = Properties.caret_shape = | Auto| Bar| Block| Underscore| Inherit| Initial| Unset| Revert| Revert_layer| Var of caret_shape varcaret_shape shape is the CSS caret-shape property.
type caret = Properties.caret = | Auto| Caret of color option * caret_animation option * caret_shape option| Inherit| Initial| Unset| Revert| Revert_layer| Var of caret varcaret caret is the CSS caret property.
type interest_delay = Properties.interest_delay = | Delays of interest_delay_item list| Inherit| Initial| Unset| Revert| Revert_layer| Var of interest_delay varinterest_delay delay is the CSS interest-delay property.
interest_delay_start delay is the CSS interest-delay-start property.
interest_delay_end delay is the CSS interest-delay-end property.
nav_up nav is the CSS nav-up property.
nav_right nav is the CSS nav-right property.
nav_down nav is the CSS nav-down property.
nav_left nav is the CSS nav-left property.
type pointer_events = Properties.pointer_events = | Auto| None| Visible_painted| Visible_fill| Visible_stroke| Visible| Painted| Fill| Stroke| All| Inherit| Initial| Unset| Revert| Revert_layer| Var of pointer_events varCSS pointer-events values
pointer_events events is the pointer-events property.
user_select select is the user-select property.
webkit_user_select select is the -webkit-user-select property.
resize resize is the resize property.
print_color_adjust v is the print-color-adjust property.
webkit_print_color_adjust v is the -webkit-print-color-adjust property, the legacy WebKit-prefixed alias of print-color-adjust.
type box_decoration_break = Properties.box_decoration_break = | Clone| Slice| Inherit| Initial| Unset| Revert| Revert_layer| Var of box_decoration_break varbox_decoration_break v is the box-decoration-break property.
webkit_box_decoration_break v is the -webkit-box-decoration-break property.
background_origin v is the background-origin property.
background_clip v is the background-clip property.
webkit_background_clip v is the -webkit-background-clip property.
Properties that tie an absolutely positioned box to an anchor element.
type anchor_name = Properties.anchor_name = | None| Names of string list| Initial| Inherit| Unset| Revert| Revert_layer| Var of anchor_name varSec. 2.1 anchor-name: none | <dashed-ident>#.
anchor_name v is the anchor-name property.
type position_anchor = Properties.position_anchor = | Normal| None| Auto| Anchor of string| Initial| Inherit| Unset| Revert| Revert_layer| Var of position_anchor varSec. 4.1 position-anchor: normal | none | auto | <anchor-name>.
position_anchor v is the position-anchor property.
type position_area_keyword = Properties.position_area_keyword = | Top| Bottom| Left| Right| Center| Span_top| Span_bottom| Span_left| Span_right| X_start| X_end| Y_start| Y_end| Span_x_start| Span_x_end| Span_y_start| Span_y_end| Inline_start| Inline_end| Block_start| Block_end| Span_inline_start| Span_inline_end| Span_block_start| Span_block_end| Start| End| Span_start| Span_end| Self_start| Self_end| Span_self_start| Span_self_end| Self_x_start| Self_x_end| Self_y_start| Self_y_end| Span_self_x_start| Span_self_x_end| Span_self_y_start| Span_self_y_end| Self_block_start| Self_block_end| Self_inline_start| Self_inline_end| Span_self_block_start| Span_self_block_end| Span_self_inline_start| Span_self_inline_end| Span_allSec. 3.1.2 <position-area>: one of the grid keywords naming a region around the anchor.
type position_area = Properties.position_area = | None| Area of position_area_keyword * position_area_keyword option| Initial| Inherit| Unset| Revert| Revert_layer| Var of position_area varSec. 3.1.2 position-area: one or two keywords from a single branch of the grammar.
position_area v is the position-area property.
type position_try_fallback = Properties.position_try_fallback = Sec. 6.1 <try-tactic> and the <dashed-ident> naming a @position-try rule.
type position_try_fallback_entry = Properties.position_try_fallback_entry = | Tactics of position_try_fallback list| Area of position_area_keyword * position_area_keyword optionSec. 6.1: one comma-separated fallback entry, which is either a tactic group or a <position-area>, never a mix of the two.
type position_try_fallbacks = Properties.position_try_fallbacks = | None| Fallbacks of position_try_fallback_entry list| Initial| Inherit| Unset| Revert| Revert_layer| Var of position_try_fallbacks varSec. 6.1 position-try-fallbacks.
position_try_fallbacks v is the position-try-fallbacks property.
type position_try_order = Properties.position_try_order = | Normal| Most_width| Most_height| Most_block_size| Most_inline_size| Initial| Inherit| Unset| Revert| Revert_layer| Var of position_try_order varSec. 6.2 position-try-order: normal | <try-size>.
position_try_order v is the position-try-order property.
type position_try = Properties.position_try = | Try of position_try_order * position_try_fallbacks| Initial| Inherit| Unset| Revert| Revert_layer| Var of position_try varSec. 6.3 position-try: <'position-try-order'>? <'position-try-fallbacks'>.
position_try v is the position-try shorthand.
type position_visibility_condition = Properties.position_visibility_condition = Sec. 7 <anchor-visibility>: one condition that hides the box.
type position_visibility = Properties.position_visibility = | Always| Conditions of position_visibility_condition list| Initial| Inherit| Unset| Revert| Revert_layer| Var of position_visibility varSec. 7 position-visibility.
position_visibility v is the position-visibility property.
Properties that name the elements a view transition animates independently.
type view_transition_name = Properties.view_transition_name = | None| Match_element| Name of string| Initial| Inherit| Unset| Revert| Revert_layer| Var of view_transition_name varView Transitions 1 view-transition-name, with the match-element of Level 2.
view_transition_name v is the view-transition-name property.
type view_transition_class = Properties.view_transition_class = | None| Classes of string list| Initial| Inherit| Unset| Revert| Revert_layer| Var of view_transition_class varView Transitions 2 view-transition-class: none | <custom-ident>+.
view_transition_class v is the view-transition-class property.
Properties that move a box along a path rather than by an offset.
type ray_size = Properties.ray_size = Sec. 3.2 <ray-size>: how far the ray reaches.
type ray = Properties.ray = {angle : angle;size : ray_size option;contain : bool;position : position_value option;}Sec. 3.2 ray(): an angle, a size, whether the path is contained, and the position it starts from.
type offset_path = Properties.offset_path = | None| Url of string| Path of string| Ray of ray| Shape of clip_path| Initial| Inherit| Unset| Revert| Revert_layer| Var of offset_path varSec. 2.1 offset-path: none | <offset-path> || <coord-box>, where the shape branch reuses clip_path.
offset_path v is the offset-path property.
offset_distance v is the offset-distance property.
Sec. 2.3 offset-rotate: which of auto and reverse an explicit angle is measured from.
type offset_rotate = Properties.offset_rotate = | Auto| Reverse| Angle of angle| With_angle of offset_rotate_mode * angle| Initial| Inherit| Unset| Revert| Revert_layer| Var of offset_rotate varSec. 2.3 offset-rotate: [ auto | reverse ] || <angle>.
offset_rotate v is the offset-rotate property.
type offset_anchor = Properties.offset_anchor = | Auto| Position of position_value| Initial| Inherit| Unset| Revert| Revert_layer| Var of offset_anchor varSec. 2.4 offset-anchor: auto | <position>.
offset_anchor v is the offset-anchor property.
type offset_position = Properties.offset_position = | Normal| Auto| Position of position_value| Initial| Inherit| Unset| Revert| Revert_layer| Var of offset_position varSec. 2.5 offset-position: normal | auto | <position>.
offset_position v is the offset-position property.
type offset_target = Properties.offset_target = | Position_only of offset_position| With_path of {position : offset_position option;path : offset_path;distance : length_percentage option;rotate : offset_rotate option;}Sec. 2.6: the leading group of the offset shorthand, which is either a position on its own or a path with the slots that follow it.
type offset = Properties.offset = | Shorthand of {target : offset_target;anchor : offset_anchor option;}| Initial| Inherit| Unset| Revert| Revert_layer| Var of offset varSec. 2.6 offset: [ <'offset-position'>? [ <'offset-path'> [ <'offset-distance'> || <'offset-rotate'> ]? ]? ]! [ / <'offset-anchor'> ]?.
offset v is the offset shorthand.
CSS container queries and containment features for component-based responsive design and performance optimization through layout isolation.
type container_type = Properties.container_type = | Size| Inline_size| Scroll_state| Normal| Initial| Inherit| Unset| Revert| Revert_layer| Var of container_type varCSS container-type values
container_type type_ is the container-type property for container queries.
The shorthand that sets this and the name together is val-Declaration.container, because container at this level is the at-rule builder.
type contain_intrinsic_size_item = Properties.contain_intrinsic_size_item = One axis of CSS Sizing 4 contain-intrinsic-size, a length that the auto prefix lets a remembered size override.
type contain_intrinsic_size = Properties.contain_intrinsic_size = | None| Intrinsic of contain_intrinsic_size_item * contain_intrinsic_size_item option| Initial| Inherit| Unset| Revert| Revert_layer| Var of contain_intrinsic_size varCSS Sizing 4 contain-intrinsic-size: one axis or both.
contain_intrinsic_size v is the contain-intrinsic-size shorthand.
type contain_intrinsic_longhand = Properties.contain_intrinsic_longhand = | None| Size of contain_intrinsic_size_item| Initial| Inherit| Unset| Revert| Revert_layer| Var of contain_intrinsic_longhand varOne axis longhand of contain_intrinsic_size.
contain_intrinsic_width v is the contain-intrinsic-width property.
contain_intrinsic_height v is the contain-intrinsic-height property.
contain_intrinsic_block_size v is the contain-intrinsic-block-size property.
contain_intrinsic_inline_size v is the contain-intrinsic-inline-size property.
type container_name = Properties.container_name = | None| Names of string list| Initial| Inherit| Unset| Revert| Revert_layer| Var of container_name varcontainer_name name is the container-name property.
type contain = Properties.contain = CSS contain values
contain contain is the contain property.
Specialized functionality for advanced CSS features and legacy support.
Vendor-prefixed properties for browser compatibility and legacy support. These are implementation-specific extensions that may be needed for older browsers.
Each writes the prefixed spelling of the unprefixed property beside it and takes the same value type.
moz_user_select v is the -moz-user-select property.
ms_user_select v is the -ms-user-select property.
webkit_text_fill_color v is the -webkit-text-fill-color property.
webkit_text_stroke_width v is the -webkit-text-stroke-width property.
webkit_text_stroke_color v is the -webkit-text-stroke-color property.
webkit_transform v is the -webkit-transform property.
moz_transform v is the -moz-transform property.
ms_transform v is the -ms-transform property.
o_transform v is the -o-transform property.
webkit_transition v is the -webkit-transition property.
webkit_transition_delay v is the -webkit-transition-delay property.
webkit_transition_duration v is the -webkit-transition-duration property.
webkit_transition_property v is the -webkit-transition-property property.
webkit_transition_timing_function v is the -webkit-transition-timing-function property.
webkit_animation v is the -webkit-animation property.
webkit_animation_delay v is the -webkit-animation-delay property.
webkit_animation_duration v is the -webkit-animation-duration property.
webkit_animation_direction v is the -webkit-animation-direction property.
webkit_animation_iteration_count v is the -webkit-animation-iteration-count property.
webkit_animation_name v is the -webkit-animation-name property.
webkit_animation_timing_function v is the -webkit-animation-timing-function property.
webkit_animation_fill_mode v is the -webkit-animation-fill-mode property.
webkit_animation_play_state v is the -webkit-animation-play-state property.
webkit_flex_direction v is the -webkit-flex-direction property.
webkit_flex_wrap v is the -webkit-flex-wrap property.
webkit_flex_flow v is the -webkit-flex-flow property.
webkit_justify_content v is the -webkit-justify-content property.
webkit_align_items v is the -webkit-align-items property.
webkit_align_content v is the -webkit-align-content property.
webkit_align_self v is the -webkit-align-self property.
webkit_border_radius v is the -webkit-border-radius property.
webkit_box_sizing v is the -webkit-box-sizing property.
moz_box_sizing v is the -moz-box-sizing property.
webkit_box_shadow v is the -webkit-box-shadow property.
webkit_background_size v is the -webkit-background-size property.
webkit_filter v is the -webkit-filter property.
moz_animation v is the -moz-animation property.
moz_animation_delay v is the -moz-animation-delay property.
moz_animation_duration v is the -moz-animation-duration property.
moz_animation_direction v is the -moz-animation-direction property.
moz_animation_iteration_count v is the -moz-animation-iteration-count property.
moz_animation_name v is the -moz-animation-name property.
moz_animation_timing_function v is the -moz-animation-timing-function property.
moz_animation_fill_mode v is the -moz-animation-fill-mode property.
moz_animation_play_state v is the -moz-animation-play-state property.
moz_transition v is the -moz-transition property.
moz_transition_delay v is the -moz-transition-delay property.
moz_transition_duration v is the -moz-transition-duration property.
moz_transition_property v is the -moz-transition-property property.
moz_transition_timing_function v is the -moz-transition-timing-function property.
moz_border_radius v is the -moz-border-radius property.
moz_box_shadow v is the -moz-box-shadow property.
ms_filter v is the -ms-filter property.
o_transition v is the -o-transition property.
type webkit_box_orient = Properties.webkit_box_orient = | Horizontal| Vertical| Inline_axis| Block_axis| Inherit| Initial| Unset| Revert| Revert_layer| Var of webkit_box_orient varCSS webkit-box-orient values.
type webkit_line_clamp = Properties.webkit_line_clamp = | None| Lines of int| Calc of webkit_line_clamp calc| Inherit| Initial| Unset| Revert| Revert_layer| Var of webkit_line_clamp varCSS -webkit-line-clamp values.
type webkit_appearance = Properties.webkit_appearance = | NoneNo appearance styling
*)| AutoDefault browser styling
*)| ButtonButton appearance
*)| TextfieldText field appearance
*)| MenulistSelect/dropdown appearance
*)| Base_selectThe base appearance of a select (Chrome alias)
*)| ListboxList box appearance
*)| CheckboxCheckbox appearance
*)| RadioRadio button appearance
*)| InheritInherit from parent
*)| Initial| Unset| Revert| Revert_layer| Var of webkit_appearance varCSS -webkit-appearance values.
type webkit_font_smoothing = Properties.webkit_font_smoothing = | Auto| None| Antialiased| Subpixel_antialiased| Inherit| Initial| Unset| Revert| Revert_layer| Var of webkit_font_smoothing varCSS -webkit-font-smoothing values.
type moz_osx_font_smoothing = Properties.moz_osx_font_smoothing = | Auto| Grayscale| Inherit| Initial| Unset| Revert| Revert_layer| Var of moz_osx_font_smoothing varCSS -moz-osx-font-smoothing values.
webkit_appearance app is the -webkit-appearance property.
webkit_font_smoothing smoothing is the -webkit-font-smoothing property.
moz_osx_font_smoothing smoothing is the -moz-osx-font-smoothing property.
webkit_tap_highlight_color color is the -webkit-tap-highlight-color property.
webkit_text_decoration decoration is the WebKit-only -webkit-text-decoration property.
webkit_text_decoration_color color is the WebKit-only -webkit-text-decoration-color property.
webkit_line_clamp clamp is the WebKit-only -webkit-line-clamp property.
webkit_box_orient orient is the WebKit-only -webkit-box-orient property.
webkit_hyphens hyphens is the WebKit-only -webkit-hyphens property.
webkit_text_size_adjust adjust is the WebKit-only -webkit-text-size-adjust property.
Specialized CSS properties organized by their functional purpose.
Properties for styling HTML lists and tables.
CSS symbols() counter-system keywords
list_style_symbol_string value is a string symbol for symbols().
list_style_symbol_url value is a URL symbol for symbols().
type list_style_type = Properties.list_style_type = | None| Disc| Circle| Square| Decimal| Lower_alpha| Upper_alpha| Lower_roman| Upper_roman| Decimal_leading_zero| Arabic_indic| Armenian| Upper_armenian| Lower_armenian| Bengali| Cambodian| Khmer| Cjk_decimal| Devanagari| Georgian| Gujarati| Gurmukhi| Hebrew| Kannada| Lao| Malayalam| Mongolian| Myanmar| Oriya| Persian| Tamil| Telugu| Thai| Tibetan| Lower_latin| Upper_latin| Cjk_earthly_branch| Cjk_heavenly_stem| Lower_greek| Hiragana| Hiragana_iroha| Katakana| Katakana_iroha| Disclosure_open| Disclosure_closed| Cjk_ideographic| Japanese_informal| Japanese_formal| Korean_hangul_formal| Korean_hanja_informal| Korean_hanja_formal| Simp_chinese_informal| Simp_chinese_formal| Trad_chinese_informal| Trad_chinese_formal| Ethiopic_numeric| Name of stringA case-sensitive custom counter-style name.
*)| String of string| Symbols of symbols_type option * list_style_symbol list| Inherit| Initial| Unset| Revert| Revert_layer| Var of list_style_type varCSS list-style-type values
list_style_string value is a string list-style-type.
list_style_symbols ?kind symbols is a symbols(...) list-style type.
type list_style_image = Properties.list_style_image = | None| Image of background_image| Inherit| Initial| Unset| Revert| Revert_layer| Var of list_style_image varCSS list-style-image values
type list_style_shorthand = Properties.list_style_shorthand = {type_ : list_style_type option;position : list_style_position option;image : list_style_image option;}type list_style = Properties.list_style = | Shorthand of list_style_shorthand| Inherit| Initial| Unset| Revert| Revert_layer| Var of list_style varlist_style_image_url value is a URL list-style-image.
list_style_type lst is the list-style-type property.
list_style_image img is the list-style-image property.
type table_layout = Properties.table_layout = | Auto| Fixed| Inherit| Initial| Unset| Revert| Revert_layer| Var of table_layout vartype vertical_align = Properties.vertical_align = | Baseline| Top| Middle| Bottom| Text_top| Text_bottom| Sub| Super| Length of length_percentage| Inherit| Initial| Unset| Revert| Revert_layer| Var of vertical_align vartable_layout value is the table-layout property.
vertical_align value is the vertical-align property.
list_style value is the list-style shorthand property.
border_spacing values is the border-spacing property. Accepts 1 or 2 length values.
border_spacing_values values is a one- or two-value border-spacing.
Properties specific to SVG rendering and styling.
type svg_paint = Properties.svg_paint = | NoneNo paint
*)| InheritInherited value
*)| Current_colorCurrent color value
*)| Color of colorSpecific color value
*)| Url of string * svg_paint optionurl(#id) with optional fallback
*)| Context_fillSVG2 context-fill keyword
| Context_strokeSVG2 context-stroke keyword
| Var of svg_paint varSVG paint values for fill and stroke properties
svg_paint_url ?fallback url is a URL paint value with an optional fallback.
fill paint is the SVG fill property.
stroke paint is the SVG stroke property.
type stroke_width = Properties.stroke_width = | Number of floatA width in user units
*)| Calc of stroke_width calcA math function answering a <number>
| Length of length_percentage| Inherit| Initial| Unset| Revert| Revert_layer| Var of stroke_width varSVG 2 stroke-width: <length-percentage> | <number>, where a bare number is a width in user units rather than a CSS <length>.
stroke_width width is the SVG stroke-width property.
type fill_rule = Properties.fill_rule = fill_rule v is the SVG fill-rule property.
clip_rule v is the SVG clip-rule property, which takes what fill-rule takes.
fill_opacity v is the SVG fill-opacity property.
stroke_opacity v is the SVG stroke-opacity property.
type stroke_linecap = Properties.stroke_linecap = | Butt| Round| Square| Inherit| Initial| Unset| Revert| Revert_layer| Var of stroke_linecap varSVG 2 stroke-linecap: the shape at the ends of an open subpath.
stroke_linecap v is the SVG stroke-linecap property.
type stroke_linejoin = Properties.stroke_linejoin = | Miter| Miter_clip| Round| Bevel| Arcs| Inherit| Initial| Unset| Revert| Revert_layer| Var of stroke_linejoin varSVG 2 stroke-linejoin: the shape at a corner between two stroke segments.
stroke_linejoin v is the SVG stroke-linejoin property.
type stroke_miterlimit = Properties.stroke_miterlimit = | Number of float| Calc of stroke_miterlimit calc| Inherit| Initial| Unset| Revert| Revert_layer| Var of stroke_miterlimit varSVG 2 stroke-miterlimit: the ratio past which a miter join falls back to a bevel.
stroke_miterlimit v is the SVG stroke-miterlimit property.
SVG 2 stroke-dasharray writes each dash as a <length-percentage> or a bare number in user units, the way stroke_width does.
type stroke_dashoffset = Properties.stroke_dashoffset = | Dash of dash_length| Inherit| Initial| Unset| Revert| Revert_layer| Var of stroke_dashoffset varSVG 2 stroke-dashoffset: where the dash pattern starts.
stroke_dashoffset v is the SVG stroke-dashoffset property.
type stroke_dasharray = Properties.stroke_dasharray = | None| Dashes of dash_length list| Inherit| Initial| Unset| Revert| Revert_layer| Var of stroke_dasharray varSVG 2 stroke-dasharray: the dash and gap lengths.
stroke_dasharray v is the SVG stroke-dasharray property.
One of the three painting operations SVG 2 paint-order orders.
type paint_order = Properties.paint_order = | Normal| Order of paint_order_keyword list| Inherit| Initial| Unset| Revert| Revert_layer| Var of paint_order varSVG 2 paint-order: the order fill, stroke and markers paint in.
paint_order v is the SVG paint-order property.
type vector_effect_keyword = Properties.vector_effect_keyword = One effect the transform does not scale, for SVG 2 vector-effect.
The coordinate space an SVG 2 vector-effect effect is taken against.
type vector_effect = Properties.vector_effect = | None| Effects of vector_effect_keyword list * vector_effect_space option| Inherit| Initial| Unset| Revert| Revert_layer| Var of vector_effect varSVG 2 vector-effect.
vector_effect v is the SVG vector-effect property.
stop_color v is the SVG stop-color property of a gradient stop.
stop_opacity v is the SVG stop-opacity property of a gradient stop.
flood_color v is the SVG flood-color property of feFlood.
flood_opacity v is the SVG flood-opacity property of feFlood.
lighting_color v is the SVG lighting-color property of a light filter.
type dominant_baseline = Properties.dominant_baseline = | Auto| Alphabetic| Ideographic| Mathematical| Central| Middle| Text_top| Text_bottom| Inherit| Initial| Unset| Revert| Revert_layer| Var of dominant_baseline varCSS Inline 3 dominant-baseline: auto | <baseline-metric>.
dominant_baseline v is the dominant-baseline property.
type alignment_baseline = Properties.alignment_baseline = | Baseline| Text_bottom| Middle| Central| Text_top| Ideographic| Alphabetic| Hanging| Mathematical| Inherit| Initial| Unset| Revert| Revert_layer| Var of alignment_baseline varSVG 2 alignment-baseline: the baseline of the box aligned against its parent's dominant baseline.
alignment_baseline v is the alignment-baseline property.
type baseline_shift = Properties.baseline_shift = | Shift of length_percentage| Sub| Super| Top| Center| Bottom| Inherit| Initial| Unset| Revert| Revert_layer| Var of baseline_shift varCSS Inline 3 baseline-shift: <length-percentage> | sub | super | top | center | bottom.
baseline_shift v is the baseline-shift property.
type baseline_source = Properties.baseline_source = | Auto| First| Last| Inherit| Initial| Unset| Revert| Revert_layer| Var of baseline_source varCSS Inline 3 baseline-source: which line box baseline an inline block aligns on.
baseline_source v is the baseline-source property.
Properties for scroll behavior and touch interaction.
type touch_action = Properties.touch_action = | Auto| None| Pan_x| Pan_y| Pan_left| Pan_right| Pan_up| Pan_down| Pinch_zoom| Manipulation| Actions of touch_action list| Inherit| Initial| Unset| Revert| Revert_layer| Vars of touch_action var list| Var of touch_action varCSS touch-action values
type scroll_snap_strictness = Properties.scroll_snap_strictness = | Mandatory| Proximity| Var of scroll_snap_strictness varCSS scroll-snap-strictness values
type scroll_snap_axis = Properties.scroll_snap_axis = | None| X| Y| Block| Inline| Both| Var of scroll_snap_axis varCSS scroll-snap axis values
type scroll_snap_type = Properties.scroll_snap_type = | Axis of scroll_snap_axis| Axis_with_strictness of scroll_snap_axis * scroll_snap_strictness| Inherit| Initial| Unset| Revert| Revert_layer| Var of scroll_snap_type varCSS scroll-snap-type values
type scroll_snap_align = Properties.scroll_snap_align = | None| Start| End| Center| Snap_align_pair of scroll_snap_align * scroll_snap_align| Inherit| Initial| Unset| Revert| Revert_layer| Var of scroll_snap_align varCSS scroll-snap-align values
type timeline_axis = Properties.timeline_axis = | Block| Inline| X| Y| Axes of timeline_axis list| Initial| Inherit| Unset| Revert| Revert_layer| Var of timeline_axis varnone | <dashed-ident>#, shared by scroll-timeline-name, view-timeline-name and Scroll-driven Animations 1 timeline-scope.
type timeline_name = Properties.timeline_name = | Names of timeline_ident list| Initial| Inherit| Unset| Revert| Revert_layer| Var of timeline_name vartype timeline_scope = Properties.timeline_scope = | None| Names of string list| Initial| Inherit| Unset| Revert| Revert_layer| Var of timeline_scope varScroll-driven Animations 1 timeline-scope: none | <dashed-ident>#, where none stands for the whole value.
type timeline_shorthand_item = Properties.timeline_shorthand_item = {name : timeline_ident;axis : timeline_axis option;}type timeline_shorthand = Properties.timeline_shorthand = | Timelines of timeline_shorthand_item list| Initial| Inherit| Unset| Revert| Revert_layer| Var of timeline_shorthand vartype view_timeline_shorthand_item = Properties.view_timeline_shorthand_item = {name : timeline_ident;axis : timeline_axis option;inset : Properties.timeline_inset option;}type view_timeline_shorthand = Properties.view_timeline_shorthand = | Timelines of view_timeline_shorthand_item list| Initial| Inherit| Unset| Revert| Revert_layer| Var of view_timeline_shorthand varOne edge of Scroll-driven Animations 1 view-timeline-inset.
type timeline_inset = Properties.timeline_inset = | Inset of timeline_inset_item * timeline_inset_item option| Insets of timeline_inset list| Initial| Inherit| Unset| Revert| Revert_layer| Var of timeline_inset varSec. 5.2 view-timeline-inset: the start edge then the end edge.
type animation_range_name = Properties.animation_range_name = Sec. 6.2 <timeline-range-name>: the named part of a view progress timeline.
type animation_range_item = Properties.animation_range_item = | Normal| Items of animation_range_item list| Offset of length_percentage| Named of animation_range_name * length_percentage option| Initial| Inherit| Unset| Revert| Revert_layer| Var of animation_range_item varSec. 6.2: one end of animation-range.
type animation_range = Properties.animation_range = | Range of animation_range_item * animation_range_item option| Ranges of animation_range list| Initial| Inherit| Unset| Revert| Revert_layer| Var of animation_range varSec. 6.2 animation-range: the start then the end.
animation_timeline v is the animation-timeline property.
animation_range v is the animation-range shorthand.
animation_range_start v is the animation-range-start property.
animation_range_end v is the animation-range-end property.
scroll_timeline v is the scroll-timeline shorthand.
scroll_timeline_name v is the scroll-timeline-name property.
scroll_timeline_axis v is the scroll-timeline-axis property.
view_timeline v is the view-timeline shorthand.
view_timeline_name v is the view-timeline-name property.
view_timeline_axis v is the view-timeline-axis property.
view_timeline_inset v is the view-timeline-inset property.
timeline_scope v is the timeline-scope property.
touch_action action is the touch-action property.
scroll_snap_type type_ is the scroll-snap-type property.
scroll_snap_align align is the scroll-snap-align property.
type scroll_snap_stop = Properties.scroll_snap_stop = | Normal| Always| Inherit| Initial| Unset| Revert| Revert_layer| Var of scroll_snap_stop varCSS scroll-snap-stop values
scroll_snap_stop stop is the scroll-snap-stop property.
type scroll_behavior = Properties.scroll_behavior = | Auto| Smooth| Inherit| Initial| Unset| Revert| Revert_layer| Var of scroll_behavior varCSS scroll behavior values
scroll_behavior behavior is the scroll-behavior property for smooth scrolling.
type color_scheme = Properties.color_scheme = | Normal| Light| Dark| Light_dark| Only_light| Only_dark| Only_light_dark| Custom of string list| Inherit| Initial| Unset| Revert| Revert_layer| Var of color_scheme varcolor_scheme scheme is the color-scheme property for light/dark mode preference.
scroll_margin margin is the scroll-margin property.
scroll_margin_top margin is the scroll-margin-top property.
scroll_margin_right margin is the scroll-margin-right property.
scroll_margin_bottom margin is the scroll-margin-bottom property.
scroll_margin_left margin is the scroll-margin-left property.
scroll_margin_inline margin is the scroll-margin-inline property.
scroll_margin_inline_start margin is the scroll-margin-inline-start property.
scroll_margin_inline_end margin is the scroll-margin-inline-end property.
scroll_margin_block margins is the scroll-margin-block property; takes 1 (both edges) or 2 (start, end) length values per the spec.
scroll_margin_block_start margin is the scroll-margin-block-start property.
scroll_margin_block_end margin is the scroll-margin-block-end property.
scroll_padding padding is the scroll-padding property.
scroll_padding_top padding is the scroll-padding-top property.
scroll_padding_right padding is the scroll-padding-right property.
scroll_padding_bottom padding is the scroll-padding-bottom property.
scroll_padding_left padding is the scroll-padding-left property.
scroll_padding_inline padding is the scroll-padding-inline property.
scroll_padding_inline_start padding is the scroll-padding-inline-start property.
scroll_padding_inline_end padding is the scroll-padding-inline-end property.
scroll_padding_block padding is the scroll-padding-block property.
scroll_padding_block_start padding is the scroll-padding-block-start property.
scroll_padding_block_end padding is the scroll-padding-block-end property.
type overscroll_behavior = Properties.overscroll_behavior = | Auto| Contain| None| Inherit| Initial| Unset| Revert| Revert_layer| Var of overscroll_behavior varCSS overscroll behavior values
overscroll_behavior behaviors is the overscroll-behavior property.
overscroll_behavior_x behavior is the overscroll-behavior-x property.
overscroll_behavior_block v is the overscroll-behavior-block property.
overscroll_behavior_inline v is the overscroll-behavior-inline property.
overscroll_behavior_y behavior is the overscroll-behavior-y property.
accent_color color is the accent-color property for form controls.
caret_color color is the caret-color property for the text input cursor.
Other properties that don't fit into specific categories.
forced_color_adjust adjust is the forced-color-adjust property.
type appearance = Properties.appearance = | None| Auto| Button| Textfield| Menulist| Base_select| Inherit| Initial| Unset| Revert| Revert_layer| Var of appearance varappearance app is the appearance property.
moz_appearance v is the -moz-appearance property.
type tab_size = Properties.tab_size = tab_size size is the tab-size property.
tab_size_value v is the tab-size property from a typed value, allowing a <length> in addition to an integer.
type scrollbar_width = Properties.scrollbar_width = | Auto| Thin| None| Initial| Inherit| Unset| Revert| Revert_layer| Var of scrollbar_width vartype scrollbar_color = Properties.scrollbar_color = | Auto| Colors of color * color| Initial| Inherit| Unset| Revert| Revert_layer| Var of scrollbar_color vartype scrollbar_gutter = Properties.scrollbar_gutter = | Auto| Stable| Stable_both_edges| Initial| Inherit| Unset| Revert| Revert_layer| Var of scrollbar_gutter varscrollbar_width v is the scrollbar-width property.
scrollbar_color v is the scrollbar-color property.
scrollbar_gutter v is the scrollbar-gutter property.
type zoom = Properties.zoom = zoom v is the CSS zoom property.
font_variation_settings settings is the font-variation-settings property.
Type-safe CSS custom properties (CSS variables) with GADT-based type checking.
type 'a kind = 'a Properties.kind = | Length : length kind| Color : color kind| Rgb : rgb kind| Number : number kind| Int : int kind| Float : float kind| Percentage : percentage kind| Length_percentage : length_percentage kind| Number_percentage : number_percentage kind| Opacity : opacity kind| Value : custom_value kind| Duration : duration kind| Aspect_ratio : aspect_ratio kind| Border_style : border_style kind| Outline_style : outline_style kind| Border : border kind| Font_weight : font_weight kind| Font_size : font_size kind| Line_height : line_height kind| Font_family : font_family kind| Font_feature_settings : font_feature_settings kind| Font_variation_settings : font_variation_settings kind| Numeric : font_variant_numeric kind| Font_variant_numeric_token : font_variant_numeric_token kind| Blend_mode : blend_mode kind| Scroll_snap_strictness : scroll_snap_strictness kind| Angle : angle kind| Rotate : rotate_value kind| Scale : scale kind| Shadow : shadow kind| Content : content kind| Gradient_stop : gradient_stop kind| Gradient_direction : gradient_direction kind| Gradient_position : gradient_position kind| Radial_shape : radial_shape kind| Radial_size : radial_size kind| Position_value : position_value kind| Animation : animation kind| Timing_function : timing_function kind| Transform : transform kind| Touch_action : touch_action kind| Transition_property_value : transition_property_value kind| Background_image : background_image kind| Z_index : z_index kind| Filter : filter kind| Font_src : Font_face.src kindValue kind GADT for typed custom properties
type meta = Values.meta = ..The type for CSS variable metadata.
meta () returns a fresh injection/projection pair for storing values of type 'a inside meta.
val var_ref :
?fallback:'a fallback ->
?default:'a ->
?layer:string ->
?meta:meta ->
?runtime:bool ->
string ->
'a varvar_ref ?fallback ?default ?layer ?meta ?runtime name is a CSS variable reference. This is primarily for the CSS parser to create var() references.
name is the variable name (without the -- prefix)fallback is used inside var(--name, fallback) in CSS outputdefault is the resolved value when mode is Inlinelayer is an optional CSS layer namemeta is optional metadata.@property Supporttype 'a syntax = 'a Variables.syntax = | Length : length syntax| Color : color syntax| Number : float syntax| Integer : int syntax| Percentage : percentage syntax| Length_percentage : length_percentage syntax| Angle : angle syntax| Time : duration syntax| Resolution : string syntax| Custom_ident : string syntax| String : string syntax| Url : string syntax| Image : background_image syntax| Transform_function : string syntax| Transform_list : string syntax| Universal : string syntax| Or : 'a syntax * 'b syntax -> ('a, 'b) Either.t syntax| Plus : 'a syntax -> 'a list syntax| Hash : 'a syntax -> 'a list syntax| Ident_keyword : string -> unit syntaxType-safe syntax descriptors for CSS @property rules per CSS Properties and Values API 1 sec. 2.
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 ->
?runtime:bool ->
string ->
'a kind ->
'a ->
declaration * 'a varvar ?default ?fallback ?layer ?runtime name kind value returns a declaration and a variable handle. With ~runtime:true a context keeps the var() reference instead of folding it to value, so a runtime stylesheet or script can still override --name.
name is the variable name without the -- prefixkind specifies the value type (Length, Color, Angle, Float, etc.)default specifies the value to use in inline mode instead of var() referencefallback is used inside var(--name, fallback) in CSS outputlayer is an optional CSS layer name where the variable should be placedExample:
open Cascade.Css
let def_radius, radius_var = var "radius-md" Length (Rem 0.5)
let card =
rule ~selector:(Selector.class_ "card")
[ def_radius; border_top_left_radius (Var radius_var) ]The returned radius_var must be wrapped with Var when used in CSS properties. In variables mode, it emits "--radius-md: 0.5rem" and uses "var(--radius-md)". In inline mode, it uses "0.5rem" directly when the default equals the defined value.
meta_of_declaration decl extracts metadata from a declaration if it has any.
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.
It raises Failure on a pair that does not make the one declaration it names, such as a value carrying a top-level ; or } or an unterminated function, block or string. A name holding a code point no bare ident carries is written back with the escapes that read it. Declaration.parse_custom_property is the same check as an option.
Example: custom_property "--primary-color" "#3b82f6"
See also var (type-safe CSS variable API).
parse_declaration ?layer property value reads property and value with the full declaration parser. The two are read as the tokens they are rather than as one "property: value" text, so a property carrying a ;, a } or a : names this declaration or names none:
mask-type, display) becomes a typed declaration;--x) or an unknown property keeps its parsed component stream, so var() references in value are visible to vars_of_declarations (unlike custom_property, which forces an opaque token value);None if value does not parse.layer applies only to a custom property.
custom_declaration_name decl is the variable name if decl is a custom property declaration, None otherwise.
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.
CSS output generation and performance optimization tools.
Functions for converting CSS structures to string output.
Rendering mode for CSS output.
Variables: Standard rendering with CSS custom properties supportInline: For inline styles (no at-rules, variables expanded with their values)val to_string :
?minify:bool ->
?indent:int ->
?lossless:bool ->
?enforce_spec:bool ->
?rename_custom_property:(string -> string) ->
t ->
stringto_string ?minify ?indent ?lossless ?enforce_spec ?rename_custom_property stylesheet serialises a stylesheet to CSS. rename_custom_property rewrites every custom property name, without its leading --, wherever one is written: the name a declaration declares and the name a var() reads. That is how a sheet is namespaced without rebuilding the typed values its references live in. Pure formatter - no optimisation, no theme resolution, no var() substitution. Run optimize, resolve_theme, and inline_vars explicitly when those passes are needed. Spec recovery (drop invalid declarations and empty rules) still applies because the parser preserved those shapes for round-trip and browsers discard them during parse. Unknown at-rules are preserved. Output never ends with a newline.
minify toggles compact serialisation (no insignificant whitespace).indent sets the per-level indent width.lossless suppresses colour-channel rounding in minified output.enforce_spec suppresses target-dependent minified shortenings and keeps their spec-canonical serialisations.pp is the composable form of to_string. It applies the same invalid declaration and empty-rule filtering before printing.
val to_buffer :
Buffer.t ->
?minify:bool ->
?indent:int ->
?lossless:bool ->
?enforce_spec:bool ->
?rename_custom_property:(string -> string) ->
t ->
unitto_buffer buf stylesheet appends the serialised stylesheet to buf. Same options as to_string.
A partially-recovered parse: the stylesheet composed of every rule that validated successfully, plus the warnings accumulated for rules that were dropped or section 5.3-recovered. Each warning is an Error.t stamped with the source filename when one was supplied. source is Some only when parsing requested source fidelity.
val of_string :
?strict:bool ->
?filename:string ->
?meta:Loc.meta_level ->
?enforce_spec:bool ->
?preserve_source:bool ->
string ->
(parse, Error.t) resultof_string ?strict css parses css with CSS Syntax 3 (ED) section 5.4 recovery. Returns Ok { stylesheet; warnings } when no fatal syntax error escapes recovery; warnings carries every typed diagnostic the parser collected (unknown at-rules, unknown properties, invalid values, ...). With ~strict:true a non-empty warnings list collapses to Error (first warning) - useful in linters and CI gates that want to fail on any spec deviation. ?meta controls diagnostic richness; see Loc.meta_level.
enforce_spec (default false) restricts non-ASCII identifiers to the CSS Syntax 3 (ED) sec. 4.2 range list, which excludes most BMP symbols. The default accepts any code point >= U+0080, so a selector such as .text-\u{2197} reads rather than being dropped with a warning. Output is unaffected either way: a code point outside the range list is hex-escaped.
preserve_source (default false) retains the byte-exact input, located recovered syntax tree, comments, trivia ownership, and source-coordinate mapping in source. The snapshot describes only the authored parse: optimising, flattening, mapping, or otherwise transforming stylesheet neither mutates it nor fabricates locations for split, merged, dropped, or synthetic nodes.
val of_string_exn :
?strict:bool ->
?filename:string ->
?meta:Loc.meta_level ->
?enforce_spec:bool ->
string ->
tof_string_exn ?strict css parses css like of_string, raises Error.Parse_error instead of returning Error, and discards the warnings list. In non-strict mode warnings are silently dropped; with ~strict:true any warning escalates to a raise.
Tools for optimizing CSS output for performance and file size.
val canonicalize_rule_order :
?lossless:bool ->
?enforce_spec:bool ->
?judge:Optimize.targets ->
t ->
tcanonicalize_rule_order t projects cascade-equivalent stylesheets to one deterministic form: selector-list rules expand onto their branches, same-selector rules coalesce when no intervening write can observe the move (so a declaration hoisted into a shared group and the same declaration written inline converge), each rule's declarations sort into a canonical order among those with disjoint footprints (a shorthand and its longhand, or two writes of the same property, keep their cascade-significant order), and cascade-independent statements sort into a content-keyed linear extension of the cascade-conflict graph. Sharing a selector branch alone is not a conflict in this projection: after branch expansion, only overlapping cascade-property writes constrain their order. A @media / @supports / @container block whose transitive content is plain rules reads as one block per rule, so each rule moves on its own footprint and how the rules were grouped into blocks is no difference; adjacent blocks of one condition fold back together, and conflicting statements keep their relative order. Two equal @supports blocks may merge across an intervening non-important write that the later block shadows with the same selector and property whenever the condition holds. Two rules under a condition and its exact negation
@media query, an @supports condition, or an @container query on one container name - never apply together, so their order is no difference. CSS Cascade 5 sec. 6.1 sorts by layer before order of appearance, so a named @layer block of style rules reads in the sheet's layer order, however a pin and the blocks spell that order, and its place among unlayered rules, @property and @keyframes is no difference; two blocks of one layer keep their order, and an @layer statement pins the layer order where it stands. A run of @property rules sorts by name, keeping the last registration of each, since CSS Properties and Values API 1 sec. 2 makes registrations for different names order-independent. A @media prelude is keyed as the Level 4 query Media Queries 4 makes it equal to - not all and (X) as not (X), min-X/max-X as the range form, and a lower bound met by an upper bound as the two-sided interval - and an @container prelude the same way, which emission cannot do because a Level 3 parser rejects the shorter forms. A color(srgb ...) whose channels all land on a whole byte is keyed as the rgb() spelling of the same colour, which emission cannot do either because color() needs a browser that parses it. A none channel of a Lab-family colour standing as a whole colour-longhand value, or as a colour function of a custom-property token stream, is keyed as the zero CSS Color 4 sec. 4.4 says a missing component behaves as, so a converted achromatic oklab() meets the hex a minifier writes for it; sec. 13.3 keeps that off the positions the sheet interpolates, so a gradient stop, a color-mix() operand, @keyframes, @starting-style and a colour whose own rule transitions the property it writes, a custom property named by its own name included, keep their none, and lossless bounds how far the resolved colour respells. An angle is keyed as the degrees it names, which CSS Values 4 sec. 6.1 makes one dimension under deg, grad, rad and turn, in the rotate property, in a transform function and in an unregistered custom property's stream, a converted unit rounded to the six-significant-figure budget a quotient takes; lossless keeps the unit as written. An @supports guard false however a user agent answers its feature tests, reading a parenthesised <general-enclosed> term as the false CSS Conditional 3 sec. 6.1 makes it (Supports.never_holds), is dropped with its block under either reading, since no reading answers it yes. An identical -webkit-text-decoration-color compatibility declaration is dropped when its unprefixed twin is present; a differing or prefixed-only declaration is retained. These are comparison-side normalisations; this function does not change optimize's configured emission policy.val optimize :
?scope:Optimize.scope ->
?targets:Optimize.targets ->
?judge:Optimize.targets ->
?flatten_nesting:bool ->
?lossless:bool ->
?enforce_spec:bool ->
?aggressive:bool ->
?regroup:bool ->
?closed_world:bool ->
?objective:Optimize.objective ->
?prune_unused_custom_props:bool ->
?stats:Stats.t ->
t ->
toptimize ?scope ?targets ?judge ?flatten_nesting ?lossless ?enforce_spec ?aggressive ?regroup ?closed_world ?objective ?prune_unused_custom_props ?stats stylesheet applies CSS optimizations to the stylesheet, including merging consecutive identical selectors and combining rules with identical properties. Preserves CSS cascade semantics for any DOM, unless closed_world is set.
scope (default `Fragment) gates partial-coverage shorthand synthesis. Pass `Stylesheet when the caller controls the whole author stylesheet graph. See Optimize.scope for the details.
targets defaults to Optimize.evergreen_targets and owns compatibility prefix generation. It is ignored when enforce_spec is true.
judge, unset by default, names the browsers the sheet is judged for; see Optimize.stylesheet.
When flatten_nesting is true (default false) the optimizer also desugars nested rules into flat top-level rules; see Optimize.stylesheet.
When lossless is true (default false), bounded colour and numeric approximation is disabled while exact canonicalisation still runs. Independent declarations retain their authored order rather than being sorted for compression, preserving stylesheet-text and CSSOM observability.
When enforce_spec is true (default false) the optimizer drops the evergreen-browser target facts: a vendor-prefixed declaration is kept beside its unprefixed twin, a media or container feature keeps its min-/max- form rather than the shorter Media Queries 4 range grammar, and a nested selector keeps its & prefix.
When aggressive is true (default false) the global factoring fixpoint runs even when the preflight predicts low gain, and the top-level statement-optimisation pipeline iterates until the AST reaches a structural fixpoint (capped at a small bound).
When regroup is true (the default), order-dependent adjacent rule runs may be regrouped by factoring shared declarations and synthesising nesting. Canonical diff projection disables it to remain confluent; see Optimize.stylesheet.
When closed_world is true (default false) the optimizer assumes the caller knows the exact HTML and that no element ever matches two clashing selectors, so it may merge rules it would otherwise keep apart. Unsafe: the page can render wrong if such an element appears, including one a script adds at runtime. This is about the HTML, separate from scope (how much of the CSS you control). The default is safe for any page.
objective (default `Transfer) is the size metric factoring is judged by: under `Transfer, a global factoring result that grows the estimated DEFLATE (gzip) size of the output is discarded even when it shrinks raw bytes, since repeated declaration text is nearly free once compressed. Pass `Raw to keep every raw-byte win, the right objective when the output ships uncompressed (inline HTML style attributes, email HTML).
When prune_unused_custom_props is true (default false) custom-property bindings referenced by no var() anywhere are dropped. Opt-in: it assumes a complete stylesheet with no out-of-band reader (another stylesheet, or getComputedStyle), the same closed-world assumption as inline_vars.
stats records what this run did; read it back with Stats.snapshot. Without it the run counts into a recorder of its own that nobody reads.
flatten_nesting stylesheet returns the stylesheet with every nested rule flattened into a top-level rule (without running the rest of the optimization passes). Child selectors with & have the parent substituted in; selectors without & are joined to the parent with the descendant combinator; at-rules nested inside a rule are emitted at the top level with the parent selector applied to their inner rules.
Transforms that assume the caller controls properties the open web cannot guarantee (no undeclared runtime mutation, full file resolution).
val inline_vars :
?keep_vars:string list ->
?inline_runtime:bool ->
?warn:(string -> unit) ->
t ->
tinline_vars ?keep_vars ?inline_runtime ?warn stylesheet substitutes var(--name) references with the value of the corresponding --name declaration and deletes the definition, but only for a variable with a single definition. A variable in keep_vars, or one redefined in a different scope (a real cascade override such as dark mode), keeps its definition and stays a live var() reference; warn is called with each such name. The transform assumes no runtime mutation of the variables it inlines: a reference marked ~runtime on var_ref also stays live, fallback included, so a browser-time override point survives, unless inline_runtime (default false) is true, in which case such a reference folds like any other whose variable the sheet defines once. A style() container query reads the computed value of the custom property it names, so that property stays live as well.
Every @layer wrapper is spliced into its parent and the @layer-decl rules ordering them go with it. A @property registration goes only when the substitution left neither a declaration of its property nor a var() reading it: its initial-value and inherits descriptors decide computed values, so a property that stays live keeps its registration.
val resolve_theme :
?theme:Pp.String_set.t ->
?theme_defaults:(string -> string option) ->
t ->
tresolve_theme ?theme ?theme_defaults stylesheet resolves theme guards and external theme defaults as an explicit AST transformation. to_string is a pure formatter and does not perform this step.
theme names the variables whose var() references stay live. When theme is given, references to any other name are inlined to the value theme_defaults resolves for it.
theme_defaults maps a custom-property name to its value and is the source of global theme-token definitions. An answer binds only when the name and the value make one custom-property declaration - a <dashed-ident> name and a CSS Syntax 3 (ED) sec. 7.2 <declaration-value>, as Declaration.parse_custom_property checks. Any other answer, such as one carrying a } or a top-level ;, reads as no default at all and leaves the reference live. Every var() reference that is undefined in stylesheet and resolvable through theme_defaults - transitively, and only when the whole chain closes without a cycle or dead end - is emitted as a definition in the root-scope theme block: merged into an existing :root / :host rule, or a fresh :root. A name with no theme_defaults value (e.g. a runtime --tw-* variable) is left free, so non-theme variables are gated out.
Root scope is deliberate. Per CSS Custom Properties L1 a custom property is inherited and resolved per element at computed-value time, so var(--x) needs --x defined on the element or an ancestor. A value theme_defaults supplies is a global token: defining it at :root / :host makes it inherit to every element and stay globally overridable, whereas defining it on the element-scoped rule that happens to reference it would confine and shadow it.
add_var_fallbacks lookup stylesheet gives every var(--name) reference in stylesheet that has no fallback of its own the value lookup "--name" answers, as its fallback, in every declaration a custom property's value included. A reference that already carries a fallback keeps it, and the references inside that fallback are given theirs, so var(--a, var(--b)) can become var(--a, var(--b, 1px)). A name lookup does not answer, and an answer that is not a CSS Syntax 3 (ED) sec. 7.2 <declaration-value>, leave the reference as it was.
This is how a sheet whose tokens are declared somewhere else still resolves each one where no declaration reaches it: CSS Variables 1 sec. 3 substitutes the fallback for a custom property left at its guaranteed-invalid initial value, and a declared one still wins. Unlike resolve_theme, no reference is inlined and no definition is emitted.
decode_import_url s strips the url(...) wrapper and any surrounding quotes from an @import URL string as held in Stylesheet.import_rule.url. The parser preserves the verbatim source form there for round-tripping; this helper recovers the bare URL.
val inline_imports :
?query:Context.query ->
?layer_order:string list ->
Context.loader ->
t ->
tinline_imports ?query ?layer_order loader stylesheet replaces every @import rule in stylesheet with the body of the imported stylesheet looked up through loader. Imports the loader cannot resolve, or that fail their media/supports/layer guard, are left in place. The walk descends into nested at-rules and rule bodies, so imports declared inside them are inlined too; the caller is responsible for preloading loader.imports with every transitively-referenced stylesheet body.
type will_change = Properties.will_change = | Will_change_auto| Scroll_position| Contents| Transform| Opacity| Properties of string listCustom CSS property names
*)| Initial| Inherit| Unset| Revert| Revert_layer| Var of will_change varCSS will-change property values for performance optimization hints.
will_change value is the will-change property for performance optimization.
val inline_style_of_declarations :
?optimize:bool ->
?minify:bool ->
?mode:mode ->
declaration list ->
stringinline_style_of_declarations declarations converts a list of declarations to an inline style string.
pp_length ?always is the pretty printer for length values. When always is true, units are always included even for zero values.
val pp_font_weight : font_weight Pp.tpp_font_weight is the pretty printer for font-weight values.
val pp_gradient_direction : gradient_direction Pp.tpp_gradient_direction is the pretty printer for gradient directions.
val pp_calc :
?unwrap_num:bool ->
?unwrap:('a -> bool) ->
?pp_unwrapped:'a Pp.t ->
'a Pp.t ->
'a calc Pp.tpp_calc ?unwrap_num ?unwrap ?pp_unwrapped pp_value is the pretty printer for calc expressions. pp_unwrapped writes the one leaf that comes out of the call, which is no longer an operand; it defaults to pp_value. Minified output drops the call around a single leaf, and unwrap says which leaves that is safe for. unwrap_num is the same question for a bare number leaf, which a property taking an <integer> answers no to.
val pp_font_style : font_style Pp.tpp_font_style is the pretty printer for font-style values.
val pp_text_align : text_align Pp.tpp_text_align is the pretty printer for text-align values.
val pp_text_decoration : text_decoration Pp.tpp_text_decoration is the pretty printer for text-decoration values.
val pp_text_transform : text_transform Pp.tpp_text_transform is the pretty printer for text-transform values.
val pp_text_wrap_mode : text_wrap_mode Pp.tpp_text_wrap_mode is the pretty printer for text-wrap-mode values.
val pp_text_wrap_style : text_wrap_style Pp.tpp_text_wrap_style is the pretty printer for text-wrap-style values.
val pp_text_box_trim : text_box_trim Pp.tpp_text_box_trim is the pretty printer for text-box-trim values.
val pp_text_spacing_trim : text_spacing_trim Pp.tpp_text_spacing_trim is the pretty printer for text-spacing-trim values.
val pp_hyphenate_limit_chars : hyphenate_limit_chars Pp.tpp_hyphenate_limit_chars is the pretty printer for hyphenate-limit-chars values.
val pp_initial_letter : initial_letter Pp.tpp_initial_letter is the pretty printer for initial-letter values.
val pp_border_spacing : border_spacing Pp.tpp_border_spacing is the pretty printer for border-spacing values.
val pp_border_style : border_style Pp.tpp_border_style is the pretty printer for border-style values.
val pp_outline_style : outline_style Pp.tpp_outline_style is the pretty printer for outline-style values.
val pp_scroll_snap_strictness : scroll_snap_strictness Pp.tpp_scroll_snap_strictness is the pretty printer for scroll-snap-strictness values.
val pp_flex_direction : flex_direction Pp.tpp_flex_direction is the pretty printer for flex-direction values.
val pp_flex_factor : flex_factor Pp.tpp_flex_factor is the pretty printer for flex factor values.
val pp_align_items : align_items Pp.tpp_align_items is the pretty printer for align-items values.
val pp_justify_content : justify_content Pp.tpp_justify_content is the pretty printer for justify-content values.
media_min_width_length l creates a min-width media condition from a CSS length. Bridges the type gap between Css.length and Media's internal length type.
media_not_min_width_length l creates a negated min-width media condition from a CSS length.
parse_length s parses a CSS length string (including calc() expressions) using the CSS reader. Returns None if parsing fails.
parse_color s parses a CSS color string (e.g., "rgba(48,163,0,0.14)", "oklch(0.5 0.2 240)") using the CSS reader. Returns None if parsing fails.
parse_shadow s parses a CSS shadow string, including comma-separated multi-shadow values. Returns None if parsing fails.
parse_font_family s parses a CSS font-family value: a single family, a generic keyword, or a comma-separated stack. Returns None if parsing fails.
parse_list_style_type s parses a CSS list-style-type value (a counter style keyword, a string, or symbols()). Returns None if parsing fails.
parse_list_style_image s parses a CSS list-style-image value (none, a url(), or a gradient). Returns None if parsing fails.
parse_background_image s parses a CSS background-image value, including comma-separated multiple images. Returns None if parsing fails.