redesign highlightable code and allow line numbers
[blog] / _sass / _code.scss
1 // Code
2 //
3 // Inline and block-level code snippets. Includes tweaks to syntax highlighted
4 // snippets from Pygments/Rouge and Gist embeds.
5
6 code,
7 pre {
8   font-family: Menlo, Monaco, "Courier New", monospace;
9 }
10
11 code {
12   padding: .25em .5em;
13   font-size: 85%;
14   color: #bf616a;
15   background-color: #f9f9f9;
16   border-radius: 3px;
17 }
18
19 pre {
20   margin-top: 0;
21   margin-bottom: 1rem;
22 }
23
24 pre code {
25   padding: 0;
26   font-size: 100%;
27   color: inherit;
28   background-color: transparent;
29 }
30
31 // Pygments via Jekyll
32 .highlight {
33   padding: 1rem;
34   margin-bottom: 1rem;
35   font-size: .8rem;
36   line-height: 1.4;
37   background-color: #f9f9f9;
38   border-radius: .25rem;
39
40   pre {
41     margin-bottom: 0;
42     overflow-x: auto;
43   }
44
45   .lineno {
46     display: inline-block; // Ensures the null space also isn't selectable
47     padding-right: .75rem;
48     padding-left: .25rem;
49     color: #999;
50     // Make sure numbers aren't selectable
51     -webkit-user-select: none;
52        -moz-user-select: none;
53             user-select: none;
54   }
55 }
56
57
58 // Gist via GitHub Pages
59 // .gist .gist-file {
60 //   font-family: Menlo, Monaco, "Courier New", monospace !important;
61 // }
62 // .gist .markdown-body {
63 //   padding: 15px;
64 // }
65 // .gist pre {
66 //   padding: 0;
67 //   background-color: transparent;
68 // }
69 // .gist .gist-file .gist-data {
70 //   font-size: .8rem !important;
71 //   line-height: 1.4;
72 // }
73 // .gist code {
74 //   padding: 0;
75 //   color: inherit;
76 //   background-color: transparent;
77 //   border-radius: 0;
78 // }