package ppx_css
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=58a8f237e28c0f223e85552f0f1097c9f7a9682fccee61c593dae32c506926ae
CHANGES.md.html
Release v0.16.0
ppx_css
now works on browser versions that don't have access toCSSStyleSheet
.ppx_css
now supports CSS variables.CSS variables are now hashed.
A function,
Variables.set
is generated whose signature is?variable_name1:string -> ?variable_name2:string -> ... -> Vdom.Attr.t
New flags to control hashing behavior. Syntax is
[%css stylesheet {|...|} ~dont_hash:[] ~dont_hash_prefixes:[] ~rewrite:[]]
.dont_hash: string list
can be used to disable hashing behavior.dont_hash_prefixes: string list
can be used to disable hashing behavior based on a prefix.rewrite: (string * string) list
can be used to override hashing behavior by "rewriting" identifiers (e.g.["a", "b"; "c", "d"]
results in "a" being "rewritten" to "b" and "c" to "d").
Breaking changes:
Renamed the callsite from
[%css.raw {|...|}]
to[%css stylesheet {|...|}]
.ppx_css
used to generate OCaml stringsval identifier : string
, now the identifiers generateval identifier : Vdom.Attr.t
. Where the attribute is applied withVdom.Attr.class_
orVdom.Attr.id
depending on the identifier that was used. If there are classes and id's with the same name,<identifier>_id
and<identifier>_class
are generated instead. This was only done for convenience of users that use ppx_css alongside the libraryvirtual_dom
orbonsai_web
that always calledVdom.Attr.class_
orVdom.Attr.id
. If you would like to still access the strings directly, they will be contained within newly generatedFor_referencing
module.