3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Octicons使ってみた

Last updated at Posted at 2014-06-21

GitHubがOcticonsを公開したので、Chrome Storeで公開しているGitHub Checkerに早速使ってみた。

GitHub Checkerに関する以前の投稿はこちら

使用前

Screen Shot 2014-06-21 at 5.49.05 PM.png

htmlとcssはこんな感じ

<h3 class="repo-title"><a href="https://github.com/dtaniwaki/github-checker">kaizenplatform / github-checker</a></h3>
.repo-title {
  display: block;
  margin-bottom: 10px;
  padding-left: 20px;
  padding-bottom: 5px;
  border-bottom: 1px solid #eee;
  background: url('/images/repo.png') no-repeat 0 0;
  font-size: 1.2em;
}

使用後

Screen Shot 2014-06-21 at 5.49.13 PM.png

htmlとcssはこんな感じ

<h3 class="repo-title"><span class="octicon octicon-repo"></span><a href="https://github.com/dtaniwaki/github-checker">kaizenplatform / github-checker</a></h3>
.octicon {
  font-size: 16px;
}
.repo-title {
  display: block;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #eee;
  font-size: 1.2em;
  .octicon {
    margin-right: 10px;
  }
}

octiconクラスとoction-xxxクラスを持ったspanを追加するだけ。
octiconは16pxの倍数にすると奇麗に見えるので推奨とのこと。

今までGitHubのサイト上の画像を切り出して使うというアナログなことをしていたので、全アイコンが簡単に使えて良かった!

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?