Skip to content

Commit dca2f93

Browse files
delvhsilverwind
andauthored
Unify border-radius behavior (#26770)
## Changes - no more hardcoded `border-radius`es (apart from `0`) - no more value inconsistencies - no more guessing what pixel value you should use - two new variables: - `--border-radius-medium` (for elements where the normal border radius does not suffice) - `--border-radius-circle` (for displaying circles) --------- Co-authored-by: silverwind <[email protected]>
1 parent ac2f8c9 commit dca2f93

File tree

17 files changed

+41
-42
lines changed

17 files changed

+41
-42
lines changed

web_src/css/base.css

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
--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>');
1717
--octicon-chevron-right: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path d="M6.22 3.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L9.94 8 6.22 4.28a.75.75 0 0 1 0-1.06Z"></path></svg>');
1818
/* non-color variables */
19-
--border-radius: 0.28571429rem;
19+
--border-radius: 4px;
20+
--border-radius-medium: 6px;
21+
--border-radius-circle: 100%;
2022
--opacity-disabled: 0.55;
2123
--height-loading: 16rem;
2224
--tab-size: 4;
@@ -309,7 +311,7 @@ details summary > * {
309311

310312
progress {
311313
background: var(--color-secondary-dark-1);
312-
border-radius: 6px;
314+
border-radius: var(--border-radius);
313315
border: none;
314316
overflow: hidden;
315317
}
@@ -339,7 +341,7 @@ progress::-moz-progress-bar {
339341
::-webkit-scrollbar-thumb {
340342
box-shadow: inset 0 0 0 6px var(--color-primary);
341343
border: 2px solid transparent;
342-
border-radius: 5px !important;
344+
border-radius: var(--border-radius);
343345
}
344346

345347
::-webkit-scrollbar-thumb:window-inactive {
@@ -454,7 +456,7 @@ a.label,
454456

455457
.issue-title code {
456458
padding: 2px 4px;
457-
border-radius: 6px;
459+
border-radius: var(--border-radius-medium);
458460
background-color: var(--color-markup-code-block);
459461
}
460462

@@ -1510,7 +1512,7 @@ img.ui.avatar,
15101512
margin-left: 0.4em;
15111513
height: 0.67em;
15121514
width: 0.67em;
1513-
border-radius: 0.15em;
1515+
border-radius: var(--border-radius);
15141516
}
15151517

15161518
.attention-icon {
@@ -2013,7 +2015,7 @@ a.ui.basic.label:hover {
20132015

20142016
.color-icon {
20152017
display: inline-block;
2016-
border-radius: 100%;
2018+
border-radius: var(--border-radius-circle);
20172019
height: 14px;
20182020
width: 14px;
20192021
}

web_src/css/dashboard.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898

9999
.feeds code {
100100
padding: 2px 4px;
101-
border-radius: 3px;
101+
border-radius: var(--border-radius);
102102
background-color: var(--color-markup-code-block);
103103
word-break: break-all;
104104
}

web_src/css/editor/combomarkdowneditor.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ text-expander .suggestions {
8383
margin-top: 24px;
8484
list-style: none;
8585
background: var(--color-box-body);
86-
border-radius: 5px;
86+
border-radius: var(--border-radius);
8787
border: 1px solid var(--color-secondary);
8888
box-shadow: 0 .5rem 1rem var(--color-shadow);
8989
}
@@ -101,15 +101,15 @@ text-expander .suggestions li + li {
101101
}
102102

103103
text-expander .suggestions li:first-child {
104-
border-radius: 4px 4px 0 0;
104+
border-radius: var(--border-radius) var(--border-radius) 0 0;
105105
}
106106

107107
text-expander .suggestions li:last-child {
108-
border-radius: 0 0 4px 4px;
108+
border-radius: 0 0 var(--border-radius) var(--border-radius);
109109
}
110110

111111
text-expander .suggestions li:only-child {
112-
border-radius: 4px;
112+
border-radius: var(--border-radius);
113113
}
114114

115115
text-expander .suggestions li:hover {

web_src/css/features/codeeditor.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@
4444
position: absolute !important;
4545
resize: none !important;
4646
overflow: hidden !important;
47-
border-radius: 4px !important;
47+
border-radius: var(--border-radius-medium) !important;
4848
}

web_src/css/features/console.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
background: var(--color-console-bg);
55
color: var(--color-console-fg);
66
font-family: var(--fonts-monospace);
7-
border-radius: 5px;
7+
border-radius: var(--border-radius);
88
word-break: break-word;
99
overflow-wrap: break-word;
1010
}

web_src/css/features/dropzone.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
background: none;
44
box-shadow: none;
55
padding: 0;
6-
border-radius: 4px;
6+
border-radius: var(--border-radius-medium);
77
min-height: 0;
88
}
99

web_src/css/features/tribute.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
.tribute-container {
44
box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.25);
5-
border-radius: 0.25rem;
5+
border-radius: var(--border-radius);
66
}
77

88
.tribute-container ul {

web_src/css/form.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ textarea:focus,
221221
}
222222
.g-recaptcha-style iframe,
223223
.h-captcha-style iframe {
224-
border-radius: 5px !important;
224+
border-radius: var(--border-radius) !important;
225225
width: 302px !important;
226226
height: 76px !important;
227227
}

web_src/css/markup/content.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180
appearance: none;
181181
position: relative;
182182
border: 1px solid var(--color-secondary);
183-
border-radius: 2px;
183+
border-radius: var(--border-radius);
184184
background: var(--color-input-background);
185185
height: 14px;
186186
width: 14px;
@@ -433,7 +433,7 @@
433433
font-size: 85%;
434434
white-space: break-spaces;
435435
background-color: var(--color-markup-code-block);
436-
border-radius: 4px;
436+
border-radius: var(--border-radius);
437437
}
438438

439439
.markup code br,
@@ -466,7 +466,7 @@
466466
font-size: 85%;
467467
line-height: 1.45;
468468
background-color: var(--color-markup-code-block);
469-
border-radius: 4px;
469+
border-radius: var(--border-radius);
470470
}
471471

