A well-tested CSS minifier providing fast and efficient CSS optimization and minification.
93
Quality
Pending
Does it follow best practices?
Impact
93%
1.17xAverage score across 10 eval scenarios
Pending
The risk profile of this skill
Build a CSS optimization tool that processes CSS files and provides different selector ordering strategies to improve CSS file organization and maintainability.
Create a Node.js module that:
sorted: Orders selectors alphabetically (e.g., .apple, .mango, .zebra)unsorted: Keeps selectors in their original order without sortingCreate two files:
css-optimizer.jsImplement a function optimizeCSS(cssString, options) that:
sortMode property ('sorted' or 'unsorted')styles property containing the optimized CSS stringcss-optimizer.test.js { .test }Write tests that verify:
@test Sorted mode orders selectors alphabetically
const { optimizeCSS } = require('./css-optimizer');
const css = '.zebra { color: red; } .apple { color: blue; } .mango { color: green; }';
const result = optimizeCSS(css, { sortMode: 'sorted' });
// Result should have .apple before .mango before .zebra@test Unsorted mode preserves selector order
const { optimizeCSS } = require('./css-optimizer');
const css = '.zebra { color: red; } .apple { color: blue; }';
const result = optimizeCSS(css, { sortMode: 'unsorted' });
// Result should maintain zebra before appleProvides CSS optimization and minification with selector sorting capabilities.
sorted and unsorted) work correctlydocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10