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

node-sass property 'data' overwrites component styles #93

Closed
holgerw opened this Issue May 13, 2017 · 3 comments

Comments

Projects
None yet
4 participants
@holgerw
Copy link

holgerw commented May 13, 2017

Node-sass has a 'data' property that could be used to prepend common statements into sass scopes. This would be very useful to import common sass, like variables, in every component.
But setting the 'data' property, actually overwrites the components styles.

Expected behavior

vue({
  scss: {
    includePaths: ['./src/styles'],
    data: '@import "_variables";'
  }
})

should import shared variables into the styles of every component with lang="scss", prepending the content of the 'data' property to the component's style code.

Actual behavior

The content of the 'data' property overwrites the styles of every component with lang="scss".

Why is it important

The expected behavior would be a very dry way to maintain common Sass code, relevant for every component, like variables and mixins.

The 'data' property seems to work as expected with webpack, as discussed here vuejs-templates/webpack#149

@antoinerey

This comment has been minimized.

Copy link

antoinerey commented Apr 21, 2018

Hello !

I'm trying to use the scss.data configuration and it's still overwriting the components styles. I'm using it like :

vue({
  scss: {
    data: '$color: tomato'
  }
})

Note: I'm using rollup-plugin-vue@3.0.0

@Minasokoni

This comment has been minimized.

Copy link

Minasokoni commented Feb 4, 2019

@antoinerey did you ever figure it out? I'm also trying to pass variables and they aren't working

@antoinerey

This comment has been minimized.

Copy link

antoinerey commented Feb 4, 2019

@Minasokoni To be honest, I can't even recall why I encountered this issue. Sorry 🤷‍♂️

znck added a commit that referenced this issue Feb 5, 2019

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