Open markdalgleish opened 8 years ago
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.
@markdalgleish not sure what you mean .... maybe an example can help ....
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>';
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?
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.