css-modules / postcss-icss-values

Pass arbitrary constants between your module files
MIT License
203 stars 18 forks source link

[2.0.1] composes broken ? #107

Open joscha opened 7 years ago

joscha commented 7 years ago

After updating from postcss-modules-values@1.3.0 to postcss-icss-values@2.0.1 I get the following errors in my CSS build:

./src/ui/badge/stories/badge.stories.css
Module build failed: ModuleBuildError: Module build failed: referenced class name "__value__heavyBoxShadow__2" in composes not found (19:4)

  17 | }
  18 |
> 19 | [dir=rtl] :export {
     |    ^
  20 |   heavyBoxShadow: __value__heavyBoxShadow__-2;
  21 | }
  22 |

The CSS files look like this:

ui/shadows/shadows.cs:

@value monoBlackA275 from "../colors/colors.css";
@value monoBlackA500 from "../colors/colors.css";

.heavyBoxShadow {
    box-shadow: 0 0 0 1px monoBlackA500, 0 2px 18px monoBlackA275;
}

and the one using it, badge.stories.css:

@value heavyBoxShadow from "ui/shadows/shadows.css";

.shadow {
    composes: heavyBoxShadow;
}

any idea what could have caused this in the upgrade?

michael-ciniawsky commented 7 years ago

@joscha How/Where to do use the plugin atm? Did you see postcss-icss-composes ? :) In case you didn't the logic was split into its own plugin, but the logic there changed aswell, the plugin itself is syntax only, resolving/fetching needs to be done by the middleware, that's WIP as I currently undertand and I don't do to 💯 atm myself 😛

joscha commented 7 years ago

@michael-ciniawsky I see - are there any docs on how to upgrade from postcss-modules-values@1.x to postcss-icss-values@2 & postcss-icss-composes@2? I added both postcss-icss-values and postcss-icss-composes now instead of the old module, but it doesn't seem to work as expected.

michael-ciniawsky commented 7 years ago

I'm currently writing docs, but they are WIP atm and a few points are still WIP in general, use the lastest postcss-modules-* in 'production' etc. for now, they all got an final upgrade to work with PostCSS 6 before the rename. ICSS is a complete shift under the hood in terms of plugin logic and there are no 'runners/resolvers' atm to test them out in a project

joscha commented 7 years ago

Will do, ta!