This is amazing, thanks a lot for it. Just a question, how would you add styles/css to the independent components? 🤓
That's a really good question. For now I've just been using global styles and then applying specific classes to the template files. An example:
<div class="specific-component-class"> This class is only used for this component, but is stored in a global file like style.css
<div class="specific-component-class">
CSS Modules might be the key, if we can use them without Node.js
Hey I've found out that you can use scoped CSS to solve that issue. And works flawlessly. vue-loader.vuejs.org/guide/scoped-...
I was recently informed by Jay that you can use Goober CSS as a lightweight ES6-compatible way to add scoped CSS to each component while still avoiding Node.js!
Here's an example that Jay made.
plnkr.co/edit/tjhkcfNO15aTNhsU
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This is amazing, thanks a lot for it.
Just a question, how would you add styles/css to the independent components? 🤓
That's a really good question. For now I've just been using global styles and then applying specific classes to the template files. An example:
<div class="specific-component-class">
This class is only used for this component, but is stored in a global file like style.css
CSS Modules might be the key, if we can use them without Node.js
Hey
I've found out that you can use scoped CSS to solve that issue. And works flawlessly.
vue-loader.vuejs.org/guide/scoped-...
I was recently informed by Jay that you can use Goober CSS as a lightweight ES6-compatible way to add scoped CSS to each component while still avoiding Node.js!
Here's an example that Jay made.
plnkr.co/edit/tjhkcfNO15aTNhsU