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

Hiding .Counter component when it's empty. #586

Merged
merged 1 commit into from
Oct 19, 2018
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
2 changes: 1 addition & 1 deletion modules/primer-labels/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Use `State--small` for a state label with reduced padding a smaller font size. T

## Counters

Use the `Counter` component to add a count to navigational elements and buttons. Counters come in 3 variations: the default `Counter` with a light gray background, `Counter--gray` with a dark-gray background and inverse white text, and `Counter--gray-light` with a light-gray background and dark gray text.
Use the `Counter` component to add a count to navigational elements and buttons. Counters come in 3 variations: the default `Counter` with a light gray background, `Counter--gray` with a dark-gray background and inverse white text, and `Counter--gray-light` with a light-gray background and dark gray text. When a counter is empty, it's visibility will be hidden.

```html title="Counter"
<span class="Counter">16</span>
Expand Down
4 changes: 4 additions & 0 deletions modules/primer-labels/lib/counters.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
color: $gray-600;
background-color: rgba($black, 0.08);
border-radius: 20px;

&:empty {
visibility: hidden;
}
}

.Counter--gray-light {
Expand Down