debian-mirror-gitlab/app/assets/stylesheets/pages/diff.scss

634 lines
11 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
2017-08-17 22:00:37 +05:30
.file-title,
.file-title-flex-parent {
2016-11-03 12:29:30 +05:30
cursor: pointer;
2017-08-17 22:00:37 +05:30
a:hover {
text-decoration: none;
}
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
}
.diff-toggle-caret {
padding-right: 6px;
}
}
2014-09-02 18:07:02 +05:30
.diff-content {
2017-08-17 22:00:37 +05:30
background: $white-light;
color: $gl-text-color;
2016-06-02 11:05:42 +05:30
border-radius: 0 0 3px 3px;
2015-09-25 12:07:36 +05:30
2014-09-02 18:07:02 +05:30
.unfold {
cursor: pointer;
}
.file-mode-changed {
padding: 10px;
2017-08-17 22:00:37 +05:30
color: $file-mode-changed;
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%;
font-weight: bold;
}
}
2014-09-02 18:07:02 +05:30
table {
width: 100%;
font-family: $monospace_font;
border: none;
2016-04-02 18:10:28 +05:30
border-collapse: separate;
2016-06-02 11:05:42 +05:30
margin: 0;
padding: 0;
2016-09-29 09:46:39 +05:30
table-layout: fixed;
.diff-line-num {
width: 50px;
2017-08-17 22:00:37 +05:30
a {
transition: none;
}
2016-09-29 09:46:39 +05:30
}
2016-06-02 11:05:42 +05:30
2015-09-25 12:07:36 +05:30
.line_holder td {
2015-04-26 12:48:37 +05:30
line-height: $code_line_height;
font-size: $code_font_size;
2016-06-02 11:05:42 +05:30
&.noteable_line {
position: relative;
}
span {
white-space: pre-wrap;
}
2017-08-17 22:00:37 +05:30
.line {
word-wrap: break-word;
}
2014-09-02 18:07:02 +05:30
}
}
2015-10-24 18:46:33 +05:30
tr.line_holder.parallel {
td.line_content.parallel {
2016-06-02 11:05:42 +05:30
width: 46%;
}
.add-diff-note {
2017-08-17 22:00:37 +05:30
margin-left: -55px;
2014-09-02 18:07:02 +05:30
}
}
2017-08-17 22:00:37 +05:30
.old_line,
.new_line {
2017-09-10 17:25:29 +05:30
@include user-select(none);
2016-06-02 11:05:42 +05:30
margin: 0;
2014-09-02 18:07:02 +05:30
border: none;
2016-06-02 11:05:42 +05:30
padding: 0 5px;
2016-02-05 20:25:01 +05:30
border-right: 1px solid;
2014-09-02 18:07:02 +05:30
text-align: right;
min-width: 35px;
max-width: 50px;
width: 35px;
2016-11-03 12:29:30 +05:30
2014-09-02 18:07:02 +05:30
a {
float: left;
width: 35px;
font-weight: normal;
2016-11-03 12:29:30 +05:30
2017-08-17 22:00:37 +05:30
&[disabled] {
cursor: default;
&:hover,
&:active {
text-decoration: none;
}
2014-09-02 18:07:02 +05:30
}
}
}
2016-11-03 12:29:30 +05:30
2014-09-02 18:07:02 +05:30
.line_content {
display: block;
2016-06-02 11:05:42 +05:30
margin: 0;
2017-08-17 22:00:37 +05:30
padding: 0 1.5em;
2014-09-02 18:07:02 +05:30
border: none;
2017-08-17 22:00:37 +05:30
position: relative;
2016-06-02 11:05:42 +05:30
2014-09-02 18:07:02 +05:30
&.parallel {
display: table-cell;
2016-06-02 11:05:42 +05:30
span {
word-break: break-all;
}
2014-09-02 18:07:02 +05:30
}
2017-08-17 22:00:37 +05:30
&.old {
&::before {
content: '-';
position: absolute;
left: 0.5em;
}
}
&.new {
&::before {
content: '+';
position: absolute;
left: 0.5em;
}
}
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 {
2017-09-10 17:25:29 +05:30
background: $file-image-bg;
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;
2017-08-17 22:00:37 +05:30
background-color: $white-light;
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 {
2017-08-17 22:00:37 +05:30
border: 1px solid $white-light;
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;
2017-08-17 22:00:37 +05:30
border-left: 1px solid $diff-swipe-border;
2014-09-02 18:07:02 +05:30
position: absolute;
display: block;
top: 13px;
right: 7px;
}
2017-08-17 22:00:37 +05:30
2015-10-24 18:46:33 +05:30
.frame {
2014-09-02 18:07:02 +05:30
top: 0;
right: 0;
position: absolute;
2017-08-17 22:00:37 +05:30
2015-10-24 18:46:33 +05:30
&.deleted {
2014-09-02 18:07:02 +05:30
margin: 0;
display: block;
top: 13px;
right: 7px;
}
}
2016-11-03 12:29:30 +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
}
//.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;
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
}
//.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 {
2014-09-02 18:07:02 +05:30
border-left: none;
}
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;
}
}
}
}
.file-content .diff-file {
margin: 0;
border: none;
}
2015-04-26 12:48:37 +05:30
.diff-file .line_content {
2016-06-02 11:05:42 +05:30
white-space: pre-wrap;
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
2016-06-02 11:05:42 +05:30
.files-changed {
border-bottom: none;
}
2017-08-17 22:00:37 +05:30
.diff-stats-summary-toggler {
padding: 0;
background-color: transparent;
border: 0;
color: $gl-link-color;
2017-09-10 17:25:29 +05:30
font-weight: 600;
2017-08-17 22:00:37 +05:30
&:hover,
&:focus {
outline: none;
color: $gl-link-hover-color;
}
}
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-02-05 20:25:01 +05:30
@mixin diff_background($background, $idiff, $border) {
background: $background;
2016-01-29 22:53:50 +05:30
2016-02-05 20:25:01 +05:30
&.line_content span.idiff {
background: $idiff;
2016-01-29 22:53:50 +05:30
}
2016-02-05 20:25:01 +05:30
&.diff-line-num {
border-color: $border;
2016-01-29 22:53:50 +05:30
}
}
2016-06-02 11:05:42 +05:30
.files {
margin-top: -1px;
.diff-file:last-child {
margin-bottom: 0;
}
}
.file-holder {
.diff-line-num:not(.js-unfold-bottom) {
a {
2017-08-17 22:00:37 +05:30
&::before {
2016-06-02 11:05:42 +05:30
content: attr(data-linenumber);
}
}
}
}
2017-08-17 22:00:37 +05:30
.diff-comment-avatar-holders {
position: absolute;
height: 19px;
width: 19px;
margin-left: -15px;
2017-09-10 17:25:29 +05:30
z-index: 100;
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;
width: 19px;
height: 19px;
margin-right: 0;
border-color: $white-light;
cursor: pointer;
transition: all .1s ease-out;
@for $i from 1 through 4 {
&:nth-child(#{$i}) {
z-index: (4 - $i);
}
}
}
.diff-comments-more-count {
width: 19px;
min-width: 19px;
padding-left: 0;
padding-right: 0;
overflow: hidden;
}
.diff-comments-more-count,
.diff-notes-collapse {
@extend .avatar-counter;
}
.diff-notes-collapse {
position: relative;
width: 19px;
height: 19px;
padding: 0;
transition: transform .1s ease-out;
2017-09-10 17:25:29 +05:30
z-index: 100;
2017-08-17 22:00:37 +05:30
svg {
position: absolute;
left: 50%;
top: 50%;
margin-left: -5.5px;
margin-top: -5.5px;
}
path {
fill: $white-light;
}
&:focus {
outline: 0;
}
}
2017-09-10 17:25:29 +05:30
.diff-files-changed {
.inline-parallel-buttons {
position: relative;
z-index: 1;
}
.commit-stat-summary {
@include new-style-dropdown;
@media (min-width: $screen-sm-min) {
margin-left: -$gl-padding;
padding-left: $gl-padding;
background-color: $white-light;
}
}
@media (min-width: $screen-sm-min) {
position: -webkit-sticky;
position: sticky;
top: 34px;
background-color: $white-light;
z-index: 190;
&.diff-files-changed-merge-request {
top: 84px;
}
+ .files,
+ .alert {
margin-top: 1px;
}
&:not(.is-stuck) .diff-stats-additions-deletions-collapsed {
display: none;
}
&.is-stuck {
padding-top: 0;
padding-bottom: 0;
border-bottom: 1px solid $white-dark;
transform: translateY(16px);
.diff-stats-additions-deletions-expanded,
.inline-parallel-buttons {
display: none;
}
+ .files,
+ .alert {
margin-top: 30px;
}
}
}
}
.diff-file-changes {
width: 450px;
z-index: 150;
@media (min-width: $screen-sm-min) {
left: $gl-padding;
}
a {
padding-top: 8px;
padding-bottom: 8px;
}
}
.diff-file-changes-path {
@include str-truncated(78%);
}