4 ms·
Preprocessors aren't incompatible with components. I usually structure my frontend code like components/ widget-one/ template.html
by myhf 13y ago
Preprocessors aren't incompatible with components. I usually structure my frontend code like
components/
widget-one/
template.html
script.js
style.css
widget-two/
template.dust
script.coffee
style.styl
And then the style file for a component is completely scoped to that component's main class:
.widget-two {
.widget-two-control { color: blue; }
}
The build script can handle each component separately and stitch the results together. Just because SASS/compass encourages a monolithic style doesn't mean it's necessary.
- ianstormtaylor 13y agoYeah, the problem comes in when you want to share pre-processor variables between your components.