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

CSS Font Weight Normalizer

Build a tool that normalizes CSS stylesheets by converting font-weight keyword values to their numeric equivalents.

Requirements

Your tool should process CSS input and convert font-weight values according to standard CSS specifications:

  • Convert keyword values to their numeric equivalents
  • Preserve other CSS properties unchanged
  • Return the processed CSS as a string

The tool should handle:

  • CSS provided as strings
  • Multiple rulesets in a single stylesheet
  • Mixed keyword and numeric font-weight values
  • Other CSS properties that should remain unchanged

Test Cases

  • Given CSS with font-weight: normal, it converts to font-weight: 400 @test
  • Given CSS with font-weight: bold, it converts to font-weight: 700 @test
  • Given CSS with multiple rulesets containing various font-weight keywords, it converts all keywords to numeric values @test
  • Given CSS with numeric font-weight values already present, it preserves them unchanged @test

Implementation

@generates

API

/**
 * Normalizes CSS by converting font-weight keywords to numeric values.
 *
 * @param {string} css - The CSS string to process
 * @returns {string} The processed CSS with normalized font-weight values
 */
function normalizeFontWeights(css) {
  // IMPLEMENTATION HERE
}

module.exports = { normalizeFontWeights };

Dependencies { .dependencies }

clean-css { .dependency }

Provides CSS optimization and minification capabilities.

tile.json