question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

stylus global import not work!

See original GitHub issue

i use stylus ,

min.styl
$main-color = #000000
App.vue
  @import "../assets/min.styl"
Holle.vue
  .button
      $main-color

holle.vue can’t find $main-color what can i do

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

13reactions
tammcommented, Feb 4, 2019

I just wanted to leave a note to say @sky790312 's comment above helped me figure this out.

My vue.config.js which works

// vue.config.js
var path = require('path');
module.exports = {
  css: {
    loaderOptions: {
      stylus: {
        import: [path.resolve(__dirname, "src/stylus/variables")]
      }
    }
  }
};
0reactions
tomderuddercommented, Sep 13, 2019

How to import once

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

stylus can't resolve @import - node.js - Stack Overflow
The problem is in the relative path of @import "../button.styl" . If I replace it with an absolute path to button.styl it becomes...
Read more >
@import and @require | Stylus
@import and @require #. Stylus supports both literal @import for CSS, as well as dynamic importing or requiring of other Stylus sheets.
Read more >
css-loader | webpack - JS.ORG
We strongly recommend that you specify the extension when importing a file, since it is possible to import a file with any extension...
Read more >
Importing REX Files - Stylus RMX - 1.10
With the REX File Import feature that is built into the Stylus RMX ... This means that Stylus RMX is not simply a...
Read more >
Styles & CSS - Astro Documentation
You can opt-out of automatic CSS scoping with the <style is:global> attribute. ... CSS imports work like any other ESM import in an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found