Skip to content

Commit 24b60f8

Browse files
silverwindclaude
andauthored
Fix color regressions, add priority color (go-gitea#37417)
- fix markup attention block regressions on 2 colors - added new color "priority" color for important severity in markup - all message-box style, and error form elements use monochrome text - tweaked and improved action logs colors Co-authored-by: Claude (Opus 4.7) <noreply@anthropic.com>
1 parent 683f8c0 commit 24b60f8

11 files changed

Lines changed: 78 additions & 25 deletions

File tree

routers/web/devtest/mock_actions.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ func generateMockStepsLog(logCur actions.LogCursor, opts generateMockStepsLogOpt
3939
"##[group]test group for: step={step}, cursor={cursor}",
4040
"in group msg for: step={step}, cursor={cursor}",
4141
"##[endgroup]",
42+
"::error::mock error for: step={step}, cursor={cursor}",
43+
"::warning::mock warning for: step={step}, cursor={cursor}",
44+
"::notice::mock notice for: step={step}, cursor={cursor}",
45+
"::debug::mock debug for: step={step}, cursor={cursor}",
4246
)
4347
// usually the cursor is the "file offset", but here we abuse it as "line number" to make the mock easier, intentionally
4448
cur := logCur.Cursor

templates/devtest/severity-colors.tmpl

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,25 @@
2020
<p>This is an info message using --color-info-* variables.</p>
2121
</div>
2222

23+
<h2>Markdown Attention Blocks</h2>
24+
<div class="markup render-content">
25+
<blockquote class="attention-header attention-note"><p>{{svg "octicon-info" 16 "attention-icon attention-note"}}<strong class="attention-note">Note</strong></p>
26+
<p>Useful information that users should know, even when skimming content.</p>
27+
</blockquote>
28+
<blockquote class="attention-header attention-tip"><p>{{svg "octicon-light-bulb" 16 "attention-icon attention-tip"}}<strong class="attention-tip">Tip</strong></p>
29+
<p>Helpful advice for doing things better or more easily.</p>
30+
</blockquote>
31+
<blockquote class="attention-header attention-important"><p>{{svg "octicon-report" 16 "attention-icon attention-important"}}<strong class="attention-important">Important</strong></p>
32+
<p>Key information users need to know to achieve their goal.</p>
33+
</blockquote>
34+
<blockquote class="attention-header attention-warning"><p>{{svg "octicon-alert" 16 "attention-icon attention-warning"}}<strong class="attention-warning">Warning</strong></p>
35+
<p>Urgent info that needs immediate user attention to avoid problems.</p>
36+
</blockquote>
37+
<blockquote class="attention-header attention-caution"><p>{{svg "octicon-stop" 16 "attention-icon attention-caution"}}<strong class="attention-caution">Caution</strong></p>
38+
<p>Advises about risks or negative outcomes of certain actions.</p>
39+
</blockquote>
40+
</div>
41+
2342
<h2>Form Fields</h2>
2443
<div class="ui form">
2544
<div class="field error">
@@ -28,6 +47,22 @@
2847
</div>
2948
</div>
3049

50+
<h2>Error Input</h2>
51+
<div class="ui input error">
52+
<input type="text" value="Invalid input" readonly>
53+
</div>
54+
55+
<h2>Attached Section Boxes</h2>
56+
<h3 class="ui top attached error header">Error Header</h3>
57+
<div class="ui attached error segment">Error section body content.</div>
58+
<h3 class="ui top attached warning header tw-mt-3">Warning Header</h3>
59+
<div class="ui attached warning segment">Warning section body content.</div>
60+
61+
<h2>Banner Preview (info-tinted)</h2>
62+
<div class="web-banner-content-editor">
63+
<div class="render-content render-preview">Banner preview content</div>
64+
</div>
65+
3166
<h2>Labels</h2>
3267
<div class="flex-text-block tw-gap-2">
3368
<div class="ui red label">Red</div>

web_src/css/admin.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@
5555
padding: 1em 1.5em;
5656
border: 1px solid var(--color-info-border);
5757
background: var(--color-info-bg);
58-
color: var(--color-info-text);
58+
color: var(--color-text);
5959
}

web_src/css/base.css

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -501,10 +501,10 @@ img.ui.avatar,
501501
}
502502

503503
blockquote.attention-note {
504-
border-left-color: var(--color-blue-dark-1);
504+
border-left-color: var(--color-info-text);
505505
}
506506
strong.attention-note, svg.attention-note {
507-
color: var(--color-blue-dark-1);
507+
color: var(--color-info-text);
508508
}
509509

510510
blockquote.attention-tip {
@@ -515,10 +515,10 @@ strong.attention-tip, svg.attention-tip {
515515
}
516516

517517
blockquote.attention-important {
518-
border-left-color: var(--color-violet-dark-1);
518+
border-left-color: var(--color-priority-text);
519519
}
520520
strong.attention-important, svg.attention-important {
521-
color: var(--color-violet-dark-1);
521+
color: var(--color-priority-text);
522522
}
523523

524524
blockquote.attention-warning {
@@ -529,10 +529,10 @@ strong.attention-warning, svg.attention-warning {
529529
}
530530

531531
blockquote.attention-caution {
532-
border-left-color: var(--color-red-dark-1);
532+
border-left-color: var(--color-error-text);
533533
}
534534
strong.attention-caution, svg.attention-caution {
535-
color: var(--color-red-dark-1);
535+
color: var(--color-error-text);
536536
}
537537

538538
/* FIXME: this is a longstanding dirty patch since 2015, it only makes the pages more messy and shouldn't be used */

web_src/css/modules/form.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,14 @@ textarea:focus,
198198
.ui.form .field.error input {
199199
background-color: var(--color-error-bg);
200200
border-color: var(--color-error-border);
201-
color: var(--color-error-text);
201+
color: var(--color-input-text);
202202
}
203203
.ui.form .field.error textarea:focus,
204204
.ui.form .field.error select:focus,
205205
.ui.form .field.error input:focus {
206206
background-color: var(--color-error-bg);
207207
border-color: var(--color-error-border);
208-
color: var(--color-error-text);
208+
color: var(--color-input-text);
209209
}
210210

211211
.ui.form .field.error select {

web_src/css/modules/input.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
.ui.input.error > input {
3939
background: var(--color-error-bg);
4040
border-color: var(--color-error-border);
41-
color: var(--color-error-text);
41+
color: var(--color-input-text);
4242
}
4343

4444
.ui.icon.input > i.icon {

web_src/css/modules/message.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ details.ui.message:not(:has(pre)) summary {
7070
.ui.blue.message,
7171
.ui.attached.blue.message {
7272
background: var(--color-info-bg);
73-
color: var(--color-info-text);
7473
border-color: var(--color-info-border);
7574
}
7675

@@ -79,7 +78,6 @@ details.ui.message:not(:has(pre)) summary {
7978
.ui.positive.message,
8079
.ui.attached.positive.message {
8180
background: var(--color-success-bg);
82-
color: var(--color-success-text);
8381
border-color: var(--color-success-border);
8482
}
8583

@@ -89,14 +87,12 @@ details.ui.message:not(:has(pre)) summary {
8987
.ui.negative.message,
9088
.ui.attached.negative.message {
9189
background: var(--color-error-bg);
92-
color: var(--color-error-text);
9390
border-color: var(--color-error-border);
9491
}
9592

9693
.ui.warning.message,
9794
.ui.attached.warning.message {
9895
background: var(--color-warning-bg);
99-
color: var(--color-warning-text);
10096
border-color: var(--color-warning-border);
10197
}
10298

web_src/css/themes/theme-gitea-dark.css

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,19 @@ gitea-theme-meta-info {
163163
--color-error-bg: #322226;
164164
--color-error-bg-active: #49262a;
165165
--color-error-bg-hover: #3c2427;
166-
--color-error-text: var(--color-text);
166+
--color-error-text: #f85149;
167167
--color-success-border: #225633;
168168
--color-success-bg: #1c3329;
169-
--color-success-text: var(--color-text);
169+
--color-success-text: #3fb950;
170170
--color-warning-border: #5f481a;
171171
--color-warning-bg: #342e1f;
172-
--color-warning-text: var(--color-text);
172+
--color-warning-text: #d29922;
173173
--color-info-border: #254a7e;
174174
--color-info-bg: #1b283a;
175-
--color-info-text: var(--color-text);
175+
--color-info-text: #2f81f7;
176+
--color-priority-border: #4a268d;
177+
--color-priority-bg: #251c39;
178+
--color-priority-text: #a371f7;
176179
--color-red-badge: #db2828;
177180
--color-red-badge-bg: #db28281a;
178181
--color-red-badge-hover-bg: #db28284d;

web_src/css/themes/theme-gitea-light.css

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,19 @@ gitea-theme-meta-info {
163163
--color-error-bg: #ffebe9;
164164
--color-error-bg-active: #ffcecb;
165165
--color-error-bg-hover: #ffdcd7;
166-
--color-error-text: var(--color-text);
166+
--color-error-text: #d1242f;
167167
--color-success-border: #4ac26b66;
168168
--color-success-bg: #dafbe1;
169-
--color-success-text: var(--color-text);
169+
--color-success-text: #1a7f37;
170170
--color-warning-border: #d4a72c66;
171171
--color-warning-bg: #fff8c5;
172-
--color-warning-text: var(--color-text);
172+
--color-warning-text: #9a6700;
173173
--color-info-border: #54aeff66;
174174
--color-info-bg: #ddf4ff;
175-
--color-info-text: var(--color-text);
175+
--color-info-text: #0969da;
176+
--color-priority-border: #b9a1ff66;
177+
--color-priority-bg: #f3e7ff;
178+
--color-priority-text: #8250df;
176179
--color-red-badge: #db2828;
177180
--color-red-badge-bg: #db28281a;
178181
--color-red-badge-hover-bg: #db28284d;

web_src/js/components/ActionRunJobView.vue

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,14 @@ async function hashChangeListener() {
661661
background: var(--color-warning-bg);
662662
}
663663
664+
.job-step-logs .log-line-notice {
665+
background: var(--color-info-bg);
666+
}
667+
668+
.job-step-logs .log-line-debug {
669+
background: var(--color-secondary-alpha-30);
670+
}
671+
664672
.job-step-logs .log-cmd-error > .log-msg-label {
665673
color: var(--color-error-text);
666674
}
@@ -669,7 +677,11 @@ async function hashChangeListener() {
669677
color: var(--color-warning-text);
670678
}
671679
672-
.job-step-logs .log-cmd-debug {
680+
.job-step-logs .log-cmd-notice > .log-msg-label {
681+
color: var(--color-info-text);
682+
}
683+
684+
.job-step-logs .log-cmd-debug > .log-msg-label {
673685
color: var(--color-violet);
674686
}
675687

0 commit comments

Comments
 (0)