Skip to content

Commit 21d6faf

Browse files
committed
fix merge timeline event having wrong color
1 parent 656698e commit 21d6faf

File tree

4 files changed

+39
-12
lines changed

4 files changed

+39
-12
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ Reverted closed issues from purple to red on:
2020
- Issues on projects
2121
- Issues on projects (beta)
2222

23-
Found a bug? Open a new [issue](https://github.com/Katsute/GitHub-Red-Closed-Issues-Extension/issues).
23+
Found a bug? Open a new [issue](https://github.com/Katsute/GitHub-Red-Closed-Issues-Extension/issues).

src/index.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright (C) 2021 Katsute <https://github.com/Katsute>
2+
3+
"use strict";
4+
5+
identifyTimelineMerge();
6+
7+
// run for 30s in case the site hasn't loaded yet
8+
let loop = 0;
9+
const interval = setInterval(() => {
10+
identifyTimelineMerge();
11+
if(loop++ >= 30)
12+
clearInterval(this);
13+
}, 1000);
14+
15+
// find merge
16+
function identifyTimelineMerge(){
17+
for(let element of document.getElementsByClassName("TimelineItem-badge color-fg-on-emphasis color-bg-done-emphasis"))
18+
if(element.getElementsByTagName("svg")[0].classList.contains("octicon-git-merge"))
19+
element.classList.add("rcie-merge");
20+
}

src/manifest.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
"name": "GitHub Red Closed Issues",
55
"author": "Katsute",
66
"description": "Revert closed GitHub issues from purple back to red.",
7-
"version": "1.1",
7+
"version": "1.2",
88
"homepage_url": "https://github.com/Katsute/GitHub-Red-Issues-Extension",
99

1010
"permissions": ["tabs"],
1111
"content_scripts": [{
1212
"css": ["style.css"],
13+
"js": ["index.js"],
1314
"matches": ["https://github.com/*"]
1415
}]
1516
}

src/style.css

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,51 @@
11
/* Copyright (C) 2021 Katsute <https://github.com/Katsute> */
22

3+
:root {
4+
--rcie-pull-merged: #8957e5;
5+
--rcie-issue-closed: #F85149;
6+
--rcie-white: #F0F6Fc;
7+
}
8+
39
/* issue icon */
410

511
.issue-closed-done .octicon-issue-closed {
6-
color: #F85149 !important;
12+
color: var(--rcie-issue-closed) !important;
713
}
814

915
/* issue hover */
1016

1117
.Popover .octicon.octicon-issue-closed.color-text-danger {
12-
color: #F85149 !important;
18+
color: var(--rcie-issue-closed) !important;
1319
}
1420

1521
/* subscriptions */
1622

1723
.issue-closed-done .octicon.octicon-issue-closed.color-text-danger {
18-
color: #F85149 !important;
24+
color: var(--rcie-issue-closed) !important;
1925
}
2026

2127
/* issue badge */
2228

2329
span[title="Status: Closed"] {
24-
background-color: #F85149 !important;
30+
background-color: var(--rcie-issue-closed) !important;
2531
}
2632

2733
span[title="Status: Closed"] .octicon-issue-closed {
28-
color: #F0F6Fc !important;
34+
color: var(--rcie-white) !important;
2935
}
3036

3137
/* timeline */
3238

33-
.TimelineItem-badge.color-bg-done-emphasis {
34-
background-color: #F85149 !important;
39+
:not(.rcie-merge).TimelineItem-badge.color-bg-done-emphasis {
40+
background-color: var(--rcie-issue-closed) !important;
3541
}
3642

37-
.TimelineItem-badge.color-bg-done-emphasis .octicon {
38-
color: #F0F6Fc !important;
43+
:not(.rcie-merge).TimelineItem-badge.color-bg-done-emphasis .octicon {
44+
color: var(--rcie-white) !important;
3945
}
4046

4147
/* projects beta */
4248

4349
svg[aria-label="Closed issue"] {
44-
color: #F85149 !important;
50+
color: var(--rcie-issue-closed) !important;
4551
}

0 commit comments

Comments
 (0)