Skip to content
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
10 changes: 10 additions & 0 deletions .changeset/breezy-comics-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@primer/css': major
---

## Removed DiffStat component

- the diffStat component is removed from primer/css
- the component is very specific to this use-case, it is not generic enough to be part of the primer design system and was thus chosen for removal
- the component will be added to the github codebase directly so that it is still available
- if you are working within github.com you should be ale to use diffStat just like before. On other projects you will need to copy the diffStat code and add it to your codebase
23 changes: 0 additions & 23 deletions docs/content/components/labels.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,26 +99,3 @@ If an issue label needs to be bigger, add the `.IssueLabel--big` modifier.
<span class="IssueLabel IssueLabel--big color-bg-success-emphasis color-fg-on-emphasis mr-1">help wanted</span>
<span class="IssueLabel IssueLabel--big color-bg-attention-emphasis color-fg-on-emphasis mr-1">🚂 deploy: train</span>
```

## Diffstat

Diffstats show how many deletions or additions a diff has. It's typically a row of 5 blocks that get colored with green or red.

```html live
<span class="diffstat tooltipped tooltipped-e" aria-label="6 changes: 3 additions &amp; 3 deletions">
6
<span class="diffstat-block-added"></span><span class="diffstat-block-added"></span><span class="diffstat-block-deleted"></span><span class="diffstat-block-deleted"></span><span class="diffstat-block-neutral"></span>
</span>
```

Use the `color-fg-success` and `color-fg-danger` utilities to add additional information about the size of the diff.

```html live
<span class="diffstat">
<span class="color-fg-success">+7</span>
<span class="color-fg-danger">−2</span>
<span class="tooltipped tooltipped-e" aria-label="9 lines changed">
<span class="diffstat-block-added"></span><span class="diffstat-block-added"></span><span class="diffstat-block-added"></span><span class="diffstat-block-deleted"></span><span class="diffstat-block-neutral"></span>
</span>
</span>
```
19 changes: 0 additions & 19 deletions docs/content/stickersheet/labels.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,22 +128,3 @@ The base <span class="Label Label--inline"> label </span> component styles the t
<span class="Counter Counter--small mr-1 Counter--gray">456</span>
<span class="Counter Counter--small mr-1">1.5K</span>
```

### Diffstat

```html live
<span class="diffstat tooltipped tooltipped-e" aria-label="6 changes: 3 additions &amp; 3 deletions">
6
<span class="diffstat-block-added"></span><span class="diffstat-block-added"></span><span class="diffstat-block-deleted"></span><span class="diffstat-block-deleted"></span><span class="diffstat-block-neutral"></span>
</span>

<div class="my-4"></div><!-- Spacer ------------------------ -->

<span class="diffstat">
<span class="color-fg-success">+7</span>
<span class="color-fg-danger">−2</span>
<span class="tooltipped tooltipped-e" aria-label="9 lines changed">
<span class="diffstat-block-added"></span><span class="diffstat-block-added"></span><span class="diffstat-block-added"></span><span class="diffstat-block-deleted"></span><span class="diffstat-block-neutral"></span>
</span>
</span>
```
47 changes: 0 additions & 47 deletions docs/src/stories/components/Label/LabelDiffstat.stories.jsx

This file was deleted.

37 changes: 0 additions & 37 deletions src/labels/diffstat.scss

This file was deleted.

1 change: 0 additions & 1 deletion src/labels/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
@import './labels.scss';
@import './states.scss';
@import './counters.scss';
@import './diffstat.scss';