nib icon indicating copy to clipboard operation
nib copied to clipboard

Using nib directly

Open gitbase opened this issue 12 years ago • 8 comments

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 ?

gitbase avatar Jul 30 '12 12:07 gitbase

im not sure what you mean

tj avatar Jul 30 '12 16:07 tj

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.

gitbase avatar Jul 31 '12 03:07 gitbase

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

tj avatar Jul 31 '12 04:07 tj

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 avatar Jul 31 '12 06:07 gitbase

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

gitbase avatar Aug 21 '12 03:08 gitbase

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

tj avatar Aug 21 '12 16:08 tj

ok, np!

gitbase avatar Aug 22 '12 00:08 gitbase

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

flying-sheep avatar Sep 09 '12 19:09 flying-sheep