Hacker News new | ask | show | jobs
by bradstewart 2789 days ago
The current wave of component-based development is blurring these lines. A Link component can contain the markup, behavior, and styles--presenting a very simple API to the developer.

I find myself taking a hybrid approach these days: common styles and variables (primarily variables) in global SCSS/Stylus stylesheets, and component-specific styles defined in the respective Vue components.

As it turns out, I have very few truly common CSS classes.

EDIT: To address the re-usability aspect as well: this approach absolutely makes it more difficult to re-use styles across other frameworks; but if I'm moving from Vue to some-new-framework, stylesheets are the least of my concerns.

1 comments

To play devil's advocate, you can release both in a hierarchical structure. There's no reason that the component framework can't import a Sass project for it's styling. Then folks who don't want to use Vue can still make use of the styles.
Absolutely. And a number of projects do exactly that.

Bulma -> Buefy Bootstrap -> VueBootstrap, et al.

That said, if you're already using Vue, then a Vue-based framework is more convenient.