Skip to content

Updating postcss-preset-env from v6.7.1 to v7.X causes postcss-css-variables to error #319

Closed
@nickyblissAviva

Description

@nickyblissAviva

We are currently using postcss-preset-env 6.7.1 with postcss 8.4.12, postcss-css-variables 0.18.0 and postcss-import 14.1.0 and when we have tried to update out packages to use the latest version of postcss-preset-env out build scripts start to throw errors for variables being undefined and used without a fallback.

Our current css processing pipeline has a core css file that contains only css imports to our various CSS component files. The first imports in the file contain all the css variables used within the other imported css files.

@import url('core/core-fonts.css');
@import url('core/variables-styles-core.css');
@import url('core/variables-icons-core.css');
@import url('core/core.css');
@import url('core/headings.css');
@import url('core/buttons.css');

On moving to any v7 version of postcss-preset-env the variables are no longer being found and replaced within the other imported css files as they were originally.

postcss-css-variables: C:\site\assets-watched\css\core\buttons.css:290:2: variable --focus-plain is undefined and used without a fallback

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions