Skip to content

Commit

Permalink
Add new color Labels (#1711)
Browse files Browse the repository at this point in the history
* Add new role colors to .Label

* Create kind-cycles-hope.md
  • Loading branch information
simurai authored Oct 28, 2021
1 parent f7c44c3 commit bc3b94d
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/kind-cycles-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/css": minor
---

Add new color `Label`s
14 changes: 10 additions & 4 deletions docs/content/components/labels.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,22 @@ Use `Label--secondary` to create a label with a subtler text color. This label i

Labels come in a few different functional classes. Use to communicate the content of the label, and ensure it's used consistently.

- `Label--info`
- `Label--accent`
- `Label--success`
- `Label--warning`
- `Label--attention`
- `Label--severe`
- `Label--danger`
- `Label--done`
- `Label--sponsors`

```html live
<span class="Label mr-1 Label--info">Info</span>
<span class="Label mr-1 Label--accent">Accent</span>
<span class="Label mr-1 Label--success">Success</span>
<span class="Label mr-1 Label--warning">Warning</span>
<span class="Label mr-1 Label--attention">Attention</span>
<span class="Label mr-1 Label--severe">Severe</span>
<span class="Label mr-1 Label--danger">Danger</span>
<span class="Label mr-1 Label--done">Done</span>
<span class="Label mr-1 Label--sponsors">Sponsors</span>
```

### Label sizes
Expand Down
25 changes: 22 additions & 3 deletions src/labels/labels.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
@include labels--inline;
}

// Colors
// Contrast

.Label--primary {
color: var(--color-fg-default);
Expand All @@ -42,7 +42,10 @@
border-color: var(--color-border-default);
}

.Label--info {
// Colors

.Label--info, // TODO: deprecate
.Label--accent {
color: var(--color-accent-fg);
border-color: var(--color-accent-emphasis);
}
Expand All @@ -52,12 +55,28 @@
border-color: var(--color-success-emphasis);
}

.Label--warning {
.Label--warning, // TODO: deprecate
.Label--attention {
color: var(--color-attention-fg);
border-color: var(--color-attention-emphasis);
}

.Label--severe {
color: var(--color-severe-fg);
border-color: var(--color-severe-emphasis);
}

.Label--danger {
color: var(--color-danger-fg);
border-color: var(--color-danger-emphasis);
}

.Label--done {
color: var(--color-done-fg);
border-color: var(--color-done-emphasis);
}

.Label--sponsors {
color: var(--color-sponsors-fg);
border-color: var(--color-sponsors-emphasis);
}

0 comments on commit bc3b94d

Please sign in to comment.