Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variables don't work in nuxt.js #11

Open
flexscss opened this issue Feb 8, 2019 · 4 comments
Open

Variables don't work in nuxt.js #11

flexscss opened this issue Feb 8, 2019 · 4 comments

Comments

@flexscss
Copy link

flexscss commented Feb 8, 2019

I try

style: scss`
    .index {
      width: 100vh;
      height: 100vh;
      background: ${vm => vm.$store.state.theme.colors.primary};
      color: ${vm => vm.color};
    }
  `

but variables don't work
screen shot 2019-02-08 at 12 48 22

@egoist
Copy link
Owner

egoist commented Feb 8, 2019

Please provide a full repro.

@souavds
Copy link

souavds commented Feb 28, 2019

I'm with the same problem (i'm using nuxt as well)

style: css`
    .container2 {
      background-color: ${vm => vm.backgroundColor};
    }
  `,
  data() {
    return {
      backgroundColor: 'red'
    }
  },

but the browser just put a

background-color: var(--v0);

I've tried the example that is on the documentation and it doesn't work either. Also the Preprocessors doesn't work (I have sass-loader and node-sass installed):

ERROR in ./pages/teste.vue
Module Error (from ./node_modules/eslint-loader/index.js):

/home/arthurvdiniz/dev/sites/acervus-publico/pages/teste.vue
  9:10  error  scss not found in 'styled-vue'  import/named

 1 problem (1 error, 0 warnings)

@jankal
Copy link

jankal commented May 17, 2019

@egoist Same thing here. Preprocessors won't work.

@christophwolff
Copy link

christophwolff commented Jan 18, 2020

Works fine for me. With css and scss.

Sample Repo here: https://github.com/christophwolff/nuxt-styled-vue-sample

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants