Skip to content

Commit ac3a61e

Browse files
silverwindwxiaoguangtechknowlogick
authored
Consolidate more CSS colors into variables (#21402)
Move more colors into variables. The only real notable change is the dot in the release timeline. Also, made the variable comments a bit more clear. <img width="279" alt="Screen Shot 2022-10-10 at 21 10 23" src="https://user-images.githubusercontent.com/115237/194938496-e5a21056-67c4-4219-9c68-134b0edf0e61.png"> <img width="88" alt="Screen Shot 2022-10-10 at 21 31 53" src="https://user-images.githubusercontent.com/115237/194939712-f666c43e-fb1a-4045-be52-1176391bd8ea.png"> <img width="90" alt="Screen Shot 2022-10-10 at 21 31 44" src="https://user-images.githubusercontent.com/115237/194939710-2e620c06-75a9-41b7-a3e1-18eab7a57614.png"> Co-authored-by: wxiaoguang <[email protected]> Co-authored-by: techknowlogick <[email protected]>
1 parent 42b8035 commit ac3a61e

File tree

4 files changed

+30
-65
lines changed

4 files changed

+30
-65
lines changed

web_src/less/_base.less

+22-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
:root {
2-
/* documented customizable variables */
2+
/* fonts */
33
--fonts-proportional: -apple-system, "Segoe UI", system-ui, "Roboto", "Helvetica Neue", "Arial";
44
--fonts-monospace: "SFMono-Regular", "Menlo", "Monaco", "Consolas", "Liberation Mono", "Courier New", monospace, var(--fonts-emoji);
55
--fonts-emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla";
6-
/* other variables */
6+
/* backgrounds */
7+
--checkbox-mask-checked: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="-1 -1 18 18" width="16" height="16"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg>');
8+
--checkbox-mask-indeterminate: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M2 7.75A.75.75 0 012.75 7h10a.75.75 0 010 1.5h-10A.75.75 0 012 7.75z"></path></svg>');
9+
/* non-color variables */
710
--border-radius: .28571429rem;
811
--opacity-disabled: .55;
912
--height-loading: 12rem;
13+
/* base colors */
1014
--color-primary: #4183c4;
1115
--color-primary-dark-1: #3876b3;
1216
--color-primary-dark-2: #31699f;
@@ -61,7 +65,7 @@
6165
/* console colors */
6266
--color-console-fg: #ffffff;
6367
--color-console-bg: #171717;
64-
/* colors */
68+
/* named colors */
6569
--color-red: #db2828;
6670
--color-orange: #f2711c;
6771
--color-yellow: #fbbd08;
@@ -113,7 +117,6 @@
113117
--color-info-border: #a9d5de;
114118
--color-info-bg: #f8ffff;
115119
--color-info-text: #276f86;
116-
/* target-based colors */
117120
--color-body: #ffffff;
118121
--color-text-dark: #080808;
119122
--color-text: #212121;
@@ -159,12 +162,9 @@
159162
--color-tooltip-text: #ffffff;
160163
--color-header-bar: #ffffff;
161164
--color-label-active-bg: #d0d0d0;
162-
/* accent */
163165
--color-small-accent: var(--color-primary-light-6);
164166
--color-accent: var(--color-primary-light-4);
165-
/* backgrounds */
166-
--checkbox-mask-checked: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="-1 -1 18 18" width="16" height="16"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg>');
167-
--checkbox-mask-indeterminate: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M2 7.75A.75.75 0 012.75 7h10a.75.75 0 010 1.5h-10A.75.75 0 012 7.75z"></path></svg>');
167+
--color-active-line: #fffbdd;
168168
}
169169

170170
:root * {
@@ -351,6 +351,10 @@ a.commit-statuses-trigger {
351351
border-bottom: none !important;
352352
}
353353

354+
.ui.dividing.header {
355+
border-bottom-color: var(--color-secondary);
356+
}
357+
354358
.page-content {
355359
margin-top: 15px;
356360
}
@@ -1374,7 +1378,7 @@ footer {
13741378
max-width: calc(100vw - 1rem) !important;
13751379

13761380
.links > * {
1377-
border-left: 1px solid var(--color-secondary);
1381+
border-left: 1px solid var(--color-secondary-dark-1);
13781382
padding-left: 8px;
13791383
margin-left: 5px;
13801384

@@ -1712,7 +1716,7 @@ a.ui.label:hover {
17121716

17131717
.lines-code.active,
17141718
.lines-code .active {
1715-
background: #fffbdd !important;
1719+
background: var(--color-active-line) !important;
17161720
}
17171721

17181722
.blame .lines-num {
@@ -2114,6 +2118,10 @@ table th[data-sortt-desc] {
21142118
vertical-align: -.15em;
21152119
}
21162120

2121+
.minicolors-panel {
2122+
background: var(--color-secondary-dark-1) !important;
2123+
}
2124+
21172125
.labelspage {
21182126
list-style: none;
21192127
padding-top: 0;
@@ -2215,6 +2223,10 @@ table th[data-sortt-desc] {
22152223
margin-top: inherit;
22162224
}
22172225

2226+
.ui.header .sub.header {
2227+
color: var(--color-text-light-1);
2228+
}
2229+
22182230
.flash-error details code,
22192231
.flash-warning details code {
22202232
display: block;

web_src/less/_repository.less

+6-6
Original file line numberDiff line numberDiff line change
@@ -1944,16 +1944,16 @@
19441944
}
19451945

19461946
.dot {
1947-
width: 9px;
1948-
height: 9px;
1949-
background-color: #ddd;
1947+
width: 10px;
1948+
height: 10px;
1949+
background-color: var(--color-secondary-dark-3);
19501950
z-index: 9;
19511951
position: absolute;
19521952
display: block;
1953-
left: -5px;
1953+
left: -6px;
19541954
top: 40px;
1955-
border-radius: 6px;
1956-
border: 1px solid #ffffff;
1955+
border-radius: 100%;
1956+
border: 2.5px solid var(--color-body);
19571957
}
19581958
}
19591959
}

web_src/less/animations.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
animation: isloadingspin 500ms infinite linear;
2525
border-width: 4px;
2626
border-style: solid;
27-
border-color: #ececec #ececec #666 #666;
27+
border-color: var(--color-secondary) var(--color-secondary) var(--color-secondary-dark-8) var(--color-secondary-dark-8);
2828
border-radius: 100%;
2929
}
3030

web_src/less/themes/theme-arc-green.less

+1-48
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@
136136
--color-label-active-bg: #4c525e;
137137
--color-small-accent: var(--color-primary-light-5);
138138
--color-accent: var(--color-primary-light-3);
139+
--color-active-line: #534d1b;
139140
}
140141

141142
::-webkit-calendar-picker-indicator {
@@ -231,10 +232,6 @@ a.ui.basic.green.label:hover {
231232
background-color: #a0cc75;
232233
}
233234

234-
.repository .diff-stats li {
235-
border-color: var(--color-secondary);
236-
}
237-
238235
.ui.red.button,
239236
.ui.red.buttons .button {
240237
background-color: #7d3434;
@@ -245,24 +242,6 @@ a.ui.basic.green.label:hover {
245242
background-color: #984646;
246243
}
247244

248-
.lines-code.active,
249-
.lines-code .active {
250-
background: #534d1b !important;
251-
}
252-
253-
.ui.header .sub.header {
254-
color: var(--color-secondary-dark-6);
255-
}
256-
257-
.ui.dividing.header {
258-
border-bottom: 1px solid var(--color-secondary);
259-
}
260-
261-
.minicolors-panel {
262-
background: var(--color-secondary) !important;
263-
border-color: #6a737d !important;
264-
}
265-
266245
/* invert emojis that are hard to read otherwise */
267246
.emoji[aria-label="check mark"],
268247
.emoji[aria-label="currency exchange"],
@@ -287,36 +266,10 @@ a.ui.basic.green.label:hover {
287266
filter: invert(100%) hue-rotate(180deg);
288267
}
289268

290-
.edit-diff > div > .ui.table {
291-
border-left-color: var(--color-secondary) !important;
292-
border-right-color: var(--color-secondary) !important;
293-
}
294-
295-
footer .container .links > * {
296-
border-left-color: #888;
297-
}
298-
299-
.repository.release #release-list > li .detail .dot {
300-
background-color: #505667;
301-
border-color: #383c4a;
302-
}
303-
304-
.tribute-container {
305-
box-shadow: 0 .25rem .5rem rgba(0, 0, 0, .6);
306-
}
307-
308-
.repository .repo-header .ui.huge.breadcrumb.repo-title .repo-header-icon .avatar {
309-
color: #2a2e3a;
310-
}
311-
312269
img[src$="/img/matrix.svg"] {
313270
filter: invert(80%);
314271
}
315272

316-
.is-loading::after {
317-
border-color: #4a4c58 #4a4c58 #d7d7da #d7d7da;
318-
}
319-
320273
.markup-block-error {
321274
border: 1px solid rgba(121, 71, 66, .5) !important;
322275
border-bottom: none !important;

0 commit comments

Comments
 (0)