layoutcss_parser/utilities/
bg_img.rs1use indoc::formatdoc;
2use std::collections::HashSet;
3const BG_IMG_STYLE: &str = r#"
4 [layout*="bg-img"]{
5 background-origin: border-box;
6 background-repeat: no-repeat;
7 background-position: center;
8 background-size: cover;
9 }
10"#;
11
12pub fn bg_img_css(value: &str, set: &mut HashSet<String>) {
13 set.insert(BG_IMG_STYLE.to_string());
14 set.insert(formatdoc!(
15 r#"
16 [layout~="bg-img:{value}"]{{
17 background-image: url({value});
18 }}
19 "#
20 ));
21}