Library
Module
Module type
Parameter
Class
Class type
Properties
Parsed property values, with location and important
flag.
val initial : 'a prop -> 'a
Initial (i.e. default) value of property.
val name : 'a prop -> string
Name of property.
Parser to parser values for the given property.
val inherited : 'a prop -> bool
Whether property is inherited or not.
val to_string : 'a prop -> 'a -> string
to_string p v
applies the property's function passed at its creation to map a value of the type of the property to a string.
value_to_string p v
returns a string representation of the given value for the given property, using T.string_of_p_value
with to_string p
.
val pp : 'a prop -> Stdlib.Format.formatter -> 'a -> unit
Returns the property pretty-printer.
Returns T.pp_p_value
with the pretty-printer for the given property.
val mk_prop :
string ->
?register_prop:bool ->
?inherited:bool ->
'a ->
('a -> string) ->
?pp:(Stdlib.Format.formatter -> 'a -> unit) ->
(T.ctx -> 'a Angstrom.t) ->
'a prop
mk_prop name v to_string parser
creates a new property name
with initial value v
, the to_string
function to map a value to a string and an Angstrom
parser. This parser takes a context T.ctx
and returns a value of the same type as v
or fails to indicate that no value of this type could be parsed. Optional arguments:
register_prop
(default is true
) indicates whether to register the property so that its parser is used when encoutering a declaration with this property in CSS.inherited
(default is false
) specifies whether the value for this property is inherited from parent or not. This is used in computations.pp
can be used to specify a pretty-printing function for values of this property. If none is provided, a default one is created using to_string
.module Key : sig ... end
module M : sig ... end
val empty : 'a M.t
val fold : ('a -> 'b -> 'b) -> 'a M.t -> 'b -> 'b
val iter : ('a -> unit) -> 'a M.t -> unit
val to_list : 'a M.t -> 'a list
val is_var : 'a prop -> bool
module type Prop_space = sig ... end
val mk_prop_space : string -> (module Prop_space)
module Css : Prop_space
Css
space)val accent_color : T.accent_color prop
val align_content : T.align_content prop
val align_items : T.align_items prop
val align_self : T.align_self prop
val aspect_ratio : T.aspect_ratio prop
val background_attachment : T.background_attachment prop
val background_clip : T.background_clip prop
val background_color : T.background_color prop
val background_image : T.background_image prop
val background_origin : T.background_origin prop
val background_position_x : T.background_position_x prop
val background_position_y : T.background_position_y prop
val background_repeat : T.background_repeat prop
val background_size : T.background_size prop
val border_top : T.color prop * T.line_style prop * T.border_width prop
val border_top_style : T.line_style prop
val border_top_width : T.border_width prop
val border_right : T.color prop * T.line_style prop * T.border_width prop
val border_right_style : T.line_style prop
val border_right_width : T.border_width prop
val border_bottom : T.color prop * T.line_style prop * T.border_width prop
val border_bottom_style : T.line_style prop
val border_bottom_width : T.border_width prop
val border_left : T.color prop * T.line_style prop * T.border_width prop
val border_left_style : T.line_style prop
val border_left_width : T.border_width prop
val flex_basis : T.flex_basis prop
val flex_direction : T.flex_direction prop
val flex_wrap : T.flex_wrap prop
val font_family : T.font_family prop
val font_kerning : T.font_kerning prop
val font_size : T.font_size prop
val font_stretch : T.font_stretch prop
val font_style : T.font_style prop
val font_variant_alternates : T.font_variant_alternates prop
val font_variant_caps : T.font_variant_caps prop
val font_variant_east_asian : T.font_variant_east_asian prop
val font_variant_emoji : T.font_variant_emoji prop
val font_variant_ligatures : T.font_variant_ligatures prop
val font_variant_numeric : T.font_variant_numeric prop
val font_variant_position : T.font_variant_position prop
val font_weight : T.font_weight prop
val justify_content : T.justify_content prop
val justify_items : T.justify_items prop
val justify_self : T.justify_self prop
val line_height : T.line_height prop
val list_style_image : T.list_style_image prop
val list_style_position : T.list_style_position prop
val list_style_type : T.list_style_type prop
val max_height : T.max_size prop
val max_width : T.max_size prop
val position : T.position prop
val text_align : T.text_align prop
val text_align_last : T.text_align_last prop
val vertical_align : T.vertical_align prop
val visibility : T.visibility prop
val white_space : T.white_space prop
val word_spacing : T.word_spacing prop