Commit 9799dba7 authored by Hideki Yamane's avatar Hideki Yamane 🐈

Merge tag 'v8.1.0' into debian/sid

parents 33ff7f05 cad47f96
The contents of */octicons* */svg* are generated by an automated process. Changes to these files may be accepted, but may also be overwritten.
# Adding or Updating icons
Octicons is GitHub's icon font. At this time, new icons will only be added when they are needed for GitHub products.
If you plan to update an icon and/or add a new icon follow these steps. These steps will be the same for core primer members and contributors.
Complete steps 1 - 3 and notify us of your changes, either with a pull request or an issue describing your changes. Screenshots welcome! 🎉
## Step 1, Duplicate:
The first step is to make a copy of the [master Octicons file][master-octicons] to your drafts folder. You can do this from the dropdown menu, select "Duplicate to your drafts".
[<img src="" width="400"/>](
## Step 2, Edit:
In your duplicate file, make proposed changes. In the example, we’ll make the GitHub logo red. It will also simplify things if you give your file a unique name e.g. _Octicons (Jon’s Changes)_.
[<img src="" width="400"/>](
## Step 3, Share:
Make sure your duplicate file can be viewed by others. In the share menu "Anyone with link" should be set to "can view". Copy the link.
[<img src="" width="400"/>](
## Step 4, Pull Request: _(Optional)_
You can submit a pull request updating the `figma.url` configuration in the root [package.json]( with your figma file. Doing so will generate alpha releases of [all the libraries that distribute Octicons](
Once the build passes on your pull request, you should see statuses with all the alpha versions of the libraries. You can then use these to test your changes.
[Here is an example pull request](
[<img src="" width="700"/>](
# Maintainers accepting changes
Once submitted changes have been agreed upon, these instructions will guide core primer team members in merging in those changes.
## Step 1, Save:
Save the contributor’s figma file as a `.fig` file.
[<img src="" width="400"/>](
## Step 2, Import:
Drag and drop, or add the file to the main team project. Make sure its name is different from the master Octicons file.
[<img src="" width="400"/>](
## Step 3, Publish:
From the new imported file, publish the updated or new components to the team library. This published component makes importing into the master document easier.
[<img src="" width="400"/>](
## Step 4, Add:
In the Team Library you will see the new Octicons file, and all the components from that file. Add the new components to the master Octicons file. It makes changing easier if you drag it on top of the icon you are changing.
[<img src="" width="400"/>](
## Step 5, Replace:
Right click on the new component instance and select "Detach Instance". Then toggle both the old and new components open. Move the shape from the new component into the old component. Delete the old component’s shape. Delete the empty new component container.
[<img src="" width="400"/>](
## Step 6, Publishing:
Publish the component changes to your team library. You can now delete the imported `.fig` file from the contributor.
[<img src="" width="600"/>](
Create a release branch, and run `npm run bump`. This will guide you through a prompt asking what all the new versions of the packages should be. After, push up your branch and open a pull request into master.
# Ignore build/export artifacts
- config/default.yml
- config/rails.yml
multipass: true
- removeTitle: true
- removeViewBox: false
- removeStyleElement: true
- removeAttrs:
- xmlns:xlink
- id
- class
- data-name
- fill
- transform
- href
- clip-path
- clip-rule
- removeEmptyContainers: true
- sortAttrs: true
- removeUselessDefs: true
- removeEmptyText: true
- removeEditorsNSData: true
- removeEmptyAttrs: true
- removeHiddenElems: true
- collapseGroups: true
language: node_js
- '5'
- 8
- npm test
# Setup rubygems creds
- curl -u "$RUBYGEMS_USER:$RUBYGEMS_PW" > ~/.gem/credentials
- chmod 0600 ~/.gem/credentials
# this will short-circuit the publish step if it fails to interpolate $NPM_API_KEY
- npm config set "//\${NPM_API_KEY}"
# publish release candidates from any branch beginning with "release"
- on:
condition: $TRAVIS_BRANCH =~ ^release
all_branches: true
tags: false
provider: script
- script/release-candidate
skip_cleanup: true
# publish "final" releases on master
- on:
branch: master
tags: false
provider: script
script: script/release
skip_cleanup: true
slack: 'github:4OisIoqZYyMlWcw3hFtZgbmh'
### HEAD
# 7.3.0
* Fix for heart icon
* Adding an archive icon created by @colinkeany
* Fixed versioning strategy
# Archived releases
### Octicons_node 7.0.0
- Removing `file-text` and `mail-reply` icons. Use `file` and `reply` respectively.
- Removing spritesheet calls and `toSVGUse` method.
### Octicons_gem 5.0.4
- Removing `file-text` and `mail-reply` icons. Use `file` and `reply` respectively.
- Removing spritesheet calls and `to_svg_use` method.
### 6.0.1
- Typo `kebab-veritcal` becomes `kebab-vertical`
### 6.0.0
- `kebab-horizontal` and `kebab-vertical` icons
- Polyfill for the `Object.assign` function
- Removing a duplicate `ellipses` icon from the set. Use `ellipsis` instead.
### 5.0.1
var fs = require("fs")
var path = require("path")
module.exports = function(grunt) {
pkg: grunt.file.readJSON('package.json'),
cssnano: {
options: {},
dist: {
files: {
'build/octicons.min.css': 'build/octicons.css'
svgmin: {
dist: {
options: {
plugins: [
{removeTitle: true},
{removeStyleElement: true},
{removeAttrs: { attrs: ['id', 'class', 'data-name', 'fill'] }},
{removeEmptyContainers: true},
{sortAttrs: true},
{removeUselessDefs: true},
{removeEmptyText: true},
{removeEditorsNSData: true},
{removeEmptyAttrs: true},
{removeHiddenElems: true}
files: [{
expand: true,
cwd: 'lib/svg',
src: ['*.svg'],
dest: 'build/svg'
svgstore: {
options: {
includeTitleElement: false,
inheritviewbox: true,
includedemo: function(arg) {
var octicons = require("./index.js")
var icons = function() {
var result = []
result.push("<div style=\"width: 10%;min-width: 100px;flex: 0 0 auto;box-sizing:border-box;padding:1em;text-align:center;\">" + octicons[key].toSVGUse({ height: 32 }) + "<div>" + key + "</div></div>")
return result.join("\n")
return `
<!doctype html>
<meta charset="utf-8">
<title>Octicons Spritesheet test</title>
<link rel="stylesheet" href="./octicons.css" media="screen" title="no title">
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
color: #222;
font-size: 15px;
<div style="font-size: 2.2em;padding-left: 20px;">Octicons SVG Spritesheet demo</div>
<div style="font-size: 1.2em;margin: 1em 0;padding-left: 20px;">All the icons rendered below use the svg spriteheet located in the <code>/build/</code> directory.</div>
<div style="flex: 0 1 auto;display:flex;flex-wrap: wrap; flex-direction: row;">
default: {
files: {
"build/sprite.octicons.svg": ['build/svg/*.svg']
clean: {
build: [
copy: {
css: {
src: "lib/octicons.css",
dest: "build/octicons.css"
// build tasks
grunt.registerTask('css', ['copy', 'cssnano']);
grunt.registerTask('svg', ['clean', 'svgmin']);
// default task, build /dist/
grunt.registerTask('default', [ 'svg', 'css', 'json:svg', 'svgstore']);
grunt.registerTask('json:svg', 'add svg string to data.json build', function() {
var files = fs.readdirSync("./build/svg/")
var data = JSON.parse(fs.readFileSync("./lib/data.json"))
files.forEach(function(file) {
var svg = fs.readFileSync(path.resolve("./build/svg", file))
var key = path.basename(file, ".svg")
if (data[key]) {
var raw = svg.toString()
data[key].path = /<path.+\/>/g.exec(raw)[0]
data[key].height = /height="(\d+)"/g.exec(raw)[1]
data[key].width = /width="(\d+)"/g.exec(raw)[1]
fs.writeFileSync("build/data.json", JSON.stringify(data));
MIT License
Copyright (c) 2012-2016 GitHub, Inc.
Copyright (c) 2018 GitHub Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
# GitHub Octicons
# Octicons
[![NPM version](](
[![Build Status](](
> Octicons are a scalable set of icons handcrafted with <3 by GitHub.
## Install
**NOTE:** The compiled files are located in `/build/`. This directory is located in the published npm package. Which means you can access it when you `npm install octicons`. You can also build this directory by following the [building octicons directions](#building-octicons). The files in the `/lib/` directory are the raw source files and are not compiled or optimized.
#### NPM
This repository is distributed with [npm][npm]. After [installing npm][install-npm], you can install `octicons` with this command.
$ npm install --save octicons
## Usage
For all the usages, we recommend using the CSS located in `./build/octicons.css`. This is some simple CSS to normalize the icons and inherit colors.
### Spritesheet
With a [SVG sprite icon system]( you can include the sprite sheet located `./build/sprite.octicons.svg` after you [build the icons](#building-octicons) or from the npm package. There is a demo of how to use the spritesheet in the build directory also.
### Node
After installing `npm install octicons` you can access the icons like this.
var octicons = require("octicons")
// { keywords: [ 'warning', 'triangle', 'exclamation', 'point' ],
// path: '<path d="M8.865 1.52c-.18-.31-.51-.5-.87-.5s-.69.19-.87.5L.275 13.5c-.18.31-.18.69 0 1 . 0 .69-.19.86-.5.17-.31.18-.69.01-1L8.865 1.52zM8.995 13h-2v-2h2v2zm0-3h-2V6h2v4z"/>',
// height: '16',
// width: '16',
// symbol: 'alert',
// options:
// { version: '1.1',
// width: '16',
// height: '16',
// viewBox: '0 0 16 16',
// class: 'octicon octicon-alert',
// 'aria-hidden': 'true' },
// toSVG: [Function] }
There will be a key for every icon, with `keywords` and `svg`.
#### `octicons.alert.symbol`
Returns the string of the symbol name
// "x"
#### `octicons.person.path`
Path returns the string representation of the path of the icon.
// <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>
#### `octicons.issue.options`
This is a json object of all the `options` that will be added to the output tag.
// { version: '1.1', width: '12', height: '16', viewBox: '0 0 12 16', class: 'octicon octicon-x', 'aria-hidden': 'true' }
#### `octicons.alert.width`
Width is the icon's true width. Based on the svg view box width. _Note, this doesn't change if you scale it up with size options, it only is the natural width of the icon_
#### `octicons.alert.height`
Height is the icon's true height. Based on the svg view box height. _Note, this doesn't change if you scale it up with size options, it only is the natural height of the icon_
#### `keywords`
Returns an array of keywords for the icon. The data [comes from the octicons repository]( Consider contributing more aliases for the icons.
// ["remove", "close", "delete"]
#### `octicons.alert.toSVG()`
Returns a string of the svg tag
// <svg version="1.1" width="12" height="16" viewBox="0 0 12 16" class="octicon octicon-x" 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"/></svg>
The `.toSVG()` method accepts an optional `options` object. This is used to add CSS classnames, a11y options, and sizing.
##### class
Add more CSS classes to the `<svg>` tag.
octicons.x.toSVG({ "class": "close" })
// <svg version="1.1" width="12" height="16" viewBox="0 0 12 16" class="octicon octicon-x close" 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"/></svg>
##### aria-label
[![Build Status](](
Add accessibility `aria-label` to the icon.
Octicons are a set of SVG icons built by GitHub for GitHub. This repository is a mono repository that contains [distribution libraries for other platforms/languages](#libraries). The vectors for all the icons are stored in a [Figma file][figma-file].
octicons.x.toSVG({ "aria-label": "Close the window" })
// <svg version="1.1" width="12" height="16" viewBox="0 0 12 16" class="octicon octicon-x" aria-label="Close the window" role="img"><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"/></svg>
## Adding/Updating an icon
##### width & height
Read through our [contributing guide](./.github/ if you're planning on adding or updating one of the icons.
Size the SVG icon larger using `width` & `height` independently or together.
## Libraries
octicons.x.toSVG({ "width": 45 })
// <svg version="1.1" width="45" height="60" viewBox="0 0 12 16" class="octicon octicon-x" 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"/></svg>
This repository is a repository containing other packages. Each of them is in the `lib/` folder and gives access to Octicons on a different platform / language.
#### `octicons.alert.toSVGUse()`
### JavaScript
Returns a string of the svg tag with the `<use>` tag, for use with the spritesheet located in the /build/ directory.
The octicons node.js library is the main JavaScript library. With [a JavaScript API](/lib/octicons_node/ that can be used in a variety of applications.
// <svg version="1.1" width="12" height="16" viewBox="0 0 12 16" class="octicon octicon-x" aria-hidden="true"><use xlink:href="#x" /></svg>
| Package | Version |
| **[octicons](/lib/octicons_node)** <br />Node.js package with Javascript API | [![npm version](]( |
| **[@githubprimer/octicons-react](/lib/octicons_react)** <br />React octicons components | [![npm version](]( |
### Ruby
If your environment is Ruby on Rails, we have a [octicons_helper]( gem available that renders SVG in your page. The octicons_helper uses the [octicons_gem]( to do the computing and reading of the SVG files.
### Jekyll
For jekyll, there's a [jekyll-octicons]( plugin available. This works exactly like the octicons_helper.
## Changing, adding, or deleting icons
1. Open the [Sketch document][sketch-document] in `/lib/`. Each icon exists as an artboard within our master Sketch document. If you’re adding an icon, duplicate one of the artboards and add your shapes to it. Be sure to give your artboard a name that makes sense.
2. Once you’re happy with your icon set, choose File > Export…
3. Choose all the artboards you’d like to export and then press “Export”
4. Export to `/lib/svg/`
You’ll next need to build your Octicons.
## Building Octicons
All the files you need will be in the `/build/` directory already, but if you’ve made changes to the `/lib/` directory and need to regenerate, follow these steps:
1. Open the Octicons directory in Terminal
2. `npm install` to install all dependencies for the project.
3. Run the command `npm run build`. This will run the grunt task to build the SVGs, placing them in the `/build/` directory.
## Publishing
If you have access to publish this repository, these are the steps to publishing. If you need access, contact [#design-systems](
1. Update the [](./ with relevant version number and any updates made to the repository.
2. `npm version <newversion>` Run [npm version]( inputing the relevant version type. The versioning is [semver](, so version appropriately based on what has changed.
3. `npm publish` This will publish the new version to
4. `git push && git push --tags` Push all these changes to origin.
| Package | Version |
| **[octicons](/lib/octicons_gem)** <br />Ruby gem with Ruby API | [![Gem version](]( |
| [octicons_helper](/lib/octicons_helper)<br />Rails helper for using octicons| [![Gem version](]( |
| [jekyll-octicons](/lib/octicons_jekyll)<br />Jekyll plugin for using octicons | [![Gem version](]( |
## License
(c) 2012-2016 GitHub, Inc.
(c) GitHub, Inc.
When using the GitHub logos, be sure to follow the [GitHub logo guidelines](
_SVG License:_ [SIL OFL 1.1](
Applies to all SVG files
_Code License:_ [MIT](./LICENSE)
Applies to all other files
"lerna": "2.9.0",
"packages": [
"version": "8.1.0"
"alert": {
"keywords": [
"arrow-down": {
"keywords": [
"arrow-left": {
"keywords": [
"arrow-right": {
"keywords": [
"arrow-small-down": {
"keywords": [
"arrow-small-left": {
"keywords": [
"arrow-small-right": {
"keywords": [