S
S
sir_pounce2020-06-30 19:23:57
Vue.js
sir_pounce, 2020-06-30 19:23:57

How to structure styles in an application?

What is the best way to structure styles in an application? For example, is it possible to style buttons, inputs, and everything that is not a separate Vue component in a separate file (or several, for each element), or is it better to write styles in the component itself each time with the scoped attribute? Or should it be done differently?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Vasilev, 2020-07-01
@sir_pounce

Make separate mini-components for buttons / popups and other things that, based on the data, will display the desired result. Accordingly, you will write styles in the component itself under scoped.
You can structure styles in different ways, but I recommend writing styles in the component itself with the scoped attribute.

L
Lucretius Pyn, 2020-06-30
@lookreciuspin

Reader is a friend of CSS modules in view
https://vue-loader.vuejs.org/ru/guide/css-modules....

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question