squirrelscan
GitHub

Unminified CSS

Detects unminified CSS that could be optimized

Detects unminified CSS that could be optimized

Rule IDperf/unminified-css
CategoryPerformance
ScopePer-page
Severitywarning
Weight4/10

Solution

Minify CSS to reduce file size and improve load times. Use build tools like cssnano, clean-css, or PostCSS with cssnano plugin. Most bundlers (Webpack, Vite, esbuild) can minify CSS automatically in production mode. Minification removes whitespace, comments, and optimizes syntax.

Options

This rule supports the following configuration options:

OptionTypeDefaultDescription
min_size_bytesunknownundefinedMinimum CSS size in bytes to check for minification
newline_ratio_thresholdunknownundefinedNewlines per character ratio threshold for unminified detection

Configuration example

[rules."perf/unminified-css"]
min_size_bytes = undefined
newline_ratio_threshold = undefined

Enable / disable

Disable this rule

[rules]
disable = ["perf/unminified-css"]

Disable all Performance rules

[rules]
disable = ["perf/*"]

Enable only this rule

[rules]
enable = ["perf/unminified-css"]
disable = ["*"]

Type to search…

↑↓ navigate↵ openesc close