[Vuejs]-Vue App, need styles to be added above other styles

0👍

I don’t think you can order the way styles are included. But there are a couple of things you can do.

  • If you add styles via import in App.js they will be added first.
  • You can use !important to your css definitions. Ofc this will only work if the initial definitions don’t already have !important set.

0👍

I have yet to try it out, but it seems that CSS Extraction provided by the vue-loader Webpack loader allows extracting the css to an external bundle. Once you have that, you can include it wherever you want on your webpage.

👤bernie

0👍

I don’t know your application structure but in Vue you can add style for each component in that corresponding component.

TestComponent.vue

<template src='./Test.html'>
</template>
<script>
export default {
}
</script>
<style scoped>
</style>

Leave a comment