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

Add external css with variables using postcss #316

Closed
jmanuelrosa opened this issue Jan 30, 2017 · 1 comment · May be fixed by carlosrojaso/vue-cli#133, posrix/vue-cli#143, carlosrojaso/vue-cli#145, posrix/vue-cli#152 or posrix/vue-cli#215

Comments

@jmanuelrosa
Copy link

jmanuelrosa commented Jan 30, 2017

I am trying to use an external file where I have declared all app colors in variables.

colors.css

:root {
  --customColor: #c3c3c3;
}

This file would be imported to each component with an import, using postcss-import. The problem I have is that webpack does not detect changes in this external file, so the hot loader does not work when I modify the css file.

Anyone know what I can do, or where to modify webpack? I can not find information in the documentation or the issues.

custom component

<template>
  <div id='app'>Test</div>
</template>

<script>
  export default {
    name: 'app',
    components: {}
  }
</script>

<style>
  @import './styles/colors.css';

  #app {
    color: var(--othercolor);
  }
</style>

@egoist
Copy link
Collaborator

egoist commented Feb 2, 2017

Please do not ignore the issue_template.md, you can re-open this in relevant template repository or stackoverflow.

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