GithubHelp home page GithubHelp logo

octicons's Introduction

Octicons!

This is the Bower package for GitHub Octicons.

Add Octicons to your project

  1. Create a new file called bower.json (if you don't have one already).

  2. Add a new line for the Octicon dependency, pointing to the correct repository:

{
  "name": "my_great_project",
  "dependencies": {
    "octicons": "2.0.0"
  }
}
  1. Run bower install. The Octicons styles will be downloaded to bower_components/octicons.

  2. Link to the octicons.css stylesheet in the <head> of your <html> page:

<link rel="stylesheet" href="bower_components/octicons/octicons/octicons.css">
  1. Simply use an icon in your HTML page:
<span class="octicon octicon-microscope"></span>

Rails' asset pipeline

Octicons includes a stylesheet specifically for Rails 4/Sprockets.

  1. Create a new file called vendor/assets/bower.json (if you don't have one already).

  2. Add a new line for the Octicon dependency, pointing to the correct repository:

{
  "name": "my_great_project",
  "dependencies": {
    "octicons": "2.0.0"
  }
}
  1. cd into vendor/assets and run bower install. The Octicons styles will be downloaded to vendor/assets/bower_components/octicons.

  2. Open your config/application.rb, and add this line inside your Application:

config.assets.precompile += %w(*.svg *.eot *.woff *.ttf)
  1. In your application stylesheet, require octicons:
/*
= require octicons
*/
  1. Simply use an icon in your HTML page:
<span class="octicon octicon-flame"></span>
  1. If you want a view helper, add something like this to app/helpers/application_helper.rb:
def octicon(code)
  content_tag :span, '', :class => "octicon octicon-#{code.to_s.dasherize}"
end

Best practices

  • Octicons look best in sizes that are multiples of 16px. You can update the size using the font-size CSS property. For example:

    .octicon {
      font-size: 32px;
    }
  • Octicons are not monospaced. This lets them work well next to type, but it means they won’t stack nicely by default. If you intend to stack octicons, such as in navigation, you will want to add some CSS to make them the same width, and centered. For example:

    .navigation .octicon {
      width: 16px;
      text-align: center;
    }

Resources

Why can't I see the characters in Font Book??

Give this a try, you should be all set:

FAQ

Check out issues with the FAQ label.

Versions

Octicons operates similarly to Semver with the following version convention:

  • Major: Breaking changes — removed icons, markup changes, unicode switches, css renames, icon redesigns
  • Minor: Non-breaking changes — new icons, new aliases, minor icon changes
  • Patch: Unnoticeable tweaks — slight visual changes, package updates

octicons's People

Contributors

cameron423698 avatar gjtorikian avatar kennethormandy avatar lukearmstrong avatar maria avatar

Watchers

James Cloos avatar Betty avatar

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.