Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Loaders are unavailable within JSS #2

Open
markdalgleish opened this issue Sep 10, 2015 · 4 comments
Open

Loaders are unavailable within JSS #2

markdalgleish opened this issue Sep 10, 2015 · 4 comments

Comments

@markdalgleish
Copy link
Collaborator

The most obvious example of this problem is that compilation fails if your JSS depends on another JSS file (e.g. when using CSS Modules' composes).

This is a critical issue that is likely to cause this project to become deprecated in favour of a Webpack plugin, along the lines of @andreypopp's Styling.

@geekyme
Copy link

geekyme commented Sep 13, 2015

I don't think we are also able to import vendor stylesheets like bootstrap from within a JSS right? That seems like a deal breaker.

@kof
Copy link
Member

kof commented Sep 29, 2015

@markdalgleish not sure what you mean .... maybe an example can help ....

@joshgillies
Copy link
Member

Correct me if I'm wrong but I think what @markdalgleish is referring to is currently the loader lacks the ability to pass compose statements back into Webpacks loader pipeline.

As an example:

colour.jss.js

module.exports = {
  '.blue': {
    color: 'blue'
  },
  '.green': {
    color: 'green'
  }
};

component.jss.js

module.exports = {
  '.hello': {
    composes: 'blue from "./colour.jss.js"'
  },
  '.world': {
    composes: 'green from "./colour.jss.js"'
  }
};

component.js

var styles = require('css?modules!jss!./component.jss.js');

var html = '<div class="' + styles.hello + '">Hello World!</div>';

@joshgillies
Copy link
Member

Hrmm, actually the above statement isn't correct. composes seems to work exactly as expected in the above case. @markdalgleish when you get a moment care to chime in with regards to this issue?

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

No branches or pull requests

4 participants