package styled-ppx
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Type-safe styled components for ReScript and Melange
Install
dune-project
Dependency
Authors
Maintainers
Sources
styled-ppx-0.61.0.tbz
sha256=c6eba770e9e9bb9002bf3f759f99ebcec6d7b4132c6c2ad562886c88b6839bab
sha512=8a1776181f6ef292518a0b96b1fae7927cf5767dee75dc04bc05d99d297866e45a5943455bea9ce500a04a635bd179d2b2bec8bccebc55dc1e696a23b3efad69
doc/src/styled-ppx.native/Rule.ml.html
Source file Rule.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29type rule = | Declaration of string * string | Selector of string array * rule array let camel_case_to_kebab_case str = let len = String.length str in let extra_space_for_dashes = 10 in let buffer = Buffer.create (len + extra_space_for_dashes) in for i = 0 to len - 1 do let c = str.[i] in match c with | 'A' .. 'Z' -> Buffer.add_char buffer '-'; Buffer.add_char buffer (Char.lowercase_ascii c) | _ -> Buffer.add_char buffer c done; Buffer.contents buffer let declaration (property, value) = Declaration (camel_case_to_kebab_case property, value) let selector selector rules = Selector ([| selector |], rules) let selectorMany selector_list rules = Selector (selector_list, rules) let media query rules = Selector ([| {|@media |} ^ query |], rules) let important v = match v with | Declaration (name, value) -> Declaration (name, value ^ {js| !important|js}) | Selector (_, _) -> v
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>