raulghm / Font-Awesome-Stylus

Stylus port for font-awesome 4.7.0
https://github.com/raulghm/Font-Awesome-Stylus
GNU General Public License v2.0
78 stars 26 forks source link

Change directory structure #31

Closed neysimoes closed 7 years ago

neysimoes commented 7 years ago

Hi! We can change directory structure to simplify font-awesome-stylus usage.

$ npm install font-awesome-stylus

Example of requiring and using font-awesome middleware to create compile function to utilize in other frameworks.

var fontAwesome = require('font-awesome-stylus'),
    stylus    = require('stylus');

function compile(str) {
  return stylus(str)
    .use(fontAwesome());
}

To import whole font-awesome in your stylus file:

@import "font-awesome"

We need change stylus folder name to font-awesome and add a simple index.js file with:

exports = module.exports = function () {
  return function(style){
    style.include(__dirname);
  }
}

And add "main": "index.js" on package.json.

raulghm commented 7 years ago

@neysimoes Excellent proposal!

Let me a time for make tests and accept you PR ;)

raulghm commented 7 years ago

Hi @neysimoes recently I added a alpha version 4.7.1-alpha.1 with you new structure and other improves to make more compatible this package, could you test this last version please?

neysimoes commented 7 years ago

@raulghm I have tested and the project entry point is wrong.

change "main": "index.js" to "main": "lib/font-awesome-stylus.js" on package.json

neysimoes commented 7 years ago

https://github.com/raulghm/Font-Awesome-Stylus/pull/33