Skip to main content

normalize_decl

Function normalize_decl 

Source
pub fn normalize_decl<'a>(decl: StyleDecl<'a>) -> StyleProp<'a>
Expand description

Normalize a style declaration into a typed StyleProp

ยงExamples

use neutron_engine::{normalize_decl, StyleDecl, StyleProp};
 
let decl = StyleDecl { name: "b", value: "#000" };
let prop = normalize_decl(decl);
 
match prop {
    StyleProp::Background(color) => assert_eq!(color, "#000"),
    _ => panic!("Expected Background"),
}