def css.nth

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

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

155def css.nth(+s: String, +index: U32) -> Bool:
156  +value = css.lower(css.compact(s))
157  U.choose(Bool, U.string.equal(value, "odd"), U32.is_eq(U32.mod(index, 2), 1),
158    U.choose(Bool, U.string.equal(value, "even"), U32.is_eq(U32.mod(index, 2), 0), css.nth.formula(css.scan(value, 110), index)))

Uses (11)

Used by (1)