Skip to content

5.2.3 breaks CSS Custom Properties #1196

Description

@romainmenke

Environment

  • clean-css version - npm ls clean-css: v5.2.3
  • node.js version - node -v: 16
  • operating system: mac os

Configuration options

new CleanCSS( {
	sourceMap: true,
} ).minify( result.css, JSON.parse( result.map ), ( error, output ) => {
	if ( error ) {
		reject( error );

		return;
	}

	resolve( output );
} );

Input CSS

:root {
	/* Site container */
	--a: 20px;

	/* Z indices for modals and dialogs */
	--foo: 5050;
}

.bar {
	z-index: var(--foo);
}

Actual output CSS

:root{--a:20px}.bar{z-index:5050;z-index:var(--foo)}

Notice that --foo:5050 is missing in the actual output

Expected output CSS

:root{--a:20px;--foo:5050}.bar{z-index:5050;z-index:var(--foo)}

This is taken from clean-css 5.2.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions