Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Using nib directly #112

Open
gitbase opened this Issue · 8 comments

3 participants

@gitbase

Just trying to figure out something.

I would like to pass stylus code with the @import nib to some function from the nib module, and then get the
CSS code in return.

Possible ?

@tj
Owner
tj commented

im not sure what you mean

@gitbase

I am building a small piece of script that I can use as an API for a particular service.

Basically, I would like to pass a piece of stylus code with nib to it (HTTP POST), for example:

@import 'nib'

body {
  background: linear-gradient(top, white, black);
}

Then in return I would like to get the CSS code rendered/generated.

The user will then be able to use the CSS code for some purpose.

Hope I made sense this time ?

So how would I go about doing this ? I could'nt find any option to use nib in the stylus's bin nor any method in the nib/stylus npm modules.

@tj
Owner
tj commented

ah I see, I'm doing similar actually :)

@gitbase

well, so ... how would I go about doing it ? or is it not possible atm ?

If it's possible then let me know, so that I can integrate it.

It's just going to be an extra nice feature in my app.

@gitbase

random msg for a notification as we had talked about - --nib flag with @import 'nib' prepended to code ?

@tj
Owner
tj commented

actually this might have to wait. ATM I can't think of any reasonable way to do this because npm install -g nib and require('nib') will still fail, so we can't (easily) access the path to nib

@gitbase

ok, np!

@flying-sheep

we also need the instructions how to use the stylus binary in the readme. what works for me is specified on the bottom of the stylus executable doc page:

_npm_prefix=$(npm prefix -g)
stylus $filepath.styl --use $_npm_prefix/lib/node_modules/nib/lib/nib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.