Skip to content

Commit

Permalink
Unify border-radius behavior (#26770)
Browse files Browse the repository at this point in the history
## 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]>
  • Loading branch information
delvh and silverwind authored Aug 28, 2023
1 parent ac2f8c9 commit dca2f93
Show file tree
Hide file tree
Showing 17 changed files with 41 additions and 42 deletions.
14 changes: 8 additions & 6 deletions web_src/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
--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>');
--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>');
/* non-color variables */
--border-radius: 0.28571429rem;
--border-radius: 4px;
--border-radius-medium: 6px;
--border-radius-circle: 100%;
--opacity-disabled: 0.55;
--height-loading: 16rem;
--tab-size: 4;
Expand Down Expand Up @@ -309,7 +311,7 @@ details summary > * {

progress {
background: var(--color-secondary-dark-1);
border-radius: 6px;
border-radius: var(--border-radius);
border: none;
overflow: hidden;
}
Expand Down Expand Up @@ -339,7 +341,7 @@ progress::-moz-progress-bar {
::-webkit-scrollbar-thumb {
box-shadow: inset 0 0 0 6px var(--color-primary);
border: 2px solid transparent;
border-radius: 5px !important;
border-radius: var(--border-radius);
}

::-webkit-scrollbar-thumb:window-inactive {
Expand Down Expand Up @@ -454,7 +456,7 @@ a.label,

.issue-title code {
padding: 2px 4px;
border-radius: 6px;
border-radius: var(--border-radius-medium);
background-color: var(--color-markup-code-block);
}

Expand Down Expand Up @@ -1510,7 +1512,7 @@ img.ui.avatar,
margin-left: 0.4em;
height: 0.67em;
width: 0.67em;
border-radius: 0.15em;
border-radius: var(--border-radius);
}

.attention-icon {
Expand Down Expand Up @@ -2013,7 +2015,7 @@ a.ui.basic.label:hover {

.color-icon {
display: inline-block;
border-radius: 100%;
border-radius: var(--border-radius-circle);
height: 14px;
width: 14px;
}
Expand Down
2 changes: 1 addition & 1 deletion web_src/css/dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@

.feeds code {
padding: 2px 4px;
border-radius: 3px;
border-radius: var(--border-radius);
background-color: var(--color-markup-code-block);
word-break: break-all;
}
8 changes: 4 additions & 4 deletions web_src/css/editor/combomarkdowneditor.css
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ text-expander .suggestions {
margin-top: 24px;
list-style: none;
background: var(--color-box-body);
border-radius: 5px;
border-radius: var(--border-radius);
border: 1px solid var(--color-secondary);
box-shadow: 0 .5rem 1rem var(--color-shadow);
}
Expand All @@ -101,15 +101,15 @@ text-expander .suggestions li + li {
}

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

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

text-expander .suggestions li:only-child {
border-radius: 4px;
border-radius: var(--border-radius);
}

text-expander .suggestions li:hover {
Expand Down
2 changes: 1 addition & 1 deletion web_src/css/features/codeeditor.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@
position: absolute !important;
resize: none !important;
overflow: hidden !important;
border-radius: 4px !important;
border-radius: var(--border-radius-medium) !important;
}
2 changes: 1 addition & 1 deletion web_src/css/features/console.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
background: var(--color-console-bg);
color: var(--color-console-fg);
font-family: var(--fonts-monospace);
border-radius: 5px;
border-radius: var(--border-radius);
word-break: break-word;
overflow-wrap: break-word;
}
Expand Down
2 changes: 1 addition & 1 deletion web_src/css/features/dropzone.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
background: none;
box-shadow: none;
padding: 0;
border-radius: 4px;
border-radius: var(--border-radius-medium);
min-height: 0;
}

Expand Down
2 changes: 1 addition & 1 deletion web_src/css/features/tribute.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

.tribute-container {
box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.25);
border-radius: 0.25rem;
border-radius: var(--border-radius);
}

.tribute-container ul {
Expand Down
2 changes: 1 addition & 1 deletion web_src/css/form.css
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ textarea:focus,
}
.g-recaptcha-style iframe,
.h-captcha-style iframe {
border-radius: 5px !important;
border-radius: var(--border-radius) !important;
width: 302px !important;
height: 76px !important;
}
Expand Down
8 changes: 4 additions & 4 deletions web_src/css/markup/content.css
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
appearance: none;
position: relative;
border: 1px solid var(--color-secondary);
border-radius: 2px;
border-radius: var(--border-radius);
background: var(--color-input-background);
height: 14px;
width: 14px;
Expand Down Expand Up @@ -433,7 +433,7 @@
font-size: 85%;
white-space: break-spaces;
background-color: var(--color-markup-code-block);
border-radius: 4px;
border-radius: var(--border-radius);
}

.markup code br,
Expand Down Expand Up @@ -466,7 +466,7 @@
font-size: 85%;
line-height: 1.45;
background-color: var(--color-markup-code-block);
border-radius: 4px;
border-radius: var(--border-radius);
}

.markup .highlight pre {
Expand Down Expand Up @@ -504,7 +504,7 @@
vertical-align: middle;
background-color: var(--color-markup-code-block);
border: 1px solid var(--color-secondary);
border-radius: 3px;
border-radius: var(--border-radius);
box-shadow: inset 0 -1px 0 var(--color-secondary);
}

