Static GitHub Issues

[387] Global Sass mixins and functions

prev: Declaring language in HTML tag
next: Flash of content (foc) when not in dev mode

It seems that only compiled CSS is available globally.

For example, something like this included globally would work:

// assets/scss/main

@mixin createGrid() { ... }

.container {
  @include createGrid()
}

But this wouldn't work:

// assets/scss/main

@mixin createGrid() { ... }

// components/someComponent

.container {
  @include createGrid()
}

Would it be possible to inject sass mixins and functions globally? Or is there a reason they need to be imported individually for each file/component?

If the latter, another alternative would be to have sass @import statements resolve node_modules so that components that use them don't all have to do @import 'node_modules/somePlugin/dist/someFile'.

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c333">#c333</a>)</em></sub></div>