package ppx_css

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

This module parses a call to ppx_css into nicer parts to make the implementation of ppx_css cleaner.

type t = {
  1. rewrite : Ppxlib.expression Core.String.Map.t;
    (*

    For a given (key, value) pair, value will "rewrite" itself wherever "key" is roughly: s/$key/$value/g

    Equivalent to the ~rewrite parameter in the call to stylesheet on ppx_css.

    *)
  2. css_string : String_constant.t;
    (*

    The contained CSS string. Equivalent to the string parameter given to ppx_css.

    *)
  3. dont_hash_prefixes : string list;
}
val parse_stylesheet : Ppxlib.expression -> t

Given the AST of an expression like stylesheet ~rewrite:[] "" will result in a "parsed" t.

stylesheet is the %css stylesheet {|stylesheet...|} syntax and expands to a module declaration.

val parse_inline_expression : Ppxlib.expression -> t

Given the AST of an expression like "" ~rewrite:[] will result in a "parsed" t

inline is the syntax %css {|declarations...|} and expands to an expression.

val empty_stylesheet : css_string:String_constant.t -> t
module Serializable_options : sig ... end
module Preprocess_arguments : sig ... end

This module contains the parameters sent in via the jbuild/dune file's preprocess field.

OCaml

Innovation. Community. Security.