Up

module Css

: sig

Single element

#
type elt =
# | Str of string
# | Fun of string * expr list
#
type expr = elt list

Expression: `.body a:hover`. No commas here.

#
type prop_decl =
# | Prop of string * expr list
# | Decl of expr list * prop_decl list

We allow nested declarations

#
type t =
# | Props of prop_decl list
# | Exprs of expr list

The type of CSS fragment

#
val to_string : t -> string

Print CSS to a string suitable for rendering

Getters

#
val expr : t -> expr
#
val exprs : t -> expr list
#
val props : t -> prop_decl list
#
val string : t -> string

Helpers

#
val unroll : t -> t

transform a fragment with nested declarations into an equivalent fragment with only root declarations

CSS library

#
val gradient : low:t -> high:t -> t

Emit a CSS gradient style that linearly interpolates between the low and high colors

#
val top_rounded : t

Emit a border style that rounds off the top border by 0.5em pixels.

#
val top_rounded : t

Emit a border style that rounds off the bottom border by 0.5em pixels.

#
val bottom_rounded : t

Emit a border style that rounds off all the borders by 0.5em pixels.

#
val rounded : t
#
val box_shadow : t
#
val text_shadow : t
#
val no_padding : t
#
val reset_padding : t
#
val bottom_rounded : t
#
val rounded : t
#
val box_shadow : t
#
val text_shadow : t
#
val no_padding : t
#
val reset_padding : t
end