OSDN Git Service

Diff with better colors and some spacing on the corners
authorGabriel Mazetto <brodock@gmail.com>
Sun, 21 Apr 2013 08:20:56 +0000 (05:20 -0300)
committerGabriel Mazetto <brodock@gmail.com>
Sun, 21 Apr 2013 08:20:56 +0000 (05:20 -0300)
app/assets/stylesheets/sections/commits.scss
app/assets/stylesheets/sections/notes.scss
app/views/commits/_text_file.html.haml

index 51a307e..812587a 100644 (file)
         }
       }
     }
+    .line_holder {
+      &.old .old_line,
+      &.old .new_line {
+        background: #FCC;
+        border-color: #E7BABA;
+      }
+      &.new .old_line,
+      &.new .new_line {
+        background: #CFC;
+        border-color: #B9ECB9;
+      }
+    }
     .line_content {
       display: block;
       white-space: pre;
       height: 18px;
       margin: 0px;
-      padding: 0px;
+      padding: 0px 0.5em;
       border: none;
       &.new {
         background: #CFD;
index a8628fc..a86384d 100644 (file)
@@ -213,7 +213,17 @@ ul.notes {
 .reply-btn {
   @extend .btn-primary;
 }
-.file .content tr.line_holder:hover > td { background: $hover !important; }
+.file .content tr.line_holder:hover {
+  &> td.line_content {
+    background: $hover !important;
+    border-color: darken($hover, 10%) !important;
+  }
+  &> td.new_line,
+  &> td.old_line {
+    background: darken($hover, 4%) !important;
+    border-color: darken($hover, 10%) !important;
+  }
+}
 .file .content tr.line_holder:hover > td .line_note_link {
   opacity: 1.0;
   filter: alpha(opacity=100);
index 760fd07..8f737e4 100644 (file)
@@ -4,7 +4,7 @@
 
 %table.text-file{class: "#{'hide' if too_big}"}
   - each_diff_line(diff, index) do |line, type, line_code, line_new, line_old|
-    %tr.line_holder{ id: line_code }
+    %tr.line_holder{ id: line_code, class: "#{type}" }
       - if type == "match"
         %td.old_line= "..."
         %td.new_line= "..."