Expand Down
2 changes: 1 addition & 1 deletion web_src/css/modules/animations.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
border-width: 4px;
border-style: solid;
border-color: var(--color-secondary) var(--color-secondary) var(--color-secondary-dark-8) var(--color-secondary-dark-8);
border-radius: 100%;
border-radius: var(--border-radius-circle);
}

.is-loading.small-loading-icon::after {
Expand Down
2 changes: 1 addition & 1 deletion web_src/css/modules/navbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
top: -9px;
min-width: 17px;
min-height: 17px;
border-radius: 17px;
border-radius: var(--border-radius-circle);
display: flex;
align-items: center;
justify-content: center;
Expand Down
4 changes: 2 additions & 2 deletions web_src/css/modules/toast.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
opacity: 0;
transition: all .2s ease;
z-index: 500;
border-radius: 4px;
border-radius: var(--border-radius);
box-shadow: 0 8px 24px var(--color-shadow);
display: flex;
max-width: 50vw;
Expand All @@ -25,7 +25,7 @@
.toast-close,
.toast-icon {
color: currentcolor;
border-radius: 3px;
border-radius: var(--border-radius);
background: transparent;
border: none;
display: inline-block;
Expand Down
20 changes: 10 additions & 10 deletions web_src/css/repo.css
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@

.repository .issue-content-right #deadlineForm input {
width: 12.8rem;
border-radius: 4px 0 0 4px;
border-radius: var(--border-radius) 0 0 var(--border-radius);
border-right: 0;
white-space: nowrap;
}
Expand All @@ -141,7 +141,7 @@

.repository .filter.menu.labels .label-filter .menu .info code {
border: 1px solid var(--color-secondary);
border-radius: 3px;
border-radius: var(--border-radius);
padding: 1px 2px;
font-size: 11px;
}
Expand Down Expand Up @@ -518,7 +518,7 @@
margin-bottom: 10px;
border: 1px solid var(--color-secondary);
background: var(--color-box-body);
border-radius: 3px;
border-radius: var(--border-radius);
}

.repository.file.editor .commit-form-wrapper .commit-form::before,
Expand Down Expand Up @@ -551,7 +551,7 @@
font: 12px var(--fonts-monospace);
color: var(--color-text);
background: var(--color-secondary);
border-radius: 3px;
border-radius: var(--border-radius);
margin: 0 2px;
}

Expand Down Expand Up @@ -709,7 +709,7 @@
align-items: center !important;
font-size: 14px !important;
padding: 7px 10px !important;
border-radius: 6px !important;
border-radius: var(--border-radius-medium) !important;
}

.issue-state-label .svg {
Expand Down Expand Up @@ -835,7 +835,7 @@
width: 34px;
height: 34px;
background-color: var(--color-timeline);
border-radius: 50%;
border-radius: var(--border-radius-circle);
display: flex;
float: left;
margin-left: -33px;
Expand Down Expand Up @@ -1049,7 +1049,7 @@

.merge-section-info code {
border: 1px solid var(--color-light-border);
border-radius: 4px;
border-radius: var(--border-radius);
padding: 2px 4px;
background: var(--color-light);
}
Expand Down Expand Up @@ -2093,7 +2093,7 @@
width: 34px;
height: 34px;
min-height: 0 !important;
border-radius: 6px;
border-radius: var(--border-radius);
display: flex !important;
align-items: center;
justify-content: center;
Expand Down Expand Up @@ -2753,7 +2753,7 @@ tbody.commit-list {
#new-dependency-drop-list.ui.selection.dropdown {
min-width: 0;
width: 100%;
border-radius: 4px 0 0 4px;
border-radius: var(--border-radius) 0 0 var(--border-radius);
border-right: 0;
white-space: nowrap;
}
Expand Down Expand Up @@ -2949,7 +2949,7 @@ tbody.commit-list {
margin: 10px 0;
background-color: var(--color-markup-code-block);
border: 1px solid var(--color-secondary);
border-radius: 3px;
border-radius: var(--border-radius);
font-size: 13px;
line-height: 1.5;
overflow: auto;
Expand Down
5 changes: 2 additions & 3 deletions web_src/css/repo/issue-list.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

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

Expand All @@ -55,7 +55,6 @@
width: 80px;
height: 6px;
display: inline-block;
border-radius: 3px;
}

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

#issue-list .flex-item-body .checklist progress::-moz-progress-bar {
background-color: var(--color-secondary-dark-4);
}
}
4 changes: 1 addition & 3 deletions web_src/css/repo/release-tag.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,10 @@
width: 10px;
height: 10px;
background-color: var(--color-secondary-dark-3);
z-index: 9;
position: absolute;
display: block;
left: -5.5px;
top: 40px;
border-radius: 100%;
border-radius: var(--border-radius-circle);
border: 2.5px solid var(--color-body);
}

Expand Down
2 changes: 1 addition & 1 deletion web_src/css/review.css
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@
border: 1px solid transparent;
padding: 4px 8px;
margin: -8px 0; /* just like other buttons in the diff box header */
border-radius: 0.285rem; /* just like .ui.tiny.button */
border-radius: var(--border-radius);
font-size: 0.857rem; /* just like .ui.tiny.button */
}

Expand Down
2 changes: 1 addition & 1 deletion web_src/css/user.css
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@

#readme_profile {
padding: 1em 2em;
border-radius: 0.28571429rem;
border-radius: var(--border-radius);
background: var(--color-card);
border: 1px solid var(--color-secondary);
}
Expand Down

0 comments on commit dca2f93

Please sign in to comment.