MCPcopy Create free account
hub / github.com/Stranger6667/css-inline / keep_at_rules

Function keep_at_rules

css-inline/tests/test_inlining.rs:1094–1112  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1092
1093#[test]
1094fn keep_at_rules() {
1095 let inliner = CSSInliner::options().keep_at_rules(true).build();
1096 let html = r#"
1097<html>
1098<head>
1099<style>
1100h1 { color: blue; }
1101@media (max-width: 600px) { h1 { font-size: 18px; } }
1102p { margin: 10px; }
1103</style>
1104</head>
1105<body>
1106<h1>Hello</h1><p>World</p>
1107</body>
1108</html>"#;
1109 let inlined = inliner.inline(html).unwrap();
1110 let expected = "<html><head><style>@media (max-width: 600px) { h1 { font-size: 18px; } } </style>\n\n</head>\n<body>\n<h1 style=\"color: blue;\">Hello</h1><p style=\"margin: 10px;\">World</p>\n\n</body></html>";
1111 assert_eq!(inlined, expected);
1112}
1113
1114#[test]
1115fn minify_css() {

Callers

nothing calls this directly

Calls 3

keep_at_rulesMethod · 0.80
buildMethod · 0.45
inlineMethod · 0.45

Tested by

no test coverage detected