Installations
npm install @pumpn/cssnano-preset-default
Developer Guide
Typescript
No
Module System
CommonJS
Min. Node Version
^10 || ^12 || >=14.0
Node Version
16.6.1
NPM Version
7.20.3
Score
44.6
Supply Chain
79
Quality
74.3
Maintenance
100
Vulnerability
99.3
License
Releases
Contributors
Languages
CSS (77.39%)
JavaScript (22.14%)
Nunjucks (0.46%)
Developer
Download Statistics
Total Downloads
1,116
Last Day
1
Last Week
3
Last Month
24
Last Year
163
GitHub Statistics
4,811 Stars
2,540 Commits
319 Forks
49 Watching
41 Branches
109 Contributors
Package Meta Information
Latest Version
5.6.0
Package Id
@pumpn/cssnano-preset-default@5.6.0
Unpacked Size
17.14 kB
Size
4.21 kB
File Count
4
NPM Version
7.20.3
Node Version
16.6.1
Total Downloads
Cumulative downloads
Total Downloads
1,116
Last day
0%
1
Compared to previous day
Last week
-76.9%
3
Compared to previous week
Last month
700%
24
Compared to previous month
Last year
-50.2%
163
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
29
Peer Dependencies
1
Dev Dependencies
1
cssnano-preset-default
Safe defaults for cssnano which require minimal configuration.
Table of Contents
-
- css-declaration-sorter (external)
- cssnano-utils
- postcss-calc (external)
- postcss-colormin
- postcss-convert-values
- postcss-discard-comments
- postcss-discard-duplicates
- postcss-discard-empty
- postcss-discard-overridden
- postcss-merge-longhand
- postcss-merge-rules
- postcss-minify-font-values
- postcss-minify-gradients
- postcss-minify-params
- postcss-minify-selectors
- postcss-normalize-charset
- postcss-normalize-display-values
- postcss-normalize-positions
- postcss-normalize-repeat-style
- postcss-normalize-string
- postcss-normalize-timing-functions
- postcss-normalize-unicode
- postcss-normalize-url
- postcss-normalize-whitespace
- postcss-ordered-values
- postcss-reduce-initial
- postcss-reduce-transforms
- postcss-svgo
- postcss-unique-selectors
Overview
This default preset for cssnano only includes transforms that make no assumptions about your CSS other than what is passed in. In previous iterations of cssnano, assumptions were made about your CSS which caused output to look different in certain use cases, but not others. These transforms have been moved from the defaults to other presets, to make this preset require only minimal configuration.
Usage
Install
Note that this preset comes bundled with cssnano by default, so you don't need to install it separately.
Configuration
If you would like to use the default configuration, then you don't need to add anything to your package.json
.
But should you wish to customise this, you can pass an array with the second parameter as the options object to use. For example, to remove all comments:
1 { 2 "name": "awesome-application", 3+ "cssnano": { 4+ "preset": [ 5+ "default", 6+ {"discardComments": {"removeAll": true}} 7+ ] 8+ } 9 }
Depending on your usage, the JSON configuration might not work for you, such as in cases where you would like to use options with customisable function parameters. For this use case, we recommend a cssnano.config.js
at the same location as your package.json
. You can then load a preset and export it with your custom parameters:
1const defaultPreset = require('cssnano-preset-default'); 2 3module.exports = defaultPreset({ 4 discardComments: { 5 remove: (comment) => comment[0] === '@', 6 }, 7});
Note that you may wish to publish your own preset to npm for reusability, should it differ a lot from this one. This is highly encouraged!
Plugins
css-declaration-sorter
(external)
Sorts CSS declarations fast and automatically in a certain order.
This plugin is loaded with the following configuration:
1{ 2 keepOverrides: true 3}
cssnano-utils
Utility methods used by cssnano
postcss-calc
(external)
PostCSS plugin to reduce calc()
This plugin is loaded with its default configuration.
postcss-colormin
Minify colors in your CSS files with PostCSS.
This plugin is loaded with its default configuration.
postcss-convert-values
Convert values with PostCSS (e.g. ms -> s)
This plugin is loaded with the following configuration:
1{ 2 length: false; 3}
postcss-discard-comments
Discard comments in your CSS files with PostCSS.
This plugin is loaded with its default configuration.
postcss-discard-duplicates
Discard duplicate rules in your CSS files with PostCSS.
This plugin is loaded with its default configuration.
postcss-discard-empty
Discard empty rules and values with PostCSS.
This plugin is loaded with its default configuration.
postcss-discard-overridden
PostCSS plugin to discard overridden @keyframes or @counter-style.
This plugin is loaded with its default configuration.
postcss-merge-longhand
Merge longhand properties into shorthand with PostCSS.
This plugin is loaded with its default configuration.
postcss-merge-rules
Merge CSS rules with PostCSS.
This plugin is loaded with its default configuration.
postcss-minify-font-values
Minify font declarations with PostCSS
This plugin is loaded with its default configuration.
postcss-minify-gradients
Minify gradient parameters with PostCSS.
This plugin is loaded with its default configuration.
postcss-minify-params
Minify at-rule params with PostCSS
This plugin is loaded with its default configuration.
postcss-minify-selectors
Minify selectors with PostCSS.
This plugin is loaded with its default configuration.
postcss-normalize-charset
Add necessary or remove extra charset with PostCSS
This plugin is loaded with the following configuration:
1{ 2 add: false; 3}
postcss-normalize-display-values
Normalize multiple value display syntaxes into single values.
This plugin is loaded with its default configuration.
postcss-normalize-positions
Normalize keyword values for position into length values.
This plugin is loaded with its default configuration.
postcss-normalize-repeat-style
Convert two value syntax for repeat-style into one value.
This plugin is loaded with its default configuration.
postcss-normalize-string
Normalize wrapping quotes for CSS string literals.
This plugin is loaded with its default configuration.
postcss-normalize-timing-functions
Normalize CSS animation/transition timing functions.
This plugin is loaded with its default configuration.
postcss-normalize-unicode
Normalize unicode-range descriptors, and can convert to wildcard ranges.
This plugin is loaded with its default configuration.
postcss-normalize-url
Normalize URLs with PostCSS
This plugin is loaded with its default configuration.
postcss-normalize-whitespace
Trim whitespace inside and around CSS rules & declarations.
This plugin is loaded with its default configuration.
postcss-ordered-values
Ensure values are ordered consistently in your CSS.
This plugin is loaded with its default configuration.
postcss-reduce-initial
Reduce initial definitions to the actual initial value, where possible.
This plugin is loaded with its default configuration.
postcss-reduce-transforms
Reduce transform functions with PostCSS.
This plugin is loaded with its default configuration.
postcss-svgo
Optimise inline SVG with PostCSS.
This plugin is loaded with its default configuration.
postcss-unique-selectors
Ensure CSS selectors are unique.
This plugin is loaded with its default configuration.
Contributors
See CONTRIBUTORS.md.
License
MIT © Ben Briggs
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
GitHub workflow tokens follow principle of least privilege
Details
- Info: topLevel 'contents' permission set to 'read': .github/workflows/publish.yml:3
- Info: found token with 'none' permissions: .github/workflows/test.yml:1
- Info: no jobLevel write permissions found
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE-MIT:0
- Info: FSF or OSI recognized license: MIT License: LICENSE-MIT:0
Reason
packaging workflow detected
Details
- Info: Project packages its releases by way of GitHub Actions.: .github/workflows/publish.yml:9
Reason
10 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 9
Reason
SAST tool is not run on all commits -- score normalized to 8
Details
- Warn: 26 commits out of 29 are checked with a SAST tool
Reason
4 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55
- Warn: Project is vulnerable to: GHSA-566m-qj78-rww5
- Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
Reason
Found 3/23 approved changesets -- score normalized to 1
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/cssnano/cssnano/publish.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/cssnano/cssnano/publish.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/cssnano/cssnano/publish.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/cssnano/cssnano/test.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/cssnano/cssnano/test.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/cssnano/cssnano/test.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/cssnano/cssnano/test.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/cssnano/cssnano/test.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/cssnano/cssnano/test.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:66: update your workflow using https://app.stepsecurity.io/secureworkflow/cssnano/cssnano/test.yml/master?enable=pin
- Info: 0 out of 6 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 4 third-party GitHubAction dependencies pinned
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Score
6.3
/10
Last Scanned on 2024-12-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More