Skip to content

Commit 0de5460

Browse files
authored
CSS color variables, less bold font weight and more (#13567)
* CSS color variables, less bold font weight - Define color variables for fully saturated colors and apply them where it made sense - Add background color helper classes - Globally reduce bold font weight from 700 to 500 - Remove border from timeline icons - Unify dropzone styling - Various border style consolidations * attempt to fix test * another attempt at tests * fix contains
1 parent 7a30e97 commit 0de5460

File tree

20 files changed

+221
-225
lines changed

20 files changed

+221
-225
lines changed

integrations/pull_merge_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ func TestCantMergeWorkInProgress(t *testing.T) {
194194
req := NewRequest(t, "GET", resp.Header().Get("Location"))
195195
resp = session.MakeRequest(t, req, http.StatusOK)
196196
htmlDoc := NewHTMLParser(t, resp.Body)
197-
text := strings.TrimSpace(htmlDoc.doc.Find(".attached.merge-section.no-header > .text.grey").Last().Text())
197+
text := strings.TrimSpace(htmlDoc.doc.Find(".merge-section > .item").Last().Text())
198198
assert.NotEmpty(t, text, "Can't find WIP text")
199199

200200
// remove <strong /> from lang

integrations/pull_status_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func TestPullCreate_EmptyChangesWithCommits(t *testing.T) {
114114
resp := session.MakeRequest(t, req, http.StatusOK)
115115
doc := NewHTMLParser(t, resp.Body)
116116

117-
text := strings.TrimSpace(doc.doc.Find(".item.text.green").Text())
118-
assert.EqualValues(t, "This pull request can be merged automatically.", text)
117+
text := strings.TrimSpace(doc.doc.Find(".merge-section").Text())
118+
assert.Contains(t, text, "This pull request can be merged automatically.")
119119
})
120120
}

templates/repo/issue/view_content/comments.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
</div>
9292
{{else if eq .Type 1}}
9393
<div class="timeline-item event" id="{{.HashTag}}">
94-
<span class="badge">{{svg "octicon-dot-fill"}}</span>
94+
<span class="badge bg-green text-white">{{svg "octicon-dot-fill"}}</span>
9595
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
9696
<img src="{{.Poster.RelAvatarLink}}">
9797
</a>
@@ -106,7 +106,7 @@
106106
</div>
107107
{{else if eq .Type 2}}
108108
<div class="timeline-item event" id="{{.HashTag}}">
109-
<span class="badge">{{svg "octicon-circle-slash"}}</span>
109+
<span class="badge bg-red text-white">{{svg "octicon-circle-slash"}}</span>
110110
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
111111
<img src="{{.Poster.RelAvatarLink}}">
112112
</a>
@@ -121,7 +121,7 @@
121121
</div>
122122
{{else if eq .Type 28}}
123123
<div class="timeline-item event" id="{{.HashTag}}">
124-
<span class="badge purple">{{svg "octicon-git-merge"}}</span>
124+
<span class="badge bg-purple text-white">{{svg "octicon-git-merge"}}</span>
125125
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
126126
<img src="{{.Poster.RelAvatarLink}}">
127127
</a>