472472
.markup .highlight pre {
@@ -504,7 +504,7 @@
504504
vertical-align: middle;
505505
background-color: var(--color-markup-code-block);
506506
border: 1px solid var(--color-secondary);
507-
border-radius: 3px;
507+
border-radius: var(--border-radius);
508508
box-shadow: inset 0 -1px 0 var(--color-secondary);
509509
}
510510

web_src/css/modules/animations.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
border-width: 4px;
2727
border-style: solid;
2828
border-color: var(--color-secondary) var(--color-secondary) var(--color-secondary-dark-8) var(--color-secondary-dark-8);
29-
border-radius: 100%;
29+
border-radius: var(--border-radius-circle);
3030
}
3131

3232
.is-loading.small-loading-icon::after {

web_src/css/modules/navbar.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
top: -9px;
135135
min-width: 17px;
136136
min-height: 17px;
137-
border-radius: 17px;
137+
border-radius: var(--border-radius-circle);
138138
display: flex;
139139
align-items: center;
140140
justify-content: center;

web_src/css/modules/toast.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
opacity: 0;
55
transition: all .2s ease;
66
z-index: 500;
7-
border-radius: 4px;
7+
border-radius: var(--border-radius);
88
box-shadow: 0 8px 24px var(--color-shadow);
99
display: flex;
1010
max-width: 50vw;
@@ -25,7 +25,7 @@
2525
.toast-close,
2626
.toast-icon {
2727
color: currentcolor;
28-
border-radius: 3px;
28+
border-radius: var(--border-radius);
2929
background: transparent;
3030
border: none;
3131
display: inline-block;

web_src/css/repo.css

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117

118118
.repository .issue-content-right #deadlineForm input {
119119
width: 12.8rem;
120-
border-radius: 4px 0 0 4px;
120+
border-radius: var(--border-radius) 0 0 var(--border-radius);
121121
border-right: 0;
122122
white-space: nowrap;
123123
}
@@ -141,7 +141,7 @@
141141

142142
.repository .filter.menu.labels .label-filter .menu .info code {
143143
border: 1px solid var(--color-secondary);
144-
border-radius: 3px;
144+
border-radius: var(--border-radius);
145145
padding: 1px 2px;
146146
font-size: 11px;
147147
}
@@ -518,7 +518,7 @@
518518
margin-bottom: 10px;
519519
border: 1px solid var(--color-secondary);
520520
background: var(--color-box-body);
521-
border-radius: 3px;
521+
border-radius: var(--border-radius);
522522
}
523523

