Cleaner, Leaner CSS
v1.1.0 (2024-10-24)
✨ Stripped spaces between CSS rules.
Whitespace between CSS rules has been removed for more compact output.
stringifyCSSProperties({
flex: 1,
padding: 20,
backgroundColor: "teal",
});
Before
// Output: "flex:1; padding:20px; background-color:teal;"
After
// Output: "flex:1;padding:20px;background-color:teal;"
🧹 Removed empty CSS rules from the output in stringifyStyleMap.
Previously, passing 'selector': {} resulted in selector{}, but now such rules are excluded from the result.
stringifyStyleMap({
header: { color: "teal" },
main: {},
footer: { color: "teal" },
});
Before
// Output: "header{color:teal;} main{} footer{color:teal;}"
After
// Output: "header{color:teal;}footer{color:teal;}"
✂️ Trimmed unnecessary spaces in CSS selectors.
Extra spaces around combinators (e.g., >, +, ~) are now removed.
stringifyStyleMap({
"#root ul.my-list > li": {
padding: 10,
},
});
Before
// Output: "#root ul.my-list > li{padding:10px;}"
After
// Output: "#root ul.my-list>li{padding:10px;}"
🤖 What's Changed
- Add tests by @arkarlov in #1
- Add test github action by @arkarlov in #6
- Update tests.yml by @arkarlov in #7
- Trim css strings and selectors by @arkarlov in #8
Full Changelog: v1.0.0...v1.1.0