templates/repo/issue/view_content/pull.tmpl

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
{{$canAutoMerge := false}}
9898
<div class="ui attached merge-section segment {{if not $.LatestCommitStatus}}no-header{{end}}">
9999
{{if .Issue.PullRequest.HasMerged}}
100-
<div class="item text purple">
100+
<div class="item text">
101101
{{if .Issue.PullRequest.MergedCommitID}}
102102
{{$link := printf "%s/commit/%s" $.Repository.HTMLURL .Issue.PullRequest.MergedCommitID}}
103103
{{$.i18n.Tr "repo.pulls.merged_as" $link (ShortSha .Issue.PullRequest.MergedCommitID) | Safe}}
@@ -112,7 +112,7 @@
112112
</div>
113113
{{end}}
114114
{{else if .Issue.IsClosed}}
115-
<div class="item text grey">
115+
<div class="item text">
116116
{{if .IsPullRequestBroken}}
117117
{{$.i18n.Tr "repo.pulls.cant_reopen_deleted_branch"}}
118118
{{else}}
@@ -126,46 +126,46 @@
126126
</div>
127127
{{end}}
128128
{{else if .IsPullFilesConflicted}}
129-
<div class="item text grey">
129+
<div class="item text">
130130
{{svg "octicon-x"}}
131131
{{$.i18n.Tr "repo.pulls.files_conflicted"}}
132132
{{range .ConflictedFiles}}
133133
<div>{{.}}</div>
134134
{{end}}
135135
</div>
136136
{{else if .IsPullRequestBroken}}
137-
<div class="item text red">
137+
<div class="item">
138138
<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
139139
{{$.i18n.Tr "repo.pulls.data_broken"}}
140140
</div>
141141
{{else if .IsPullWorkInProgress}}
142-
<div class="item text grey">
142+
<div class="item">
143143
<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
144144
{{$.i18n.Tr "repo.pulls.cannot_merge_work_in_progress" (.WorkInProgressPrefix|Escape) | Str2html}}
145145
</div>
146146
{{else if .Issue.PullRequest.IsChecking}}
147-
<div class="item text yellow">
147+
<div class="item">
148148
<i class="icon icon-octicon">{{svg "octicon-sync"}}</i>
149149
{{$.i18n.Tr "repo.pulls.is_checking"}}
150150
</div>
151151
{{else if .Issue.PullRequest.CanAutoMerge}}
152152
{{if .IsBlockedByApprovals}}
153-
<div class="item text red">
153+
<div class="item">
154154
<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
155155
{{$.i18n.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .Issue.PullRequest.ProtectedBranch.RequiredApprovals}}
156156
</div>
157157
{{else if .IsBlockedByRejection}}
158-
<div class="item text red">
158+
<div class="item">
159159
<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
160160
{{$.i18n.Tr "repo.pulls.blocked_by_rejection"}}
161161
</div>
162162
{{else if .IsBlockedByOutdatedBranch}}
163-
<div class="item text red">
163+
<div class="item">
164164
<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
165165
{{$.i18n.Tr "repo.pulls.blocked_by_outdated_branch"}}
166166
</div>
167167
{{else if .IsBlockedByChangedProtectedFiles}}
168-
<div class="item text red">
168+
<div class="item">
169169
<i class="icon icon-octicon">{{svg "octicon-x" 16}}</i>
170170
{{$.i18n.Tr (TrN $.i18n.Lang $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n") | Safe }}
171171
<div class="ui ordered list">
@@ -175,45 +175,45 @@
175175
</div>
176176
</div>
177177
{{else if and .EnableStatusCheck (or .RequiredStatusCheckState.IsError .RequiredStatusCheckState.IsFailure)}}
178-
<div class="item text red">
178+
<div class="item">
179179
<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
180180
{{$.i18n.Tr "repo.pulls.required_status_check_failed"}}
181181
</div>
182182
{{else if and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess)}}
183-
<div class="item text red">
183+
<div class="item">
184184
<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
185185
{{$.i18n.Tr "repo.pulls.required_status_check_missing"}}
186186
</div>
187187
{{else if and .AllowMerge .RequireSigned (not .WillSign)}}
188-
<div class="item text red">
188+
<div class="item">
189189
<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
190190
{{$.i18n.Tr "repo.pulls.require_signed_wont_sign"}}
191191
</div>
192-
<div class="item text yellow">
192+
<div class="item">
193193
<i class="icon unlock"></i>
194194
{{$.i18n.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason) }}
195195
</div>
196196
{{end}}
197197
{{$notAllOverridableChecksOk := or .IsBlockedByApprovals .IsBlockedByRejection .IsBlockedByOutdatedBranch .IsBlockedByChangedProtectedFiles (and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess))}}
198198
{{if and (or $.IsRepoAdmin (not $notAllOverridableChecksOk)) (or (not .AllowMerge) (not .RequireSigned) .WillSign)}}
199199
{{if $notAllOverridableChecksOk}}
200-
<div class="item text yellow">
200+
<div class="item">
201201
<i class="icon icon-octicon">{{svg "octicon-dot-fill"}}</i>
202202
{{$.i18n.Tr "repo.pulls.required_status_check_administrator"}}
203203
</div>
204204
{{else}}
205-
<div class="item text green">
205+
<div class="item">
206206
<i class="icon icon-octicon">{{svg "octicon-check"}}</i>
207207
{{$.i18n.Tr "repo.pulls.can_auto_merge_desc"}}
208208
</div>
209209
{{end}}
210210
{{if .WillSign}}
211-
<div class="item text green">
211+
<div class="item">
212212
<i class="icon lock green"></i>
213213
{{$.i18n.Tr "repo.signing.will_sign" .SigningKey}}
214214
</div>
215215
{{else if .IsSigned}}
216-
<div class="item text">
216+
<div class="item">
217217
<i class="icon unlock"></i>
218218
{{$.i18n.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason) }}
219219
</div>
@@ -223,7 +223,7 @@
223223
{{$canAutoMerge = true}}
224224
{{if (gt .Issue.PullRequest.CommitsBehind 0)}}
225225
<div class="ui divider"></div>
226-
<div class="item item-section text grey">
226+
<div class="item item-section">
227227
<div class="item-section-left">
228228
<i class="icon icon-octicon">{{svg "octicon-alert"}}</i>
229229
{{$.i18n.Tr "repo.pulls.outdated_with_base_branch"}}

web_src/fomantic/_site/globals/site.variables

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22

33
@headerFont: var(--fonts-regular);
44
@pageFont: var(--fonts-regular);
5+
@bold: 500;

0 commit comments

Comments
 (0)