Skip to content

Commit

Permalink
Merge pull request #953 from primer/issue-label
Browse files Browse the repository at this point in the history
Add IssueLabel component
  • Loading branch information
shawnbot authored Oct 23, 2019
2 parents 7df15de + 9a9483b commit 435abad
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/content/components/labels.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,25 @@ Use `Label--outline-green` in combination with `Label--outline` to communicate a
<span title="Label: green outline label" class="Label Label--outline Label--outline-green">green outlined label</span>
```

## Issue Labels

Issue Labels are used for adding labels to issues and pull requests. They also come with emoji support.

```html live
<span class="IssueLabel bg-blue text-white mr-1" title="Label: good first issue">good first issue</span>
<span class="IssueLabel bg-red text-white mr-1" title="Label: bug">bug 🐛</span>
<span class="IssueLabel bg-green text-white" title="Label: bug">help wanted</span>
```

If an Issue Label needs to be bigger, add the `.IssueLabel--big` modifier.

```html live
<span class="IssueLabel IssueLabel--big bg-blue text-white mr-1" title="Label: good first issue">good first issue</span>
<span class="IssueLabel IssueLabel--big bg-red text-white mr-1" title="Label: bug">bug 🐛</span>
<span class="IssueLabel IssueLabel--big bg-green text-white" title="Label: bug">help wanted</span>
```


## States

Use state labels to inform users of an items status. States are large labels with bolded text. The default state has a gray background.
Expand Down
1 change: 1 addition & 0 deletions src/labels/index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "../support/index.scss";
@import "./issue-labels.scss";
@import "./labels.scss";
@import "./states.scss";
@import "./counters.scss";
40 changes: 40 additions & 0 deletions src/labels/issue-labels.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Issue Labels

.IssueLabel {
height: 20px;
padding: 0.15em $spacer-1;
font-size: $h6-size;
font-weight: $font-weight-bold;
line-height: 15px;
border-radius: 2px;
box-shadow: inset 0 -1px 0 rgba($black, 0.12);

.g-emoji {
position: relative;
top: -0.05em;
display: inline-block;
font-size: 1em;
line-height: $lh-condensed-ultra;
}

&:hover {
text-decoration: none;
}
}

.IssueLabel--big {
padding: $spacer-1 $spacer-2;
font-size: $h5-size;
font-weight: $font-weight-bold;
border-radius: $border-radius;
transition: opacity 0.2s linear;

.g-emoji {
display: inline-block;
margin-top: -1px;
}

&:hover {
opacity: 0.85;
}
}

0 comments on commit 435abad

Please sign in to comment.