1

i've tried to create component ButtonFilled.vue and i want to styling sass on this component and access the sass variable like this

enter image description here

but i qot this error, any solution? enter image description here

this is my main.js file

import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";

import "@/assets/sass/master.sass";

Vue.config.productionTip = false;

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");

this is my master.sass

// Base
@import "./base/fonts"
@import "./base/resets"
@import "./base/typography"

// Abstracts
@import "./abstracts/variables"
@import "./abstracts/functions"
@import "./abstracts/mixins"

1 Answer 1

1

i use this on vue.config.js and its works, thanks all

module.exports = {
  css: {
    loaderOptions: {
      sass: {
        additionalData: `@import "~@/assets/sass/abstracts/variables.sass";`
      }
    }
  }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.