def css.rules.body

gralha-css-style@0.1.0.1 · css.bend:354

import gralha-css-style@0.1.0.1/css.bend as Css
import Base
import gralha-text-scan@0.1.0.1/scan.bend as U

354def css.rules.body(selector: String, scan: U.Scan, w: F32, h: F32,
355  next: String -> List<&2, CSSRule>, nested: String -> List<&2, CSSRule>) -> List<&2, CSSRule>:
356  U.Scan{body, tail} = scan
357  +sel = U.trim.both(selector)
358  +content = body
359  +following = next(U.drop(tail, "}"))
360  U.branch(List<&2, CSSRule>, U.prefix(sel, "@"),
361    _ => U.branch(List<&2, CSSRule>, U.prefix(css.lower(sel), "@media") && css.media(U.drop(sel, "@media"), w, h),
362      _ => css.rules.append(nested(content), following), _ => following),
363    _ => Con{CSSRule{sel, css.declarations(content)}, following})

Uses (14)

Used by (1)