debian-mirror-gitlab/app/assets/stylesheets/framework/diffs.scss

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

1183 lines
22 KiB
SCSS
Raw Normal View History

2015-10-24 18:46:33 +05:30
// Common
2014-09-02 18:07:02 +05:30
.diff-file {
2016-06-02 11:05:42 +05:30
margin-bottom: $gl-padding;
2016-11-03 12:29:30 +05:30
2021-01-29 00:20:46 +05:30
&.has-body {
.file-title {
box-shadow: 0 -2px 0 0 var(--white);
}
}
table.code tr:last-of-type td:last-of-type {
@include gl-rounded-bottom-right-base();
}
2017-08-17 22:00:37 +05:30
.file-title,
.file-title-flex-parent {
2016-11-03 12:29:30 +05:30
cursor: pointer;
2021-01-03 14:25:43 +05:30
.dropdown-menu {
cursor: auto;
}
@media (max-width: map-get($grid-breakpoints, sm)-1) {
.file-header-content {
width: 0;
flex: 1;
}
.file-actions {
margin-left: $gl-spacing-scale-2;
}
}
2019-02-15 15:39:39 +05:30
@media (min-width: map-get($grid-breakpoints, md)) {
2020-03-13 15:44:24 +05:30
// The `+11` is to ensure the file header border shows when scrolled -
2019-07-07 11:18:12 +05:30
// the bottom of the compare-versions header and the top of the file header
2022-07-16 23:28:13 +05:30
$mr-file-header-top: calc(#{$header-height} + #{$mr-tabs-height});
2019-03-02 22:35:43 +05:30
2019-02-15 15:39:39 +05:30
position: -webkit-sticky;
position: sticky;
2019-03-02 22:35:43 +05:30
top: $mr-file-header-top;
2019-09-30 21:07:59 +05:30
z-index: 120;
2019-02-15 15:39:39 +05:30
2021-01-03 14:25:43 +05:30
.with-system-header & {
2022-03-02 08:16:31 +05:30
top: calc(#{$mr-file-header-top} + #{$system-header-height});
2021-01-03 14:25:43 +05:30
}
.with-system-header.with-performance-bar & {
2022-03-02 08:16:31 +05:30
top: calc(#{$mr-file-header-top} + #{$system-header-height} + #{$performance-bar-height});
2021-01-03 14:25:43 +05:30
}
2019-02-15 15:39:39 +05:30
&::before {
content: '';
position: absolute;
top: -1px;
left: -11px;
width: 10px;
height: calc(100% + 1px);
2021-02-22 17:27:13 +05:30
background: $body-bg;
2019-02-15 15:39:39 +05:30
pointer-events: none;
}
.with-performance-bar & {
2022-03-02 08:16:31 +05:30
top: calc(#{$mr-file-header-top} + #{$performance-bar-height});
2019-03-02 22:35:43 +05:30
}
&.is-commit {
2022-03-02 08:16:31 +05:30
top: calc(#{$header-height} + #{$commit-stat-summary-height});
2019-03-02 22:35:43 +05:30
.with-performance-bar & {
2022-03-02 08:16:31 +05:30
top: calc(#{$header-height} + #{$commit-stat-summary-height} + #{$performance-bar-height});
2019-03-02 22:35:43 +05:30
}
}
&.is-compare {
2022-03-02 08:16:31 +05:30
top: calc(#{$header-height} + #{$compare-branches-sticky-header-height});
2019-03-02 22:35:43 +05:30
.with-performance-bar & {
2022-03-02 08:16:31 +05:30
top: calc(#{$performance-bar-height} + #{$header-height} + #{$compare-branches-sticky-header-height});
2019-03-02 22:35:43 +05:30
}
2019-02-15 15:39:39 +05:30
}
}
2016-11-03 12:29:30 +05:30
&:hover {
2017-08-17 22:00:37 +05:30
background-color: $gray-normal;
2016-11-03 12:29:30 +05:30
}
2018-11-08 19:23:39 +05:30
svg {
vertical-align: middle;
2018-11-18 11:00:15 +05:30
top: -1px;
2016-11-03 12:29:30 +05:30
}
}
2019-12-04 20:38:33 +05:30
@media (min-width: map-get($grid-breakpoints, md)) {
&.conflict .file-title,
&.conflict .file-title-flex-parent {
top: $header-height;
}
.with-performance-bar &.conflict .file-title,
.with-performance-bar &.conflict .file-title-flex-parent {
2022-03-02 08:16:31 +05:30
top: calc(#{$header-height} + #{$performance-bar-height});
2019-12-04 20:38:33 +05:30
}
.with-system-header &.conflict .file-title,
.with-system-header &.conflict .file-title-flex-parent {
2022-03-02 08:16:31 +05:30
top: calc(#{$header-height} + #{$system-header-height});
2019-12-04 20:38:33 +05:30
}
.with-system-header.with-performance-bar &.conflict .file-title,
.with-system-header.with-performance-bar &.conflict .file-title-flex-parent {
2022-03-02 08:16:31 +05:30
top: calc(#{$header-height} + #{$performance-bar-height} + #{$system-header-height});
2019-12-04 20:38:33 +05:30
}
}
2014-09-02 18:07:02 +05:30
.diff-content {
2020-04-22 19:07:51 +05:30
background: $white;
2017-08-17 22:00:37 +05:30
color: $gl-text-color;
2015-09-25 12:07:36 +05:30
2014-09-02 18:07:02 +05:30
.unfold {
cursor: pointer;
}
.file-mode-changed {
padding: 10px;
2020-11-24 15:15:51 +05:30
color: $gray-500;
2014-09-02 18:07:02 +05:30
}
2015-09-11 14:41:01 +05:30
.suppressed-container {
padding: ($padding-base-vertical + 5px) $padding-base-horizontal;
text-align: center;
// "Changes suppressed. Click to show." link
.show-suppressed-diff {
font-size: 110%;
2018-03-17 18:26:18 +05:30
font-weight: $gl-font-weight-bold;
2015-09-11 14:41:01 +05:30
}
}
2018-05-09 12:01:36 +05:30
.diff-loading-error-block {
padding: $gl-padding * 2 $gl-padding;
text-align: center;
}
2014-09-02 18:07:02 +05:30
}
2016-11-03 12:29:30 +05:30
2014-09-02 18:07:02 +05:30
.image {
2018-11-20 20:47:30 +05:30
background: $gray-darker;
2014-09-02 18:07:02 +05:30
text-align: center;
padding: 30px;
2016-11-03 12:29:30 +05:30
2015-10-24 18:46:33 +05:30
.wrap {
2014-09-02 18:07:02 +05:30
display: inline-block;
}
.frame {
display: inline-block;
2020-04-22 19:07:51 +05:30
background-color: $white;
2014-09-02 18:07:02 +05:30
line-height: 0;
2016-11-03 12:29:30 +05:30
2015-10-24 18:46:33 +05:30
img {
2020-04-22 19:07:51 +05:30
border: 1px solid $white;
2019-07-07 11:18:12 +05:30
background-image: linear-gradient(45deg,
$border-color 25%,
transparent 25%,
transparent 75%,
$border-color 75%,
$border-color 100%),
linear-gradient(45deg,
$border-color 25%,
transparent 25%,
transparent 75%,
$border-color 75%,
$border-color 100%);
2016-09-13 17:45:13 +05:30
background-size: 10px 10px;
background-position: 0 0, 5px 5px;
2014-09-02 18:07:02 +05:30
max-width: 100%;
}
2016-11-03 12:29:30 +05:30
2014-09-02 18:07:02 +05:30
&.deleted {
border: 1px solid $deleted;
}
&.added {
border: 1px solid $added;
}
}
2016-11-03 12:29:30 +05:30
2015-10-24 18:46:33 +05:30
.image-info {
2014-09-02 18:07:02 +05:30
font-size: 12px;
2016-06-02 11:05:42 +05:30
margin: 5px 0 0;
2017-08-17 22:00:37 +05:30
color: $diff-image-info-color;
2014-09-02 18:07:02 +05:30
}
2015-10-24 18:46:33 +05:30
.view.swipe {
2014-09-02 18:07:02 +05:30
position: relative;
2015-10-24 18:46:33 +05:30
.swipe-frame {
2014-09-02 18:07:02 +05:30
display: block;
margin: auto;
position: relative;
}
2016-11-03 12:29:30 +05:30
2015-10-24 18:46:33 +05:30
.swipe-wrap {
2014-09-02 18:07:02 +05:30
overflow: hidden;
2020-11-24 15:15:51 +05:30
border-right: 1px solid $gray-300;
2014-09-02 18:07:02 +05:30
position: absolute;
display: block;
top: 13px;
right: 7px;
2019-07-07 11:18:12 +05:30
&.left-oriented {
/* only for commit view (different swipe viewer) */
border-right: 0;
2020-11-24 15:15:51 +05:30
border-left: 1px solid $gray-300;
2019-07-07 11:18:12 +05:30
}
}
.frame {
top: 0;
right: 0;
&.old-diff {
/* only for commit / compare view */
position: absolute;
}
&.deleted {
margin: 0;
display: block;
top: 13px;
right: 7px;
}
2014-09-02 18:07:02 +05:30
}
2017-08-17 22:00:37 +05:30
2015-10-24 18:46:33 +05:30
.swipe-bar {
2014-09-02 18:07:02 +05:30
display: block;
height: 100%;
width: 15px;
z-index: 100;
position: absolute;
cursor: pointer;
2016-11-03 12:29:30 +05:30
2015-10-24 18:46:33 +05:30
&:hover {
.top-handle {
2014-09-02 18:07:02 +05:30
background-position: -15px 3px;
}
2016-11-03 12:29:30 +05:30
2015-10-24 18:46:33 +05:30
.bottom-handle {
2014-09-02 18:07:02 +05:30
background-position: -15px -11px;
}
2015-10-24 18:46:33 +05:30
}
2016-11-03 12:29:30 +05:30
2015-10-24 18:46:33 +05:30
.top-handle {
2014-09-02 18:07:02 +05:30
display: block;
height: 14px;
width: 15px;
position: absolute;
2016-06-02 11:05:42 +05:30
top: 0;
2014-09-02 18:07:02 +05:30
background: image-url('swipemode_sprites.gif') 0 3px no-repeat;
}
2016-11-03 12:29:30 +05:30
2015-10-24 18:46:33 +05:30
.bottom-handle {
2014-09-02 18:07:02 +05:30
display: block;
height: 14px;
width: 15px;
position: absolute;
2016-06-02 11:05:42 +05:30
bottom: 0;
2014-09-02 18:07:02 +05:30
background: image-url('swipemode_sprites.gif') 0 -11px no-repeat;
}
}
2015-10-24 18:46:33 +05:30
}
2021-01-03 14:25:43 +05:30
2015-10-24 18:46:33 +05:30
//.view.swipe
.view.onion-skin {
.onion-skin-frame {
2014-09-02 18:07:02 +05:30
display: block;
margin: auto;
position: relative;
}
2016-11-03 12:29:30 +05:30
2017-08-17 22:00:37 +05:30
.frame.added,
.frame.deleted {
2014-09-02 18:07:02 +05:30
position: absolute;
display: block;
2016-06-02 11:05:42 +05:30
top: 0;
left: 0;
2014-09-02 18:07:02 +05:30
}
2016-11-03 12:29:30 +05:30
2015-10-24 18:46:33 +05:30
.controls {
2014-09-02 18:07:02 +05:30
display: block;
height: 14px;
width: 300px;
z-index: 100;
position: absolute;
2016-06-02 11:05:42 +05:30
bottom: 0;
2014-09-02 18:07:02 +05:30
left: 50%;
margin-left: -150px;
2015-10-24 18:46:33 +05:30
.drag-track {
2014-09-02 18:07:02 +05:30
display: block;
position: absolute;
2018-03-17 18:26:18 +05:30
top: 0;
2014-09-02 18:07:02 +05:30
left: 12px;
height: 10px;
width: 276px;
background: image-url('onion_skin_sprites.gif') -4px -20px repeat-x;
}
.dragger {
display: block;
position: absolute;
2016-06-02 11:05:42 +05:30
left: 0;
top: 0;
2014-09-02 18:07:02 +05:30
height: 14px;
width: 14px;
2016-06-02 11:05:42 +05:30
background: image-url('onion_skin_sprites.gif') 0 -34px repeat-x;
2014-09-02 18:07:02 +05:30
cursor: pointer;
}
.transparent {
display: block;
position: absolute;
top: 2px;
2016-06-02 11:05:42 +05:30
right: 0;
2014-09-02 18:07:02 +05:30
height: 10px;
width: 10px;
2016-06-02 11:05:42 +05:30
background: image-url('onion_skin_sprites.gif') -2px 0 no-repeat;
2014-09-02 18:07:02 +05:30
}
.opaque {
display: block;
position: absolute;
top: 2px;
2016-06-02 11:05:42 +05:30
left: 0;
2014-09-02 18:07:02 +05:30
height: 10px;
width: 10px;
background: image-url('onion_skin_sprites.gif') -2px -10px no-repeat;
}
}
2015-10-24 18:46:33 +05:30
}
2021-01-03 14:25:43 +05:30
2015-10-24 18:46:33 +05:30
//.view.onion-skin
2014-09-02 18:07:02 +05:30
}
2016-11-03 12:29:30 +05:30
2015-10-24 18:46:33 +05:30
.view-modes {
2014-09-02 18:07:02 +05:30
padding: 10px;
text-align: center;
2017-08-17 22:00:37 +05:30
background: $gray-darker;
2014-09-02 18:07:02 +05:30
2017-08-17 22:00:37 +05:30
ul,
li {
2014-09-02 18:07:02 +05:30
list-style: none;
margin: 0;
padding: 0;
display: inline-block;
}
2015-10-24 18:46:33 +05:30
li {
2017-08-17 22:00:37 +05:30
color: $diff-view-modes-color;
border-left: 1px solid $diff-view-modes-border;
2014-09-02 18:07:02 +05:30
padding: 0 12px 0 16px;
cursor: pointer;
2016-11-03 12:29:30 +05:30
2015-10-24 18:46:33 +05:30
&:first-child {
2018-03-17 18:26:18 +05:30
border-left: 0;
2014-09-02 18:07:02 +05:30
}
2016-11-03 12:29:30 +05:30
2015-10-24 18:46:33 +05:30
&:hover {
2014-09-02 18:07:02 +05:30
text-decoration: underline;
}
2016-11-03 12:29:30 +05:30
2015-10-24 18:46:33 +05:30
&.active {
2017-09-10 17:25:29 +05:30
cursor: default;
color: $gl-text-color;
2015-10-24 18:46:33 +05:30
&:hover {
2014-09-02 18:07:02 +05:30
text-decoration: none;
}
}
2016-11-03 12:29:30 +05:30
2015-10-24 18:46:33 +05:30
&.disabled {
2014-09-02 18:07:02 +05:30
display: none;
}
}
}
2018-03-17 18:26:18 +05:30
2018-11-08 19:23:39 +05:30
.diff-file-container {
.frame.deleted {
2018-12-13 13:39:08 +05:30
border: 1px solid $deleted;
2018-11-08 19:23:39 +05:30
background-color: inherit;
}
.frame.added {
2018-12-13 13:39:08 +05:30
border: 1px solid $added;
2018-11-08 19:23:39 +05:30
background-color: inherit;
}
.swipe.view,
.onion-skin.view {
.swipe-wrap {
top: 0;
2018-12-13 13:39:08 +05:30
left: 0;
2018-11-08 19:23:39 +05:30
}
.frame.deleted {
top: 0;
right: 0;
}
.swipe-bar {
top: 0;
.top-handle {
top: -14px;
left: -7px;
}
.bottom-handle {
bottom: -14px;
left: -7px;
}
}
.file-container {
display: inline-block;
.file-content {
padding: 0;
img {
max-width: none;
}
}
}
}
.onion-skin.view .controls {
bottom: -25px;
}
}
2018-12-13 13:39:08 +05:30
.discussion-notes .discussion-notes {
margin-left: 0;
border-left: 0;
}
2014-09-02 18:07:02 +05:30
}
2021-01-29 00:20:46 +05:30
.diff-table.code,
2019-07-07 11:18:12 +05:30
table.code {
width: 100%;
font-family: $monospace-font;
border: 0;
border-collapse: separate;
margin: 0;
padding: 0;
table-layout: fixed;
border-radius: 0 0 $border-radius-default $border-radius-default;
2021-01-29 00:20:46 +05:30
.diff-tr.line_holder .diff-td,
2019-07-07 11:18:12 +05:30
tr.line_holder td {
line-height: $code-line-height;
font-size: $code-font-size;
vertical-align: top;
span {
2020-06-23 00:09:42 +05:30
white-space: break-spaces;
2019-07-07 11:18:12 +05:30
&.context-cell {
display: inline-block;
width: 100%;
height: 100%;
}
&.line {
word-wrap: break-word;
}
}
&.diff-line-num {
user-select: none;
margin: 0;
padding: 0 10px 0 5px;
2019-07-31 22:56:46 +05:30
border-right-width: 1px;
border-right-style: solid;
2019-07-07 11:18:12 +05:30
text-align: right;
width: 50px;
position: relative;
2020-01-01 13:55:28 +05:30
white-space: nowrap;
2019-07-07 11:18:12 +05:30
a {
transition: none;
float: left;
width: 100%;
font-weight: $gl-font-weight-normal;
&[disabled] {
cursor: default;
&:hover,
&:active {
text-decoration: none;
}
}
}
&:not(.js-unfold-bottom) a::before {
content: attr(data-linenumber);
}
}
&.line_content {
display: block;
margin: 0;
padding: 0 1.5em;
border: 0;
position: relative;
white-space: pre-wrap;
&.parallel {
display: table-cell;
width: 46%;
}
&.old {
&::before {
content: '-';
position: absolute;
left: 0.5em;
}
2020-04-08 14:13:33 +05:30
&.with-coverage::before {
left: 0;
}
2019-07-07 11:18:12 +05:30
}
&.new {
&::before {
content: '+';
position: absolute;
left: 0.5em;
}
2020-04-08 14:13:33 +05:30
&.with-coverage::before {
left: 0;
}
2019-07-07 11:18:12 +05:30
}
2022-07-23 23:45:48 +05:30
img {
max-width: 100%;
}
2019-07-07 11:18:12 +05:30
}
}
2019-09-04 21:01:54 +05:30
.line_holder:last-of-type {
2021-01-29 00:20:46 +05:30
.diff-td:first-child,
2019-09-04 21:01:54 +05:30
td:first-child {
border-bottom-left-radius: $border-radius-default;
}
}
2019-07-07 11:18:12 +05:30
&.left-side-selected {
2021-01-29 00:20:46 +05:30
.diff-td.line_content.parallel.right-side,
2019-07-07 11:18:12 +05:30
td.line_content.parallel.right-side {
user-select: none;
}
}
&.right-side-selected {
2021-01-29 00:20:46 +05:30
.diff-td.line_content.parallel.left-side,
2019-07-07 11:18:12 +05:30
td.line_content.parallel.left-side {
user-select: none;
}
}
}
2021-01-29 00:20:46 +05:30
// Merge request diff grid layout
.diff-grid {
2021-03-08 18:12:59 +05:30
.diff-td {
// By default min-width is auto with 1fr which causes some overflow problems
// https://gitlab.com/gitlab-org/gitlab/-/issues/296222
min-width: 0;
}
2021-01-29 00:20:46 +05:30
.diff-grid-row {
display: grid;
grid-template-columns: 1fr 1fr;
2022-07-16 23:28:13 +05:30
&.diff-grid-row-full {
grid-template-columns: 1fr;
}
2021-01-29 00:20:46 +05:30
}
.diff-grid-left,
.diff-grid-right {
display: grid;
2021-09-04 01:27:46 +05:30
// Zero width column is a placeholder for the EE inline code quality diff
// see ee/.../diffs.scss for more details
grid-template-columns: 50px 8px 0 1fr;
2021-01-29 00:20:46 +05:30
}
2022-07-16 23:28:13 +05:30
.diff-grid-2-col {
grid-template-columns: 100px 1fr !important;
&.parallel {
grid-template-columns: 50px 1fr !important;
}
}
2021-01-29 00:20:46 +05:30
.diff-grid-comments {
display: grid;
grid-template-columns: 1fr 1fr;
}
.diff-grid-drafts {
display: grid;
grid-template-columns: 1fr 1fr;
}
2021-11-11 11:23:49 +05:30
&.inline-diff-view {
2021-01-29 00:20:46 +05:30
.diff-grid-comments {
display: grid;
grid-template-columns: 1fr;
}
.diff-grid-drafts {
display: grid;
grid-template-columns: 1fr;
}
.diff-grid-row {
grid-template-columns: 1fr;
}
.diff-grid-left,
.diff-grid-right {
2021-09-04 01:27:46 +05:30
// Zero width column is a placeholder for the EE inline code quality diff
// see ee/../diffs.scss for more details
grid-template-columns: 50px 50px 8px 0 1fr;
2021-01-29 00:20:46 +05:30
}
}
}
// Merge request diff grid layout overrides
.diff-table.code .diff-tr.line_holder .diff-td.line_content.parallel {
width: unset;
}
2019-03-02 22:35:43 +05:30
.diff-stats {
align-items: center;
2020-03-13 15:44:24 +05:30
padding: 0 1rem;
2019-03-02 22:35:43 +05:30
2021-09-04 01:27:46 +05:30
.diff-stats-contents {
display: contents;
}
2019-03-02 22:35:43 +05:30
.diff-stats-group {
2019-07-07 11:18:12 +05:30
padding: 0 0.25rem;
2019-03-02 22:35:43 +05:30
}
svg.diff-stats-icon {
vertical-align: text-bottom;
}
&.is-compare-versions-header {
.diff-stats-group {
2020-03-13 15:44:24 +05:30
padding: 0 0.25rem;
2019-03-02 22:35:43 +05:30
}
}
}
2014-09-02 18:07:02 +05:30
.file-content .diff-file {
margin: 0;
2018-03-17 18:26:18 +05:30
border: 0;
2015-04-26 12:48:37 +05:30
}
.diff-wrap-lines .line_content {
white-space: pre-wrap;
}
2015-09-25 12:07:36 +05:30
.inline-parallel-buttons {
float: right;
}
2015-10-24 18:46:33 +05:30
2018-11-08 19:23:39 +05:30
.merge-request-details .file-content.image_file img {
max-height: 50vh;
}
2015-10-24 18:46:33 +05:30
// Mobile
@media (max-width: 480px) {
.diff-title {
margin: 0;
.file-mode {
display: none;
}
}
.diff-controls {
position: static;
text-align: center;
}
}
// Bigger screens
@media (min-width: 481px) {
.diff-title {
margin-right: 200px;
.file-mode {
margin-left: 10px;
}
}
.diff-controls {
float: right;
position: absolute;
top: 5px;
right: 15px;
}
}
2016-01-29 22:53:50 +05:30
2016-06-02 11:05:42 +05:30
.files {
2021-06-08 01:23:25 +05:30
.diff-file:not(.is-virtual-scrolling):last-child {
2016-06-02 11:05:42 +05:30
margin-bottom: 0;
}
}
2017-08-17 22:00:37 +05:30
.diff-comment-avatar-holders {
position: absolute;
2019-09-04 21:01:54 +05:30
margin-left: -$gl-padding;
2017-09-10 17:25:29 +05:30
z-index: 100;
2019-09-04 21:01:54 +05:30
@include code-icon-size();
2017-08-17 22:00:37 +05:30
&:hover {
.diff-comment-avatar,
.diff-comments-more-count {
@for $i from 1 through 4 {
$x-pos: 14px;
&:nth-child(#{$i}) {
@if $i == 4 {
$x-pos: 14.5px;
}
transform: translateX((($i * $x-pos) - $x-pos));
&:hover {
2017-09-10 17:25:29 +05:30
transform: translateX((($i * $x-pos) - $x-pos));
2017-08-17 22:00:37 +05:30
}
}
}
}
.diff-comments-more-count {
padding-left: 2px;
padding-right: 2px;
width: auto;
}
}
}
.diff-comment-avatar,
.diff-comments-more-count {
position: absolute;
left: 0;
margin-right: 0;
2020-04-22 19:07:51 +05:30
border-color: $white;
2017-08-17 22:00:37 +05:30
cursor: pointer;
2018-11-08 19:23:39 +05:30
transition: all 0.1s ease-out;
2019-09-04 21:01:54 +05:30
@include code-icon-size();
2017-08-17 22:00:37 +05:30
@for $i from 1 through 4 {
&:nth-child(#{$i}) {
z-index: (4 - $i);
}
}
2019-09-04 21:01:54 +05:30
.avatar {
@include code-icon-size();
}
2017-08-17 22:00:37 +05:30
}
.diff-comments-more-count {
padding-left: 0;
padding-right: 0;
overflow: hidden;
2019-09-04 21:01:54 +05:30
@include code-icon-size();
2017-08-17 22:00:37 +05:30
}
.diff-comments-more-count,
.diff-notes-collapse {
2019-09-04 21:01:54 +05:30
@include avatar-counter(50%);
2017-08-17 22:00:37 +05:30
}
.diff-notes-collapse {
2019-09-04 21:01:54 +05:30
border: 0;
2018-03-17 18:26:18 +05:30
border-radius: 50%;
2017-08-17 22:00:37 +05:30
padding: 0;
2018-11-08 19:23:39 +05:30
transition: transform 0.1s ease-out;
2017-09-10 17:25:29 +05:30
z-index: 100;
2019-09-04 21:01:54 +05:30
display: flex;
justify-content: center;
align-items: center;
@include code-icon-size();
2017-08-17 22:00:37 +05:30
2018-03-17 18:26:18 +05:30
.collapse-icon {
height: 50%;
width: 100%;
}
2017-08-17 22:00:37 +05:30
svg {
2018-03-17 18:26:18 +05:30
vertical-align: middle;
2017-08-17 22:00:37 +05:30
}
2018-03-17 18:26:18 +05:30
.collapse-icon,
2017-08-17 22:00:37 +05:30
path {
2020-04-22 19:07:51 +05:30
fill: $white;
2017-08-17 22:00:37 +05:30
}
&:focus {
outline: 0;
}
}
2017-09-10 17:25:29 +05:30
.diff-files-changed {
2022-04-04 11:22:00 +05:30
background-color: $body-bg;
2017-09-10 17:25:29 +05:30
.inline-parallel-buttons {
2021-11-11 11:23:49 +05:30
@include gl-relative;
2017-09-10 17:25:29 +05:30
z-index: 1;
}
2018-11-08 19:23:39 +05:30
@include media-breakpoint-up(sm) {
2021-11-11 11:23:49 +05:30
@include gl-sticky;
2022-07-23 23:45:48 +05:30
top: $header-height;
2019-02-15 15:39:39 +05:30
z-index: 200;
2017-09-10 17:25:29 +05:30
2019-02-15 15:39:39 +05:30
.with-performance-bar & {
2022-07-23 23:45:48 +05:30
top: calc(#{$header-height} + #{$performance-bar-height});
2017-09-10 17:25:29 +05:30
}
&.is-stuck {
2021-11-11 11:23:49 +05:30
@include gl-py-0;
2018-11-08 19:23:39 +05:30
border-top: 1px solid $white-dark;
2017-09-10 17:25:29 +05:30
border-bottom: 1px solid $white-dark;
.diff-stats-additions-deletions-expanded,
.inline-parallel-buttons {
2021-11-11 11:23:49 +05:30
@include gl-display-none;
2018-11-08 19:23:39 +05:30
}
}
}
@include media-breakpoint-up(lg) {
&.is-stuck {
.diff-stats-additions-deletions-collapsed {
2021-11-11 11:23:49 +05:30
@include gl-display-block;
2017-09-10 17:25:29 +05:30
}
2018-03-17 18:26:18 +05:30
}
}
}
2017-09-10 17:25:29 +05:30
2021-11-11 11:23:49 +05:30
2017-09-10 17:25:29 +05:30
.diff-file-changes {
2018-03-17 18:26:18 +05:30
max-width: 560px;
width: 100%;
2017-09-10 17:25:29 +05:30
z-index: 150;
2018-11-08 19:23:39 +05:30
min-height: $dropdown-min-height;
max-height: $dropdown-max-height;
overflow-y: auto;
margin-bottom: 0;
2017-09-10 17:25:29 +05:30
2018-11-08 19:23:39 +05:30
@include media-breakpoint-up(sm) {
2017-09-10 17:25:29 +05:30
left: $gl-padding;
}
2018-11-20 20:47:30 +05:30
.dropdown-input .dropdown-input-search {
pointer-events: all;
}
2018-03-17 18:26:18 +05:30
.diff-changed-file {
display: flex;
2017-09-10 17:25:29 +05:30
padding-top: 8px;
padding-bottom: 8px;
2018-03-17 18:26:18 +05:30
min-width: 0;
}
.diff-file-changed-icon {
margin-top: 2px;
}
.diff-changed-file-content {
display: flex;
flex-direction: column;
min-width: 0;
}
.diff-changed-file-name,
.diff-changed-blank-file-name {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.diff-changed-blank-file-name {
color: $gl-text-color-tertiary;
font-style: italic;
}
.diff-changed-file-path {
color: $gl-text-color-tertiary;
}
.diff-changed-stats {
margin-left: auto;
white-space: nowrap;
2017-09-10 17:25:29 +05:30
}
}
.diff-file-changes-path {
2018-03-17 18:26:18 +05:30
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.note-container {
background-color: $gray-light;
border-top: 1px solid $white-normal;
// double jagged line divider
.discussion-notes + .discussion-notes::before,
2018-12-13 13:39:08 +05:30
.diff-file-discussions + .discussion-form::before {
2018-03-17 18:26:18 +05:30
content: '';
position: relative;
display: block;
width: 100%;
height: 10px;
2020-04-22 19:07:51 +05:30
background-color: $white;
2019-07-07 11:18:12 +05:30
background-image: linear-gradient(45deg,
transparent,
transparent 73%,
$diff-jagged-border-gradient-color 75%,
2020-04-22 19:07:51 +05:30
$white 80%),
2019-07-07 11:18:12 +05:30
linear-gradient(225deg,
transparent,
transparent 73%,
$diff-jagged-border-gradient-color 75%,
2020-04-22 19:07:51 +05:30
$white 80%),
2019-07-07 11:18:12 +05:30
linear-gradient(135deg,
transparent,
transparent 73%,
$diff-jagged-border-gradient-color 75%,
2020-04-22 19:07:51 +05:30
$white 80%),
2019-07-07 11:18:12 +05:30
linear-gradient(-45deg,
transparent,
transparent 73%,
$diff-jagged-border-gradient-color 75%,
2020-04-22 19:07:51 +05:30
$white 80%);
2018-11-08 19:23:39 +05:30
background-position: 5px 5px, 0 5px, 0 5px, 5px 5px;
2018-03-17 18:26:18 +05:30
background-size: 10px 10px;
background-repeat: repeat;
}
2018-12-13 13:39:08 +05:30
.diff-file-discussions + .discussion-form {
padding: $gl-padding;
&::before {
width: auto;
margin-left: -$gl-padding;
margin-right: -$gl-padding;
margin-bottom: $gl-padding;
}
}
2018-03-17 18:26:18 +05:30
.notes {
position: relative;
}
.diff-notes-collapse {
position: absolute;
left: -12px;
}
}
.diff-file .note-container > .new-note,
2018-12-13 13:39:08 +05:30
.note-container .discussion-notes.diff-discussions {
2018-03-17 18:26:18 +05:30
margin-left: 100px;
border-left: 1px solid $white-normal;
}
.notes.active {
.diff-file .note-container > .new-note,
.note-container .discussion-notes {
// Override our margin and border (set for diff tab)
// when user is on the discussion tab for MR
margin-left: inherit;
border-left: inherit;
}
}
2021-11-18 22:05:49 +05:30
// Notes tweaks for the Changes tab ONLY
.diff-tr {
.timeline-discussion-body {
clear: left;
.note-body {
margin-top: 0 !important;
}
}
.timeline-entry img.avatar {
margin-top: -2px;
margin-right: $gl-padding-8;
}
// tiny adjustment to vertical align with the note header text
.discussion-collapsible .timeline-icon {
padding-top: 2px;
}
}
2020-07-28 23:09:34 +05:30
.files:not([data-can-create-note]) .frame {
2018-03-17 18:26:18 +05:30
cursor: auto;
}
2018-12-13 13:39:08 +05:30
.frame.click-to-comment,
.btn-transparent.image-diff-overlay-add-comment {
2018-03-17 18:26:18 +05:30
position: relative;
2021-01-03 14:25:43 +05:30
cursor: image-url('illustrations/image_comment_light_cursor.svg') $image-comment-cursor-left-offset $image-comment-cursor-top-offset,
2018-11-08 19:23:39 +05:30
auto;
2018-03-17 18:26:18 +05:30
// Retina cursor
2019-07-07 11:18:12 +05:30
cursor: image-set(image-url('illustrations/image_comment_light_cursor.svg') 1x,
2021-01-03 14:25:43 +05:30
image-url('illustrations/image_comment_light_cursor@2x.svg') 2x) $image-comment-cursor-left-offset $image-comment-cursor-top-offset,
2018-11-08 19:23:39 +05:30
auto;
2018-03-17 18:26:18 +05:30
.comment-indicator {
position: absolute;
padding: 0;
width: (2px * $image-comment-cursor-left-offset);
height: (2px * $image-comment-cursor-top-offset);
2019-02-15 15:39:39 +05:30
color: $blue-400;
2018-03-17 18:26:18 +05:30
// center the indicator to match the top left click region
margin-top: (-1px * $image-comment-cursor-top-offset) + 2;
margin-left: (-1px * $image-comment-cursor-left-offset) + 1;
svg {
width: 100%;
height: 100%;
}
&:focus {
outline: none;
}
}
}
2020-10-24 23:57:45 +05:30
.frame .image-comment-badge,
.frame .comment-indicator {
2018-03-17 18:26:18 +05:30
// Center align badges on the frame
transform: translate(-50%, -50%);
}
.image-comment-badge {
position: absolute;
width: 24px;
height: 24px;
padding: 0;
background: none;
border: 0;
> svg {
width: 100%;
height: 100%;
}
}
2018-12-13 13:39:08 +05:30
.image-diff-avatar-link,
.user-avatar-link {
2018-03-17 18:26:18 +05:30
position: relative;
2018-11-08 19:23:39 +05:30
.badge.badge-pill,
2018-03-17 18:26:18 +05:30
.image-comment-badge {
top: 25px;
right: 8px;
}
}
.discussion-notes {
min-height: 35px;
&:first-child {
// First child does not have the jagged borders
min-height: 25px;
}
2022-04-04 11:22:00 +05:30
.diff-notes-expand {
display: none;
}
2018-03-17 18:26:18 +05:30
&.collapsed {
2020-04-22 19:07:51 +05:30
background-color: $white;
2018-03-17 18:26:18 +05:30
2022-04-04 11:22:00 +05:30
.diff-notes-expand {
display: initial;
}
2018-03-17 18:26:18 +05:30
.diff-notes-collapse,
.note,
2018-11-08 19:23:39 +05:30
.discussion-reply-holder {
2018-03-17 18:26:18 +05:30
display: none;
}
}
}
.discussion-body .image .frame {
position: relative;
2017-09-10 17:25:29 +05:30
}
2018-12-05 23:21:45 +05:30
2019-09-30 21:07:59 +05:30
.discussion-collapsible {
2021-11-18 22:05:49 +05:30
margin: 0 $gl-padding $gl-padding;
2019-09-30 21:07:59 +05:30
.notes {
border-radius: $border-radius-default;
}
}
.parallel {
.discussion-collapsible {
margin: $gl-padding;
margin-top: 0;
}
}
2018-12-13 13:39:08 +05:30
.image-diff-overlay,
.image-diff-overlay-add-comment {
top: 0;
left: 0;
&:active,
&:focus {
outline: 0;
}
}
2019-09-04 21:01:54 +05:30
.diff-suggest-popover {
&.popover {
width: 250px;
min-width: 250px;
z-index: 210;
}
.popover-header {
display: none;
}
}
2021-01-03 14:25:43 +05:30
2022-04-04 11:22:00 +05:30
@media (max-width: map-get($grid-breakpoints, lg)-1) {
2021-01-03 14:25:43 +05:30
.diffs .files {
@include fixed-width-container;
flex-direction: column;
}
.discussion-collapsible {
margin: $gl-padding;
margin-top: 0;
}
}
2021-09-30 23:02:18 +05:30
// Note: Prevents tall files from appearing above sticky tabs
.diffs .vue-recycle-scroller__item-view > div:not(.active) {
position: absolute;
bottom: 100vh;
}
2022-07-16 23:28:13 +05:30
.diff-line-expand-button {
&:hover,
&:focus {
@include gl-bg-gray-200;
}
}