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

Usage instructions #21

Closed AndrewRayCode closed 7 years ago

AndrewRayCode commented 9 years ago

I'm new to stylus and don't know how to "import index.styl" in my .styl files. I've tried @import "font-awesome-stylus" but webpack croaks saying it can't find it.

ajcarrillo commented 9 years ago

The file is in the path "Font-Awesome-Stylus/stylus/", I prefer use the CDN server for font-awesome.

@import "Font-Awesome-Stylus/stylus/index.styl"
AndrewRayCode commented 9 years ago

hmm.. does that mean I have to manually copy the source of this project into mine, or reference into the node_modules folder? Is there another way? For example, nib and jeet let you do this with webpack:

var jeet = require('jeet');
var nib = require('nib');

config = { ...
    stylus: {
        use: [ nib(), jeet() ]
    },
rlam3 commented 9 years ago

I'm having the same issue ... @DelvarWorld did you figure out how to get this working?

I did npm install, and was able to import stylus, but the icon doesn't appear. Only a square appears.

rlam3 commented 9 years ago

I figured out I could get it working like this, but don't know how to import the ones I only need instead of all of them

@import 'font-awesome-stylus'
$fa-font-path = 'font-awesome-stylus/stylus/index.styl'

@font-face
  font-family: 'FontAwesome';
  src: url('node_modules/font-awesome-stylus/fonts/fontawesome-webfont.eot');
  src: url('node_modules/font-awesome-stylus/fonts/fontawesome-webfont.eot') format('embedded-opentype'),
    url('node_modules/font-awesome-stylus/fonts/fontawesome-webfont.woff') format('woff'),
    url('node_modules/font-awesome-stylus/fonts/fontawesome-webfont.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
alexserver commented 8 years ago

+1 for this request. We need a clear example in the README. How can we help ?

raulghm commented 7 years ago

Never is too late?

https://github.com/raulghm/Font-Awesome-Stylus/tree/master/recipes