Comments (3)
Definitely, I should have been more clear with this - it does integrate the exact same way as nib if you're trying to figure it out immediately, but I have to run out for a bit, I'll definitely do a writeup and add this to the docs as soon as I get back 👍
from axis.
Ok so just blindly plugging
var roots = require('roots-css'); app.use(stylus.middleware({ src: __dirname + '/public', compile: compile } )); function compile(str, path){ return stylus(str) .set('filename', path) .use(roots()); }
Into a standard express -c stylus
got base() working without complaints so there's that working.
I tried looking through the repos of roots and roots-css to get a clue how roots was adding this in but it's some magic i can't find. I see you can use a stylus plugin either @import in a .styl or adding it onto a command line stylus <file> --use <plugin>
however that didn't help me out much trying to add to an existing project.
from axis.
Hey, so first of all, good work getting this to work right. The way you did it was 100% correct. I just finished adding a bit of documentation for the readme, so that will be pushed up in a minute - thats for pushing me to get this done.
To answer your question about the magic, this is where I bring it in as a part of roots:
https://github.com/jenius/roots/blob/master/lib/adapters/styl.js
...and this is how the interface exposes itself:
https://github.com/jenius/roots-css/blob/master/roots.js
You can see in the first file (as part of roots), I'm just requiring it exactly as you did above. For the second file, which is just roots.js
at the root of this project, it adds a function that imports all of roots' mixins and such directly to the stylus rendering pipeline.
from axis.
Related Issues (20)
- fix table.styl with stylus 0.42.3 and axis 0.5.2. HOT 3
- Newer clearfix HOT 2
- Support for HTML5 input elements HOT 3
- Checkboxes HOT 2
- Material Design HOT 1
- PostCSS Port HOT 8
- Axis Range overwrites Stylus Range HOT 18
- Conflicts with PostCSS processor
- relative behaviour
- Upgrade Normalize.css to ^4.0.0
- Text-and box-shadow helper and presets HOT 3
- meyer-reset / normalize / sanitize HOT 7
- Default font stack HOT 2
- 1.0 Buttons HOT 2
- Drop IE 9.0 HOT 4
- Option to remove round borders HOT 12
- Improve documentation examples HOT 7
- how can i use with webpack? HOT 2
- Rewrite of grid-area values HOT 4
- Got "SyntaxError: Invalid or unexpected token" in 2.0.0-alpha1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from axis.