Changeset - 1cd6e633bab8
[Not reviewed]
default
0 2 0
domruf - 8 years ago 2017-10-26 00:50:22
dominikruf@gmail.com
less: simplify positioning of the +/- symbols on diff lines

As before, we place the +/- symbols in the pre:before so they default to the
same font and styling as the line content.

Instead of giving the pre a wide left margin and put the :before out there
using negative positing and visible overflow, just give the :before a fixed
width on all lines.

This change has been modified by Mads Kiilerich.
2 files changed with 4 insertions and 30 deletions:
0 comments (0 inline, 0 general)
kallithea/public/css/style.css
Show inline comments
 
@@ -1608,78 +1608,65 @@ table.code-difftable .lineno.old {
 
table.code-difftable .lineno a {
 
  color: #aaa !important;
 
  font: 11px Lucida Console, Consolas, Monaco, Inconsolata, Liberation Mono, monospace !important;
 
  padding-left: 6px;
 
  padding-right: 6px;
 
  display: block;
 
}
 
table.code-difftable .line:hover .lineno a {
 
  color: #333 !important;
 
}
 
table.code-difftable .lineno-inline {
 
  background: none repeat scroll 0 0 #FFF !important;
 
  padding-left: 2px;
 
  padding-right: 2px;
 
  text-align: right;
 
  width: 30px;
 
  -moz-user-select: none;
 
  -webkit-user-select: none;
 
}
 
/** CODE **/
 
table.code-difftable .code {
 
  display: block;
 
}
 
table.code-difftable .code pre {
 
  margin: 0 0 0 12px !important;
 
  padding: 0;
 
  min-height: 17px;
 
  line-height: 17px;
 
  white-space: pre-wrap;
 
  word-break: break-all;
 
}
 
/* leading +/- on changed lines */
 
table.code-difftable .del .code pre:before {
 
  content: "-";
 
  color: #800;
 
  float: left;
 
  left: -1em;
 
  position: relative;
 
  width: 0;
 
}
 
table.code-difftable .add .code pre:before {
 
  content: "+";
 
  color: #080;
 
  float: left;
 
  left: -1em;
 
  position: relative;
 
  width: 0;
 
}
 
table.code-difftable .unmod .code pre:before {
 
table.code-difftable .code pre:before {
 
  content: " ";
 
  float: left;
 
  left: -1em;
 
  position: relative;
 
  width: 0;
 
  margin: 0 2px;
 
}
 
/* comment bubble */
 
.add-bubble {
 
  position: relative;
 
  display: none;
 
  float: left;
 
  width: 0px;
 
  height: 0px;
 
  left: -8px;
 
  box-sizing: border-box;
 
}
 
/* comment bubble, only visible when in a commentable diff */
 
.commentable-diff tr.line.add:hover td .add-bubble,
 
.commentable-diff tr.line.del:hover td .add-bubble,
 
.commentable-diff tr.line.unmod:hover td .add-bubble {
 
  display: block;
 
  z-index: 1;
 
}
 
.add-bubble div {
 
  background: #577632;
 
  width: 16px;
 
  height: 16px;
 
  cursor: pointer;
 
  padding: 0 2px 2px 0.5px;
kallithea/public/less/kallithea-diff.less
Show inline comments
 
@@ -139,79 +139,66 @@ table.code-difftable .lineno.old {
 
table.code-difftable .lineno a {
 
  color: #aaa !important;
 
  font: 11px Lucida Console, Consolas, Monaco, Inconsolata, Liberation Mono, monospace !important;
 
  padding-left: 6px;
 
  padding-right: 6px;
 
  display: block;
 
}
 
table.code-difftable .line:hover .lineno a {
 
  color: #333 !important;
 
}
 
table.code-difftable .lineno-inline {
 
  background: none repeat scroll 0 0 #FFF !important;
 
  padding-left: 2px;
 
  padding-right: 2px;
 
  text-align: right;
 
  width: 30px;
 
  -moz-user-select: none;
 
  -webkit-user-select: none;
 
}
 
/** CODE **/
 
table.code-difftable .code {
 
  display: block;
 
}
 
table.code-difftable .code pre {
 
  margin: 0 0 0 12px !important;
 
  padding: 0;
 
  min-height: 17px;
 
  line-height: 17px;
 
  white-space: pre-wrap;
 
  word-break: break-all;
 
}
 

	
 
/* leading +/- on changed lines */
 
table.code-difftable .del .code pre:before {
 
  content: "-";
 
  color: #800;
 
  float: left;
 
  left: -1em;
 
  position: relative;
 
  width: 0;
 
}
 
table.code-difftable .add .code pre:before {
 
  content: "+";
 
  color: #080;
 
  float: left;
 
  left: -1em;
 
  position: relative;
 
  width: 0;
 
}
 
table.code-difftable .unmod .code pre:before {
 
table.code-difftable .code pre:before {
 
  content: " ";
 
  float: left;
 
  left: -1em;
 
  position: relative;
 
  width: 0;
 
  margin: 0 2px;
 
}
 

	
 
/* comment bubble */
 
.add-bubble {
 
  position: relative;
 
  display: none;
 
  float: left;
 
  width: 0px;
 
  height: 0px;
 
  left: -8px;
 
  box-sizing: border-box;
 
}
 
/* comment bubble, only visible when in a commentable diff */
 
.commentable-diff tr.line.add:hover td .add-bubble,
 
.commentable-diff tr.line.del:hover td .add-bubble,
 
.commentable-diff tr.line.unmod:hover td .add-bubble {
 
  display: block;
 
  z-index: 1;
 
}
 
.add-bubble div {
 
  background: #577632;
 
  width: 16px;
 
  height: 16px;
 
  cursor: pointer;
0 comments (0 inline, 0 general)