postcss / postcss-custom-properties

Use Custom Properties in CSS
https://postcss.github.io/postcss-custom-properties
MIT License
596 stars 77 forks source link

Prevent mutation and unexpected situations #182

Closed EECOLOR closed 5 years ago

EECOLOR commented 5 years ago

Even if no importFrom was specified, the previous version (before this change) would re-use the same object. This causes 'sharing' of properties between different files. It also means that if two files declare the same variable with a different value, things can become quite tricky. This is made even more strange by having the await between property retrieval and application. We have situations where before the await a prop has one value and after the await another value.

jonathantneal commented 5 years ago

All transformations will be moving into https://github.com/csstools/postcss-custom-utils which was just bumped and published today. I would make this PR there.

EECOLOR commented 5 years ago

I will, please also patch this library on a minor release so that we do not have to wait for postcss-preset-env to update their dependency

EECOLOR commented 5 years ago

@jonathantneal I don't think this change will en up in the other repo. It seems this particular change has already been implemented in https://github.com/postcss/postcss-custom-properties/blob/update/postcss-tape/src/index.js#L17

In any case, please merge this and release a patch version.

jonathantneal commented 5 years ago

@EECOLOR, that branch also has breaking changes. Your fix is a patch, and so I will merge it into a patch release branch I will make in the meantime.