package css

  1. Overview
  2. Docs

Module CssSource

Sourcemodule Log : sig ... end

Logging

Sourcemodule T : sig ... end

Types and base definitions.

Sourcemodule U : sig ... end

Utilities for parsing.

Sourcemodule Vp : sig ... end

Value parsers.

Sourcemodule S : sig ... end

Statements.

Sourcemodule Sp : sig ... end

Statement parsers.

Sourcemodule P : sig ... end

Properties

Sourcemodule Sh : sig ... end

Shorthand properties.

Sourcemodule C : sig ... end

Computing values.

Sourcemodule Kw : sig ... end

All case-sensitive keywords

Sourcetype 'ns css = 'ns S.statement list

A CSS structure is a list of S.statements.

Sourceval parse_string : ?fname:string -> (T.ctx -> 'a Angstrom.t) -> string -> ('a, string) result

parse_string parser string parses the given string with given parser, creating the required T.ctx to compute locations. Optional argument fname can be used to specify a filename in the fname field of T.pos structures.

Sourceval parse_css : ?prop_space:(module P.Prop_space) -> ?fname:string -> string -> string css

parse_css string will parse the CSS statements in the given string. Optional argument prop_space can be used to specify a property space (default is P.Css). Optional argument fname can be used to specify a filename in the fname field of T.pos structures. Raises T.Error in case of error.

Sourcetype namespaces = Iri.t T.Smap.t

Namespaces map strings to IRIs.

Sourceval expand_ns : ?ns:namespaces -> string css -> Iri.t css

expand_ns css expands the namespaces in the given css, according to the namespace statements in css. Some predefined namespaces can be given with ns optional argument. If not specified, the default namespaces are used.

Sourceval expand_nested : 'a css -> 'a css

expand_nested statements expands nested rules in statements. By now, this expansion handles only nesting rules with a single selector nested.

Sourceval pp_string_css : Format.formatter -> string css -> unit

Pretty-print the given (non-expanded) CSS to the given formatter.

Sourceval pp_iri_css : Format.formatter -> Iri.t css -> unit

Pretty-print the given (with namespaces expanded) CSS to the given formatter.

Sourceval compute_decls : (module P.Prop_space) -> root:C.t -> parent:C.t -> C.t -> P.binding list -> C.t
OCaml

Innovation. Community. Security.