package css

  1. Overview
  2. Docs
module Log : sig ... end

Logging

module T : sig ... end

Types and base definitions.

module U : sig ... end

Utilities for parsing.

module Vp : sig ... end

Value parsers.

module S : sig ... end

Statements.

module Sp : sig ... end

Statement parsers.

module P : sig ... end

Properties

module Sh : sig ... end

Shorthand properties.

module C : sig ... end

Computing values.

module Kw : sig ... end

All case-sensitive keywords

type 'ns css = 'ns S.statement list

A CSS structure is a list of S.statements.

val parse_string : ?prop_space:(module P.Prop_space) -> ?fname:string -> string -> string css

parse_string string parses the given string, 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. Raises T.Error in case of error.

type namespaces = Iri.t T.Smap.t

Namespaces map strings to IRIs.

val 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.

val 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.

val pp_string_css : Stdlib.Format.formatter -> string css -> unit

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

val pp_iri_css : Stdlib.Format.formatter -> Iri.t css -> unit

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

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

Innovation. Community. Security.