Answer the question
In order to leave comments, you need to log in
Connecting styles globally in vue?
I created the styles directive in assets with the main.styl file, into which I import global style files (fonts, grid, variables, mixins, resets). But files only work in component styles (scoped), not globally.
I include main.style automatically in vue.config.js:
const path = require('path')
module.exports = {
pluginOptions: {
'style-resources-loader': {
'preProcessor': 'stylus',
'patterns': [
path.resolve(__dirname, './src/assets/styles/main.styl')
]
}
}
}
Answer the question
In order to leave comments, you need to log in
UPD. I found a solution, connect files with fonts and reset directly in App.vue. Leave the rest in main.styl, which will be connected as needed in the components. Is this decision correct?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question