File tree Expand file tree Collapse file tree 4 files changed +61
-0
lines changed Expand file tree Collapse file tree 4 files changed +61
-0
lines changed Original file line number Diff line number Diff line change @@ -174,3 +174,26 @@ Counters can also be used in `Box` headers to indicate the number of items in a
174174 </ul >
175175</div >
176176```
177+
178+ ## Diffstat
179+
180+ 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.
181+
182+ ``` html live
183+ <span class =" diffstat tooltipped tooltipped-e" aria-label =" 6 changes: 3 additions & ; 3 deletions" >
184+ 6
185+ <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 >
186+ </span >
187+ ```
188+
189+ Use the ` text-green ` and ` text-red ` utilities to add addtitional information about the size of the diff.
190+
191+ ``` html live
192+ <span class =" diffstat" >
193+ <span class =" text-green" >+7</span >
194+ <span class =" text-red" >−2</span >
195+ <span class =" tooltipped tooltipped-e" aria-label =" 9 lines changed" >
196+ <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 >
197+ </span >
198+ </span >
199+ ```
Original file line number Diff line number Diff line change 1+ // diffstat
2+ //
3+ // Green/red blocks showing additions and deletions
4+
5+ .diffstat {
6+ font-size : $h6-size ;
7+ font-weight : $font-weight-bold ;
8+ color : $text-gray ;
9+ white-space : nowrap ;
10+ cursor : default ;
11+ }
12+
13+ .diffstat-block-deleted ,
14+ .diffstat-block-added ,
15+ .diffstat-block-neutral {
16+ display : inline-block ;
17+ width : $spacer-2 ;
18+ height : $spacer-2 ;
19+ margin-left : 1px ;
20+ }
21+
22+ .diffstat-block-deleted {
23+ background-color : $bg-diffstat-deleted ;
24+ }
25+
26+ .diffstat-block-added {
27+ background-color : $bg-diffstat-added ;
28+ }
29+
30+ .diffstat-block-neutral {
31+ background-color : $bg-diffstat-neutral ;
32+ }
Original file line number Diff line number Diff line change 33@import " ./labels.scss" ;
44@import " ./states.scss" ;
55@import " ./counters.scss" ;
6+ @import " ./diffstat.scss" ;
Original file line number Diff line number Diff line change @@ -54,6 +54,11 @@ $bg-yellow: $yellow-500 !default;
5454$bg-yellow-light : $yellow-200 !default ;
5555$bg-yellow-dark : $yellow-700 !default ;
5656
57+ // diffstat background colors
58+ $bg-diffstat-added : darken ($green-400 , 5% ) !default ;
59+ $bg-diffstat-deleted : $red-600 !default ;
60+ $bg-diffstat-neutral : $gray-300 !default ;
61+
5762// Text colors
5863$text-blue : $blue-500 !default ;
5964$text-gray-dark : $gray-900 !default ;
You can’t perform that action at this time.
0 commit comments