Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

PostCSS not applied to css modules that compose other css files #8

Closed
justinhelmer opened this issue Jun 21, 2017 · 3 comments
Closed
Labels

Comments

@justinhelmer
Copy link
Owner

justinhelmer commented Jun 21, 2017

This doesn't work (postcss not applied):

.title {
    composes: xx-large from './css/typography.css';
}

This does:

.title {
    composes: xx-large from 'postcss-loader!./css/typography.css';
}

Also import will apply loaders, i.e.:

// App.vue
import typography from './css/typography.css'
/* App.vue */
.title {
    composes: xx-large from './css/typography.css';
}

But it should be baked in.

webpack-contrib/postcss-loader#40
webpack-contrib/css-loader#137
https://forum.vuejs.org/t/css-modules-composes-and-vue-loader/6941/3
https://github.com/css-modules/postcss-modules

@eseQ
Copy link

eseQ commented Aug 1, 2017

postcss-loader! - that does`t correct way.
For webpack v2:

{
  loader: 'css-loader',
  options: {
    importLoaders: 1 // 0 => no loaders (default); 1 => postcss-loader; 2 => postcss-loader, sass-loader
  }
}

@justinhelmer
Copy link
Owner Author

There's no good way to use composes unless you apply all of your loaders inline. It's recommended that you use @value and @mixin instead. See comments in Item.vue

@justinhelmer
Copy link
Owner Author

Closing; just dont use composes. it simply won't work without inlining the loaders to the filepath.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants