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-6/

CSS Validator

A command-line tool that validates CSS files and reports any invalid properties found in the stylesheets.

Capabilities

CSS File Validation

  • It processes a CSS file and reports invalid properties @test
  • It identifies multiple invalid properties in a single stylesheet @test
  • It handles CSS with valid properties without reporting errors @test
  • It processes empty CSS files without errors @test

Validation Output

  • It outputs a list of invalid property names found @test
  • It returns an empty array when no invalid properties are found @test

Implementation

@generates

The tool should accept CSS content as a string and return an array of invalid property names found in the stylesheet. The function should leverage CSS processing capabilities to identify properties that don't conform to CSS specifications.

API

/**
 * Validates CSS content and returns an array of invalid property names.
 *
 * @param {string} cssContent - The CSS content to validate
 * @returns {Array<string>} Array of invalid property names found
 */
function validateCSS(cssContent) {
  // IMPLEMENTATION HERE
}

module.exports = { validateCSS };

Test Cases

Test Case 1: Detect Single Invalid Property

Input CSS:

.box {
  colr: red;
  padding: 10px;
}

Expected Output:

['colr']

Test Case 2: Detect Multiple Invalid Properties

Input CSS:

.container {
  widht: 100px;
  heigth: 200px;
  background-color: blue;
}

Expected Output:

['widht', 'heigth']

Test Case 3: Valid CSS Returns Empty Array

Input CSS:

.valid {
  color: blue;
  width: 100px;
  margin: 20px;
}

Expected Output:

[]

Dependencies { .dependencies }

clean-css { .dependency }

Provides CSS minification and validation capabilities.

tile.json