Skip to content

PostCSS Custom Properties plugin hangs on cyclic dependencies declared in non-:root rules #1356

@reesscot

Description

@reesscot

Reproduction link

https://stackblitz.com/edit/postcss-custom-properties-bug

Bug description

When the PostCSS Custom Properties plugin is run on a CSS string with a large number of custom properties, the process completely hangs with no output.

Screenshot showing it unresponsive.
CleanShot 2024-04-10 at 14 08 27@2x

When run with two less lines of CSS custom properties, it compiles correctly:
CleanShot 2024-04-10 at 14 10 24

Related: aws-amplify/amplify-ui#5143

Actual Behavior

Node process hangs

Expected Behavior

CSS should be output, as happens when a few custom property uses are removed from the CSS string.

Can you reproduce it with npx @csstools/csstools-cli <plugin-name> minimal-example.css?

Yes

npx Output

None, the process completely hangs.

Extra config

None, using postcss-custom-properties by itself.

What plugin are you experiencing this issue on?

PostCSS Custom Properties

Plugin version

13.3.6

What OS are you experiencing this on?

Windows

Node Version

18.18.0

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