def style.present
gralha-svg-render@0.1.0.1 · svg.bend:1065
import gralha-svg-render@0.1.0.1/svg.bend as Svg
import Base
import gralha-text-scan@0.1.0.1/scan.bend as U
1065def style.present(found: Maybe<&2, String>, +fallback: String, +initial: String, +inherited: Bool) -> String:
1066 match found:
1067 case None{}: U.choose(String, inherited, fallback, initial)
1068 case Some{v}:
1069 +vv = v
1070 +k = style.keyword(vv)
1071 U.choose(String, U32.is_eq(k, 1) || (inherited && U32.is_eq(k, 3)), fallback,
1072 U.choose(String, U32.is_eq(k, 2) || U32.is_eq(k, 3), initial, vv))