Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
@types/clean-css
Advanced tools
@types/clean-css provides TypeScript type definitions for the clean-css library, which is a fast and efficient CSS optimizer for reducing the size of CSS files.
Minify CSS
This feature allows you to minify CSS code, reducing its size and improving load times. The code sample demonstrates how to use clean-css to minify a simple CSS string.
const CleanCSS = require('clean-css');
const input = 'a { font-weight: bold; }';
const output = new CleanCSS().minify(input);
console.log(output.styles);
Advanced Optimizations
This feature provides advanced optimization options for more aggressive CSS minification. The code sample shows how to use level 2 optimizations to further reduce the size of the CSS.
const CleanCSS = require('clean-css');
const input = 'a { color: #ff0000; }';
const options = { level: 2 };
const output = new CleanCSS(options).minify(input);
console.log(output.styles);
Source Maps
This feature allows you to generate source maps for the minified CSS, which can be useful for debugging. The code sample demonstrates how to enable source map generation.
const CleanCSS = require('clean-css');
const input = 'a { font-weight: bold; }';
const options = { sourceMap: true };
const output = new CleanCSS(options).minify(input);
console.log(output.sourceMap);
CSSO (CSS Optimizer) is another CSS minifier that focuses on structural optimization of CSS. It offers similar functionalities to clean-css but with a different optimization algorithm.
UglifyCSS is a CSS minifier that is designed to be simple and fast. It provides basic minification capabilities similar to clean-css but lacks some of the advanced optimization features.
cssnano is a modern CSS minifier that uses PostCSS to transform and optimize CSS. It offers a wide range of plugins for different optimization tasks, making it more flexible compared to clean-css.
npm install --save @types/clean-css
This package contains type definitions for clean-css ( https://github.com/jakubpawlowicz/clean-css ).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/clean-css/v3
Additional Details
These definitions were written by Tanguy Krotoff https://github.com/tkrotoff.
FAQs
TypeScript definitions for clean-css
The npm package @types/clean-css receives a total of 274,324 weekly downloads. As such, @types/clean-css popularity was classified as popular.
We found that @types/clean-css demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.