Giter VIP home page Giter VIP logo

duo-stylus's Introduction

duo-stylus

compile stylus to css

CLI Usage

$ duo --use duo-stylus index.styl > build.css

API Usage

var co = require('co');
var Duo = require('duo');
var stylus = require('duo-stylus');

co(function *(){
  var duo = Duo(__dirname);
  duo.entry('index.styl');
  duo.use(stylus());
  var css = yield duo.run();
  // ...
})();

License

MIT

duo-stylus's People

Contributors

stephenmathieson avatar patrickdevivo avatar

Stargazers

Larry Xu avatar Henry Snopek avatar Joe Vallender avatar Shu Uesugi avatar cy avatar  avatar

Watchers

David Oliver avatar  avatar James Cloos avatar

Forkers

patrickdevivo

duo-stylus's Issues

Relative paths

I have:

|- index.styl // entry-point
|- lib
    |-- boot.styl
    |-- images
        |-- bg.jpg

index.styl:

body
  background red

@import 'lib/boot/boot.styl'

boot.styl:

body
  background url('./images/bg.jpg')

body h1
  font-size 16px

When I run with the CLI: duo --use duo-stylus index.styl --no-cache I get a prompt for my github access token (password). The same happens with the Duo API:

var Duo = require('duo');
var stylus = require('duo-stylus');
var fs = require('fs');
var path = require('path');
var join = path.join;
var mkdir = require('mkdirp').sync;

var build = join(__dirname, 'build');
var out = join(build, 'build.css')

mkdir(build);

var duo = new Duo(__dirname);

duo.entry('index.styl').use(stylus()).cache(false);

duo.run(function(err, results) {
  if (err) throw err;
  fs.writeFileSync(out, results.code);
  var len = Buffer.byteLength(results.code);
  console.log('all done, wrote %dkb', len / 1024 | 0);
});

The only workaround I found is having this on boot.styl:

body
  background url('lib/boot/images/bg.jpg')

body h1
  font-size 16px

Can I write it somehow in the first way?

Troubles with @import

Hi,

I'm having troubles with the @import "my-org/my-styleguide-repo"; declaration, since it attempts to require it via stylus instead of resolving with duo the github repository.

Although, if I change that syntax to @import "my-org/my-styleguide-repo:entry.css" it perfectly works.

Any clue on how to work this around to avoid specifying the entrypoint at each remote import?

Thanks!

@require other .styl files issue

Hi there are have some stylus @require issue happen for me. Please look my structure below:

/* main.styl  */
@require './views/header'
...
/* views/header/index.styl  */

#header
  font-size: 20px
...

The main.styl is an entry.

When I modify views/header/index.styl, and run duo(). The build file where there will be no change(don't include change of index.styl). But if modifiy main.styl will update build file correct again.

Is that clear?

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.