You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a new Nuxt.js website right now that uses @nuxtjs/style-resources to automatically inject a _variables.pcss file into each Vue component's <style> instance. This allows me to avoid doing this in every component:
<styletype="postcss">@import'~/styles/_variables.pcss';
/* actual component styles */</style>
However, postcss-import is refusing to import anything in my global style file:
This is, essentially, because that style-resources plugin is automatically injecting the variables into the top of the file prior to the @import statements being processed.
My suggestion is to add a property to the options object like suppressWarning which is false by default and if true, allows us to bypass the warnings added in #240. I can put together a PR if this sounds like a reasonable idea.
The text was updated successfully, but these errors were encountered:
This isn't just a warning; postcss-import is unable to import your other files if there is CSS before the @import statement. What you want to do in your case is create a file that simply contains @import '_variables.pcss';, then have @nuxtjs/style-resources inline that file into your CSS, and let postcss-import do all the importing.
I'm working on a new Nuxt.js website right now that uses @nuxtjs/style-resources to automatically inject a
_variables.pcss
file into each Vue component's<style>
instance. This allows me to avoid doing this in every component:However,
postcss-import
is refusing to import anything in my global style file:This is, essentially, because that
style-resources
plugin is automatically injecting the variables into the top of the file prior to the@import
statements being processed.My suggestion is to add a property to the
options
object likesuppressWarning
which isfalse
by default and iftrue
, allows us to bypass the warnings added in #240. I can put together a PR if this sounds like a reasonable idea.The text was updated successfully, but these errors were encountered: