Giter Club home page Giter Club logo

Comments (10)

sapegin avatar sapegin commented on May 27, 2024

Does it work if you compile your files with Stylus CLI instead of grunt-contrib-stylus?

from grunt-contrib-stylus.

Anifacted avatar Anifacted commented on May 27, 2024

Yes, i can compile without any problems using Stylus CLI.

I am on Windows 7 btw.

from grunt-contrib-stylus.

enyo avatar enyo commented on May 27, 2024

👍 I have a very similar problem I think.

Always the second file to be compiled doesn't parse nib mixins...

I have two files, both importing nib. I have setup the Gruntfile like this now:

    stylus:
      options:
        compress: false
      basic:
        files: [
          "downloads/css/basic.css": "downloads/css/stylus/basic.styl"
        ]
      dropzone:
        files: [
          "downloads/css/dropzone.css": "downloads/css/stylus/dropzone.styl"
        ]

dropzone.styl imports basic.styl.

If I call grunt stylus:dropzone or grunt stylus:basic, it works! Both are compiled properly and the nib mixins are handled.

If I call grunt stylus:dropzone stylus:basic or grunt stylus:basic stylus:dropzone the second file never has nib mixins parsed.

The same happens if I setup the Gruntfile like this:

    stylus:
      options:
        compress: false
      default:
        files: [
          "downloads/css/basic.css": "downloads/css/stylus/basic.styl"
          "downloads/css/dropzone.css": "downloads/css/stylus/dropzone.styl"
        ]

When I change the order of the files, only the first one works.

from grunt-contrib-stylus.

sapegin avatar sapegin commented on May 27, 2024

@enyo Works fine for me: https://gist.github.com/sapegin/1bcd40cea54808f26248

Try to change [] to {} because files isn’t an array.

from grunt-contrib-stylus.

enyo avatar enyo commented on May 27, 2024

@sapegin Changing it to an object didn't do anything. Try importing s1.styl in s2.styl that's where I'm having troubles.
PS: It worked with an array since it's coffee script syntax which resulted in [ { /* files here */ } ] which apparently works.

from grunt-contrib-stylus.

sapegin avatar sapegin commented on May 27, 2024

@enyo Yep, I see the same error @Anifacted posted in the first comment.

from grunt-contrib-stylus.

enyo avatar enyo commented on May 27, 2024

It's just funny to see that it only happens with imports, and it's always the second file having a problem. So even though my basic.styl doesn't include anything but nib, it won't compile properly if it's the second in the list.

from grunt-contrib-stylus.

sapegin avatar sapegin commented on May 27, 2024

Actually it’s a Stylus bug and it’s not related to nib. I’ve created an issue: https://github.com/LearnBoost/stylus/issues/1546

from grunt-contrib-stylus.

enyo avatar enyo commented on May 27, 2024

@sapegin Thanks for looking into it and finding the problem!

from grunt-contrib-stylus.

Anifacted avatar Anifacted commented on May 27, 2024

Yes, thanks for taking the time. Let's hope that this gets fixed in stylus before too long.

from grunt-contrib-stylus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.