Skip to content

Empty output if css class contains double dash (--) and a comment at the beginning #1224

Description

@ollm

Environment

  • clean-css version - master clean-css@5.3.0 (git+https://github.com/clean-css/clean-css.git#40ca65807639e0470dab22585847a7582687167f):
  • node.js version - v14.19.3
  • operating system Ubuntu 20.04.3

Configuration options

var CleanCSS = require('clean-css');
var output = new CleanCSS({
  level: 2 // But it also happens with level 1
}).minify(css)

Not works

Input CSS

.commentRatingColor--chartreuse
{
	/* Comment */
	color: #5ab900;
}

Actual output CSS

empty

Expected output CSS

.commentRatingColor--chartreuse{color:#5ab900}

Works

.commentRatingColor--chartreuse
{
	color: #5ab900;
	/* Comment */
}

Actual output CSS

.commentRatingColor--chartreuse{color:#5ab900}

Metadata

Metadata

Assignees

No one assigned

    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