Permalink
Browse files

Added scroll support for code examples. Most helpful for mobile devises.

  • Loading branch information...
1 parent 9b0fcf3 commit 873024c6252883453e791390d31a2eb7237793fa Dave Laird committed Apr 20, 2013
Showing with 6 additions and 1 deletion.
  1. +2 −1 lib/highlighter.rb
  2. +4 −0 source/stylesheets/highlight.css.scss
View
@@ -13,11 +13,12 @@ module Helpers
def _highlight(string, language, class_name=nil)
result = %Q{<div class="highlight #{language} #{class_name}">}
result += '<div class="ribbon"></div>'
+ result += '<div class="scroller">'
code = CodeRay.scan(string, language)
result += code.div css: :class,
line_numbers: :table,
line_number_anchors: false
-
+ result += '</div>'
result += %Q{</div>}
result
end
@@ -18,6 +18,10 @@ $green: #007700;
margin: 2em 0;
@include box-shadow(0 1px #ffffff, inset -1px 1px 4px rgba(0, 0, 0, 0.1));
+ .scroller {
+ overflow: auto;
+ }
+
table {
margin: 0 0;
}

0 comments on commit 873024c

Please sign in to comment.