package ppx_css
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
A ppx that takes in css strings and produces a module for accessing the unique names defined within
Install
dune-project
Dependency
Authors
Maintainers
Sources
v0.17.0.tar.gz
sha256=e60e31aadd820b131f7f05827f369164564400bd4fd51c199d066abf7e68753f
doc/CHANGES.html
Release v0.17.0
ppx_csscan now be embedded within an OCaml expression, spiritually similar to styled components:
Vdom.Node.div ~attrs:[ [%css {|
background-color: tomato;
min-width: 2rem;
min-height: 2rem;
|}] ] []ppx_cssnow has an interpolation syntax similar to ppx_string's 's inteporlation syntax:
let f (color : string) =
Vdom.Node.div ~attrs:[ [%css {|
border: 0.3rem solid %{color};
|}] ] []ppx_cssnow supports Nested CSS, including the&selector:
[%css {|
background-color: tomato;
&:hover {
background-color: red;
}
|}]ppx_css's embedded OCaml now interacts nicely with merlin- Added
Variables.set_allfunction to set all of the CSS variables present in appx_cssstylesheet at once. - Added ability to configure caching behavior at the "jbuild" level.
- Fixed a performance regression in
ppx_csswhereppx_cssperformed unnecessary style recomputations. - Fixed a bug where
ppx_cssfalsely claimed a variable was unused. - Fixed a bug in
ppx_csswhere classnames in the expression syntax where not sanitized properly.
Release v0.16.0
ppx_cssnow works on browser versions that don't have access toCSSStyleSheet.ppx_cssnow supports CSS variables.- CSS variables are now hashed.
- A function,
Variables.setis 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 listcan be used to disable hashing behavior.dont_hash_prefixes: string listcan be used to disable hashing behavior based on a prefix.rewrite: (string * string) listcan 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_cssused to generate OCaml stringsval identifier : string, now the identifiers generateval identifier : Vdom.Attr.t. Where the attribute is applied withVdom.Attr.class_orVdom.Attr.iddepending on the identifier that was used. If there are classes and id's with the same name,<identifier>_idand<identifier>_classare generated instead. This was only done for convenience of users that use ppx_css alongside the libraryvirtual_domorbonsai_webthat always calledVdom.Attr.class_orVdom.Attr.id. If you would like to still access the strings directly, they will be contained within newly generatedFor_referencingmodule.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page