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

CSS Minifier with Source Map Support

Build a CSS minification tool that processes CSS files from remote URLs and generates source maps that reference the original remote sources.

Requirements

Your tool should accept a remote CSS file URL and minify it while generating an accurate source map that traces back to the original remote source.

Input Processing

  • Accept a remote CSS URL (HTTP/HTTPS) as input
  • Fetch and process the remote CSS content
  • Handle any existing source maps associated with the remote CSS file

Output Generation

  • Generate minified CSS output
  • Produce a source map that correctly references the remote source location
  • Ensure the source map maintains accurate line and column mappings

Error Handling

  • Handle network errors gracefully (e.g., unreachable URLs)
  • Validate that the fetched content is valid CSS
  • Report errors through the output structure

Test Cases

  • It successfully minifies a remote CSS file and generates a source map @test
  • It handles existing remote source maps and chains them correctly @test
  • It reports errors when the remote URL is unreachable @test

Implementation

@generates

API

/**
 * Minifies CSS from a remote URL and generates a source map.
 *
 * @param {string} url - The remote URL of the CSS file to minify
 * @param {Object} options - Configuration options
 * @returns {Promise<Object>} Result object containing minified CSS, source map, and any errors
 */
async function minifyRemote(url, options = {}) {
  // IMPLEMENTATION HERE
}

module.exports = { minifyRemote };

Dependencies { .dependencies }

clean-css { .dependency }

Provides CSS minification with source map support and remote resource fetching capabilities.

tile.json