Sha256: 94fd17d1c7a2ac45ac913033964f667dd9fc2bd657a8e8e8ae6da3d10bc99842
Contents?: true
Size: 1.96 KB
Versions: 1
Compression:
Stored size: 1.96 KB
Contents
# Octicons gem [![Gem version](https://img.shields.io/gem/v/octicons.svg)](https://rubygems.org/gems/octicons) [![Build Status](https://travis-ci.org/primer/octicons_gem.svg?branch=master)](https://travis-ci.org/primer/octicons_gem) > Octicons gem to distribute octicons svg ## Install Add this to your `Gemfile` ```rb gem 'octicons' ``` Then `bundle install`. ## Usage ```rb require 'octicons' icon = Octicons::Octicon.new( :symbol => "x" ) icon.to_svg # <svg class="octicon octicon-x" viewBox="0 0 16 16" width="16" height="16" version="1.1" "aria-hidden"="true"><path d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"></path></svg> ``` ## Documentation The `Octicon` class takes a hash of arguments to construct the icon you want #### Options * `:symbol` _(required)_ - This is the name of the octicon you want to use. For example `alert`. [Full list of icons][octicons-docs] * `:size` - This will help output 16 or 32 sized icons. if you pass "large" the icon will be double the size. You can also pass an number and the icon will be scaled properly. * `:width`, `:height` - width and height are exact sizes, if you have an odd shape like the gist logo, pass in exact dimensions Everything else passed in through the options hash will be treated as html attributes and added to the svg tag. #### Methods ##### `to_svg` Returns a string of the svg tag ```rb icon = Octicons::Octicon.new( :symbol => "x" ) icon.to_svg # <svg class="octicon octicon-x" viewBox="0 0 16 16" width="16" height="16" version="1.1" "aria-hidden"="true"><path d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"></path></svg> ``` ## License _Code License:_ [MIT](./LICENSE) © [GitHub](https://github.com/) _Font License:_ [SIL OFL 1.1](./LICENSE) © [GitHub](https://github.com/) [octicons]: https://github.com/primer/octicons [octicons-docs]: https://octicons.github.com/
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
octicons-1.1.0 | README.md |