Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Yeah, the problem comes in when you want to share pre-processor variables between your components.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: