|
| 1 | +/* |
| 2 | +http://blog.leonardfactory.com/2013/05/05/code-fenced-blocks-pygments-and-line-numbers-with-jekyll/ |
| 3 | +*/ |
| 4 | + |
| 5 | +.highlight pre { |
| 6 | + width: 100%; |
| 7 | + font-size: 13px; |
| 8 | + counter-reset: line-numbering; |
| 9 | + border: solid 1px #d9d9d9; |
| 10 | + border-radius: 0; |
| 11 | + background: #fff; |
| 12 | + padding: 0; |
| 13 | + line-height: 23px; |
| 14 | + margin-bottom: 30px; |
| 15 | + white-space: pre; |
| 16 | + position: relative; |
| 17 | + overflow-x: auto; |
| 18 | + word-break: inherit; |
| 19 | + word-wrap: inherit; |
| 20 | +} |
| 21 | + |
| 22 | +.highlight pre a::before { |
| 23 | + content: counter(line-numbering); |
| 24 | + counter-increment: line-numbering; |
| 25 | + padding-right: 1em; |
| 26 | + width: 0px; |
| 27 | + text-align: right; |
| 28 | + opacity: 0.7; |
| 29 | + display: inline-block; |
| 30 | + color: #aaa; |
| 31 | + background: #eee; |
| 32 | + margin-right: 16px; |
| 33 | + padding: 2px 25px; |
| 34 | + font-size: 13px; |
| 35 | + border-right: 1px solid #dedede; |
| 36 | + -webkit-touch-callout: none; |
| 37 | + -webkit-user-select: none; |
| 38 | + -khtml-user-select: none; |
| 39 | + -moz-user-select: none; |
| 40 | + -ms-user-select: none; |
| 41 | + user-select: none; |
| 42 | +} |
| 43 | + |
| 44 | +.highlight pre a:first-of-type::before { |
| 45 | + padding-top: 10px; |
| 46 | + -webkit-box-shadow: rgba(255, 255, 255, 0.9) 0px 1px 1px inset; |
| 47 | + -moz-box-shadow: rgba(255, 255, 255, 0.9) 0px 1px 1px inset; |
| 48 | + box-shadow: rgba(255, 255, 255, 0.9) 0px 1px 1px inset; |
| 49 | +} |
| 50 | + |
| 51 | +.highlight pre a:last-of-type::before { |
| 52 | + padding-bottom: 10px; |
| 53 | +} |
| 54 | + |
| 55 | +.highlight pre a:only-of-type::before { |
| 56 | + padding: 10px; |
| 57 | +} |
| 58 | + |
| 59 | +// You can even customize style for inline code blocks using custom CSS for the .inline-code class. |
| 60 | + |
| 61 | +code.inline-code { |
| 62 | + padding: 0.2em 0.4em; |
| 63 | + background-color: #fdfdfd; |
| 64 | + @include box-shadow(0 1px rgba(255,255,255,.75), inset 0 1px 3px rgba(0,0,0,.07)); |
| 65 | + color: $light-gray; |
| 66 | + @include border-radius(4px); |
| 67 | + border: solid 1px #dedede; |
| 68 | + //white-space: nowrap; |
| 69 | + //overflow-x: auto; |
| 70 | +} |
| 71 | + |
| 72 | +.highlight { background-color: #ffffcc } |
| 73 | +.highlight .c { color: #586E75 } /* Comment */ |
| 74 | +.highlight .err { color: #93A1A1 } /* Error */ |
| 75 | +.highlight .g { color: #93A1A1 } /* Generic */ |
| 76 | +.highlight .k { color: #859900 } /* Keyword */ |
| 77 | +.highlight .l { color: #93A1A1 } /* Literal */ |
| 78 | +.highlight .n { color: #93A1A1 } /* Name */ |
| 79 | +.highlight .o { color: #859900 } /* Operator */ |
| 80 | +.highlight .x { color: #CB4B16 } /* Other */ |
| 81 | +.highlight .p { color: #93A1A1 } /* Punctuation */ |
| 82 | +.highlight .cm { color: #586E75 } /* Comment.Multiline */ |
| 83 | +.highlight .cp { color: #859900 } /* Comment.Preproc */ |
| 84 | +.highlight .c1 { color: #586E75 } /* Comment.Single */ |
| 85 | +.highlight .cs { color: #859900 } /* Comment.Special */ |
| 86 | +.highlight .gd { color: #2AA198 } /* Generic.Deleted */ |
| 87 | +.highlight .ge { color: #93A1A1; font-style: italic } /* Generic.Emph */ |
| 88 | +.highlight .gr { color: #DC322F } /* Generic.Error */ |
| 89 | +.highlight .gh { color: #CB4B16 } /* Generic.Heading */ |
| 90 | +.highlight .gi { color: #859900 } /* Generic.Inserted */ |
| 91 | +.highlight .go { color: #93A1A1 } /* Generic.Output */ |
| 92 | +.highlight .gp { color: #93A1A1 } /* Generic.Prompt */ |
| 93 | +.highlight .gs { color: #93A1A1; font-weight: bold } /* Generic.Strong */ |
| 94 | +.highlight .gu { color: #CB4B16 } /* Generic.Subheading */ |
| 95 | +.highlight .gt { color: #93A1A1 } /* Generic.Traceback */ |
| 96 | +.highlight .kc { color: #CB4B16 } /* Keyword.Constant */ |
| 97 | +.highlight .kd { color: #268BD2 } /* Keyword.Declaration */ |
| 98 | +.highlight .kn { color: #859900 } /* Keyword.Namespace */ |
| 99 | +.highlight .kp { color: #859900 } /* Keyword.Pseudo */ |
| 100 | +.highlight .kr { color: #268BD2 } /* Keyword.Reserved */ |
| 101 | +.highlight .kt { color: #DC322F } /* Keyword.Type */ |
| 102 | +.highlight .ld { color: #93A1A1 } /* Literal.Date */ |
| 103 | +.highlight .m { color: #2AA198 } /* Literal.Number */ |
| 104 | +.highlight .s { color: #2AA198 } /* Literal.String */ |
| 105 | +.highlight .na { color: #93A1A1 } /* Name.Attribute */ |
| 106 | +.highlight .nb { color: #B58900 } /* Name.Builtin */ |
| 107 | +.highlight .nc { color: #268BD2 } /* Name.Class */ |
| 108 | +.highlight .no { color: #CB4B16 } /* Name.Constant */ |
| 109 | +.highlight .nd { color: #268BD2 } /* Name.Decorator */ |
| 110 | +.highlight .ni { color: #CB4B16 } /* Name.Entity */ |
| 111 | +.highlight .ne { color: #CB4B16 } /* Name.Exception */ |
| 112 | +.highlight .nf { color: #268BD2 } /* Name.Function */ |
| 113 | +.highlight .nl { color: #93A1A1 } /* Name.Label */ |
| 114 | +.highlight .nn { color: #93A1A1 } /* Name.Namespace */ |
| 115 | +.highlight .nx { color: #93A1A1 } /* Name.Other */ |
| 116 | +.highlight .py { color: #93A1A1 } /* Name.Property */ |
| 117 | +.highlight .nt { color: #268BD2 } /* Name.Tag */ |
| 118 | +.highlight .nv { color: #268BD2 } /* Name.Variable */ |
| 119 | +.highlight .ow { color: #859900 } /* Operator.Word */ |
| 120 | +.highlight .w { color: #93A1A1 } /* Text.Whitespace */ |
| 121 | +.highlight .mf { color: #2AA198 } /* Literal.Number.Float */ |
| 122 | +.highlight .mh { color: #2AA198 } /* Literal.Number.Hex */ |
| 123 | +.highlight .mi { color: #2AA198 } /* Literal.Number.Integer */ |
| 124 | +.highlight .mo { color: #2AA198 } /* Literal.Number.Oct */ |
| 125 | +.highlight .sb { color: #586E75 } /* Literal.String.Backtick */ |
| 126 | +.highlight .sc { color: #2AA198 } /* Literal.String.Char */ |
| 127 | +.highlight .sd { color: #93A1A1 } /* Literal.String.Doc */ |
| 128 | +.highlight .s2 { color: #2AA198 } /* Literal.String.Double */ |
| 129 | +.highlight .se { color: #CB4B16 } /* Literal.String.Escape */ |
| 130 | +.highlight .sh { color: #93A1A1 } /* Literal.String.Heredoc */ |
| 131 | +.highlight .si { color: #2AA198 } /* Literal.String.Interpol */ |
| 132 | +.highlight .sx { color: #2AA198 } /* Literal.String.Other */ |
| 133 | +.highlight .sr { color: #DC322F } /* Literal.String.Regex */ |
| 134 | +.highlight .s1 { color: #2AA198 } /* Literal.String.Single */ |
| 135 | +.highlight .ss { color: #2AA198 } /* Literal.String.Symbol */ |
| 136 | +.highlight .bp { color: #268BD2 } /* Name.Builtin.Pseudo */ |
| 137 | +.highlight .vc { color: #268BD2 } /* Name.Variable.Class */ |
| 138 | +.highlight .vg { color: #268BD2 } /* Name.Variable.Global */ |
| 139 | +.highlight .vi { color: #268BD2 } /* Name.Variable.Instance */ |
| 140 | +.highlight .il { color: #2AA198 } /* Literal.Number.Integer.Long */ |
| 141 | + |
0 commit comments