524524
.repository.file.editor .commit-form-wrapper .commit-form::before,
@@ -551,7 +551,7 @@
551551
font: 12px var(--fonts-monospace);
552552
color: var(--color-text);
553553
background: var(--color-secondary);
554-
border-radius: 3px;
554+
border-radius: var(--border-radius);
555555
margin: 0 2px;
556556
}
557557

@@ -709,7 +709,7 @@
709709
align-items: center !important;
710710
font-size: 14px !important;
711711
padding: 7px 10px !important;
712-
border-radius: 6px !important;
712+
border-radius: var(--border-radius-medium) !important;
713713
}
714714

715715
.issue-state-label .svg {
@@ -835,7 +835,7 @@
835835
width: 34px;
836836
height: 34px;
837837
background-color: var(--color-timeline);
838-
border-radius: 50%;
838+
border-radius: var(--border-radius-circle);
839839
display: flex;
840840
float: left;
841841
margin-left: -33px;
@@ -1049,7 +1049,7 @@
10491049

10501050
.merge-section-info code {
10511051
border: 1px solid var(--color-light-border);
1052-
border-radius: 4px;
1052+
border-radius: var(--border-radius);
10531053
padding: 2px 4px;
10541054
background: var(--color-light);
10551055
}
@@ -2093,7 +2093,7 @@
20932093
width: 34px;
20942094
height: 34px;
20952095
min-height: 0 !important;
2096-
border-radius: 6px;
2096+
border-radius: var(--border-radius);
20972097
display: flex !important;
20982098
align-items: center;
20992099
justify-content: center;
@@ -2753,7 +2753,7 @@ tbody.commit-list {
27532753
#new-dependency-drop-list.ui.selection.dropdown {
27542754
min-width: 0;
27552755
width: 100%;
2756-
border-radius: 4px 0 0 4px;
2756+
border-radius: var(--border-radius) 0 0 var(--border-radius);
27572757
border-right: 0;
27582758
white-space: nowrap;
27592759
}
@@ -2949,7 +2949,7 @@ tbody.commit-list {
29492949
margin: 10px 0;
29502950
background-color: var(--color-markup-code-block);
29512951
border: 1px solid var(--color-secondary);
2952-
border-radius: 3px;
2952+
border-radius: var(--border-radius);
29532953
font-size: 13px;
29542954
line-height: 1.5;
29552955
overflow: auto;

web_src/css/repo/issue-list.css

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
#issue-list .flex-item-body .branches .branch {
4141
background-color: var(--color-secondary-alpha-40);
42-
border-radius: 3px;
42+
border-radius: var(--border-radius);
4343
padding: 0 4px;
4444
}
4545

@@ -55,7 +55,6 @@
5555
width: 80px;
5656
height: 6px;
5757
display: inline-block;
58-
border-radius: 3px;
5958
}
6059

6160
#issue-list .flex-item-body .checklist progress::-webkit-progress-value {
@@ -64,4 +63,4 @@
6463

6564
#issue-list .flex-item-body .checklist progress::-moz-progress-bar {
6665
background-color: var(--color-secondary-dark-4);
67-
}
66+
}

web_src/css/repo/release-tag.css

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,10 @@
7575
width: 10px;
7676
height: 10px;
7777
background-color: var(--color-secondary-dark-3);
78-
z-index: 9;
7978
position: absolute;
80-
display: block;
8179
left: -5.5px;
8280
top: 40px;
83-
border-radius: 100%;
81+
border-radius: var(--border-radius-circle);
8482
border: 2.5px solid var(--color-body);
8583
}
8684

web_src/css/review.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@
273273
border: 1px solid transparent;
274274
padding: 4px 8px;
275275
margin: -8px 0; /* just like other buttons in the diff box header */
276-
border-radius: 0.285rem; /* just like .ui.tiny.button */
276+
border-radius: var(--border-radius);
277277
font-size: 0.857rem; /* just like .ui.tiny.button */
278278
}
279279

web_src/css/user.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107

108108
#readme_profile {
109109
padding: 1em 2em;
110-
border-radius: 0.28571429rem;
110+
border-radius: var(--border-radius);
111111
background: var(--color-card);
112112
border: 1px solid var(--color-secondary);
113113
}

0 commit comments

Comments
 (0)