Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add IssueLabel component #953

Merged
merged 3 commits into from
Oct 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}