0

I am attempting to build a blog using NuxtJS. My repo is here. I listed my problem as an issue on the Nuxt repo as well here.

Essentially the problem is this. In my config file I load in my style sheets.

 css: [
    '~./css/reset.css',
    '~./css/vars.css',
    '~./css/global.css',
    '~./css/ui.css'
  ],

The problem seems to be that variables defined in one sheet can not be accessed by another. The variables defined in vars.css to not exist for global or ui.css

But what's even more strange but probably should be ignored, for now, it seems like just box-shadow seems to actually work. Every other variable doesn't.

1
  • As a temporary fix, you can consider using scss or less. Nuxt build them automatically, and you get extra functionalities. Commented Nov 18, 2017 at 23:42

1 Answer 1

1

It should be either ~/ or ./ but not ~./. This will fix your issue:

css: [
    './css/reset.css',
    './css/vars.css',
    './css/global.css',
    './css/ui.css'
  ],

'./' says to go to the root folder and after that find /css/...

While ~/ denotes to the home directory.

See the following posts for more detail:

What does mean a tilde key in a file path

Link a .css on another folder

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks! Great resources too. Fixed that issue but unfortunately, it seems the same issue exists. Here's the errors. You can see everything loaded after the Var sheet, which all use variables from that sheet, have no values. pastebin.com/W6XhM7hR Updated the github as well.
CSS link is fixed but variable are not fixed... seems problem with the variables... sorry i don't know nuxt.js as of now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.