CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-clean-css

A well-tested CSS minifier providing fast and efficient CSS optimization and minification.

93

1.17x

Quality

Pending

Does it follow best practices?

Impact

93%

1.17x

Average score across 10 eval scenarios

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

task.mdevals/scenario-8/

CSS Selector Optimizer

A tool that optimizes CSS selectors by applying various transformations to reduce file size while maintaining functionality.

Capabilities

Handles basic nth-child optimizations

  • When given CSS with nth-child(1), the optimizer converts it to first-child @test
  • When given CSS with nth-last-child(1), the optimizer converts it to last-child @test

Handles nth-of-type optimizations

  • When given CSS with nth-of-type(1), the optimizer converts it to first-of-type @test
  • When given CSS with nth-last-of-type(1), the optimizer converts it to last-of-type @test

Preserves complex nth-child patterns

  • When given CSS with nth-child(2n), the optimizer preserves it unchanged @test
  • When given CSS with nth-child(odd), the optimizer preserves it unchanged @test

Handles multiple selectors in a stylesheet

  • When given a stylesheet with multiple different nth-child/nth-of-type patterns, the optimizer correctly processes all applicable transformations @test

Implementation

@generates

API

/**
 * Optimizes CSS by applying selector transformations.
 *
 * @param {string} css - The CSS string to optimize.
 * @returns {string} The optimized CSS string.
 */
function optimize(css) {
  // IMPLEMENTATION HERE
}

module.exports = {
  optimize
};

Dependencies { .dependencies }

clean-css { .dependency }

Provides CSS optimization and minification support.

tile.json