Module Css_gen
A set of functions to generate css declaration lists. This library can be used to programmatically produce strings suitable for the HTML style attribute, e.g. style="display:flex;background-color:red".
val sexp_of_css_global_values : css_global_values -> Ppx_sexp_conv_lib.Sexp.tval css_global_values_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> css_global_valuesval __css_global_values_of_sexp__ : Ppx_sexp_conv_lib.Sexp.t -> css_global_valuesval compare_css_global_values : css_global_values -> css_global_values -> int
module Color : sig ... endmodule Length : sig ... endmodule Auto_or_length : sig ... endinclude Ppx_sexp_conv_lib.Sexpable.S with type t := t
val t_of_sexp : Sexplib0.Sexp.t -> tval sexp_of_t : t -> Sexplib0.Sexp.t
include Bin_prot.Binable.S with type t := t
include Bin_prot.Binable.S_only_functions with type t := t
val bin_size_t : t Bin_prot.Size.sizerval bin_write_t : t Bin_prot.Write.writerval bin_read_t : t Bin_prot.Read.readerval __bin_read_t__ : (int -> t) Bin_prot.Read.readerThis function only needs implementation if
texposed to be a polymorphic variant. Despite what the type reads, this does *not* produce a function after reading; instead it takes the constructor tag (int) before reading and reads the rest of the varianttafterwards.
val bin_shape_t : Bin_prot.Shape.tval bin_writer_t : t Bin_prot.Type_class.writerval bin_reader_t : t Bin_prot.Type_class.readerval bin_t : t Bin_prot.Type_class.t
val create : field:string -> value:string -> tCreate a single property, value pair (a declaration in CSS parlance). The value must be a valid CSS literal. We do run a simple CSS parser on the value to validate this and will throw an exception if that parser fails. Note that the parser is less forgiving than many browsers. That is browsers will silently accept or drop many illegal constructs. We prefer to raise on them, so that errors are detected earlier.
It is recommended to use one of the other constructors instead if they are available. If they are not, consider adding them to this library.
val empty : tval is_empty : t -> boolval position : ?top:Length.t -> ?bottom:Length.t -> ?left:Length.t -> ?right:Length.t -> [ `Static | `Absolute | `Sticky | `Relative | `Fixed ] -> tSet the position attribute and optionally top, bottom,left,right Note that left and top have no effect when position is `Static.
val combine : t -> t -> tNeither
combinenorconcatvalidate that eachtis unique. Forcombine x y,ywill overridexif they are the same attribute. Forconcat l, the greatest index of an attribute will prevail.
val (@>) : t -> t -> tval concat : t list -> tval to_string_list : t -> (string * string) listval to_string_css : t -> stringval of_string_css_exn : string -> tThe inverse of to_string_css. Primarily useful if you want to reuse a css literal from the web (aka copy paste web design). Raises if the string fails validation. See create for comments on the validation we do.
val box_sizing : [ `Content_box | `Border_box | css_global_values ] -> tval display : [ `Inline | `Block | `Inline_block | `List_item | `Table | `Inline_table | `None | css_global_values ] -> tval visibility : [ `Visible | `Hidden | `Collapse | css_global_values ] -> t
type overflow=[|`Visible|`Hidden|`Scroll|`Auto|css_global_values]
val overflow : overflow -> tval overflow_x : overflow -> tval overflow_y : overflow -> tval z_index : int -> tval opacity : float -> t
type font_style=[|`Normal|`Italic|`Oblique|css_global_values]type font_weight=[|`Normal|`Bold|`Bolder|`Lighter|`Number of int|css_global_values]type font_variant=[|`Normal|`Small_caps|css_global_values]
val font_size : Length.t -> tval font_family : string list -> tval font_style : font_style -> tval font_weight : font_weight -> tval font_variant : font_variant -> tval font : size:Length.t -> family:string list -> ?style:font_style -> ?weight:font_weight -> ?variant:font_variant -> unit -> tval bold : tval color : Color.t -> tval background_color : Color.t -> tval text_align : [ `Left | `Right | `Center | `Justify | css_global_values ] -> tval horizontal_align : [ `Left | `Right | `Center | css_global_values ] -> tval vertical_align : [ `Top | `Bottom | `Middle | css_global_values ] -> tval white_space : [ `Normal | `Nowrap | `Pre | `Pre_line | `Pre_wrap | css_global_values ] -> tval float : [ `None | `Left | `Right | css_global_values ] -> tval width : Length.t -> tval min_width : Length.t -> tval max_width : Length.t -> tval height : Length.t -> tval min_height : Length.t -> tval max_height : Length.t -> tval padding_top : Length.t -> tval padding_bottom : Length.t -> tval padding_left : Length.t -> tval padding_right : Length.t -> tval uniform_padding : Length.t -> tval padding : ?top:Length.t -> ?bottom:Length.t -> ?left:Length.t -> ?right:Length.t -> unit -> tval margin_top : Auto_or_length.t -> tval margin_bottom : Auto_or_length.t -> tval margin_left : Auto_or_length.t -> tval margin_right : Auto_or_length.t -> tval uniform_margin : Auto_or_length.t -> tval margin : ?top:Auto_or_length.t -> ?bottom:Auto_or_length.t -> ?left:Auto_or_length.t -> ?right:Auto_or_length.t -> unit -> t
type border_style=[|`None|`Hidden|`Dotted|`Dashed|`Solid|`Double|`Groove|`Ridge|`Inset|`Outset|css_global_values]
val border_top : ?width:Length.t -> ?color:Color.t -> style:border_style -> unit -> tval border_bottom : ?width:Length.t -> ?color:Color.t -> style:border_style -> unit -> tval border_left : ?width:Length.t -> ?color:Color.t -> style:border_style -> unit -> tval border_right : ?width:Length.t -> ?color:Color.t -> style:border_style -> unit -> tval border : ?width:Length.t -> ?color:Color.t -> style:border_style -> unit -> tval border_radius : Length.t -> tval border_collapse : [ `Separate | `Collapse | css_global_values ] -> tval border_spacing : Length.t -> tval outline : ?width:Length.t -> ?color:Color.t -> style:border_style -> unit -> t
type text_decoration_line=[|`None|`Underline|`Overline|`Line_through|css_global_values]type text_decoration_style=[|`Solid|`Double|`Dotted|`Dashed|`Wavy|css_global_values]
val text_decoration : ?style:text_decoration_style -> ?color:Color.t -> line:text_decoration_line list -> unit -> t
val flex_container : ?inline:bool -> ?direction:[ `Row | `Row_reverse | `Column | `Column_reverse ] -> ?wrap:[ `Nowrap | `Wrap | `Wrap_reverse ] -> ?align_items:item_alignment -> unit -> tval flex_item : ?order:int -> ?basis:Auto_or_length.t -> ?shrink:float -> grow:float -> unit -> tval align_self : item_alignment -> tval animation : name:string -> duration:Core_kernel.Time_ns.Span.t -> ?delay:Core_kernel.Time_ns.Span.t -> ?direction:[ `Normal | `Reverse | `Alternate | `Alternate_reverse | css_global_values ] -> ?fill_mode:[ `None | `Forwards | `Backwards | `Both | css_global_values ] -> ?iter_count:int -> ?timing_function:string -> unit -> tNote: You must include the
names @keyframes in the stylesheet
module Stable : sig ... end