Skip to content

PostCSS Nesting removes semicolon #497

Closed
@Antonio-Laguna

Description

@Antonio-Laguna

Bug description

PostCSS Nesting is removing the last semicolon prior to a nested rule.

While this is valid CSS it's making parsers choke on this. In this case, it's affecting Gutenberg which has a CSS Parser

See WordPress/gutenberg#40444

Source CSS

.something {
	order: 1;

	& .foo {
		order: 2;
	}
}

Expected CSS

.something {
	order: 1;
}
.something .foo {
		order: 2;
	}

Actual CSS

.something {
	order: 1
}
.something .foo {
		order: 2;
	}

Does it happen with npx @csstools/csstools-cli <plugin-name> minimal-example.css?

Yes

Debug output

No response

Extra config

No response

What plugin are you experiencing this issue on?

PostCSS Nesting

Plugin version

10.1.8

What OS are you experiencing this on?

macOS

Node Version

16

Validations

  • Follow our Code of Conduct
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Would you like to open a PR for this bug?

  • I'm willing to open a PR

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions