Skip to content

Conversation

@akanix42
Copy link
Contributor

@akanix42 akanix42 commented Feb 14, 2017

This adds support for CSS modules following the implementation used by vue-loader.
To use CSS modules, you add the module attribute to your style tag:

<style module>
.test {
  color: red;
}
</style>

Then you reference it via the $style computed property:

<div :class="$style.test">Hello!</div>

I also fixed a typo on the postcss call ("form" -> "from") since I needed the full path... and then I of course had a typo in that commit message. 😊

This does not include support for composing from other CSS modules files, since to do that we have to call back to the compiler and either pull the file from cache or compile it on the fly and return the result. We would also have to pull in other file types on demand and process them (composing from say a .scss file).
Composing from global works, of course, since that doesn't require us to load those files.

@Akryum
Copy link
Collaborator

Akryum commented Feb 14, 2017

Thanks for your contribution! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants