Skip to content

CSS Variables OrderΒ #518

Closed
Closed
@lemmon

Description

I've noticed that PurgeCSS removes variables even though they are used if they are not in "proper" order.

:root {
  --color: var(--default);
  --yellow: #ffdc00;
  --extra: yellow;
  --default: #0074d9;
}

.blue {
  color: var(--color);
}

.yellow {
  color: var(--yellow);
}

In this example the --default variable gets deleted since it is only defined after the --color variable. If I put --default before --color everythign works.

PurgeCSS v3.0.0

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions