nib
nib copied to clipboard
Using nib directly
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 ?
im not sure what you mean
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.
ah I see, I'm doing similar actually :)
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.
random msg for a notification as we had talked about - --nib flag with @import 'nib' prepended to code ?
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
ok, np!
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