aboutsummaryrefslogtreecommitdiff
path: root/.themes/classic/sass/partials/_syntax.scss
blob: a68ae1bbea8515efda64bd00d1bb9e153734c212 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
.highlight, html .gist .gist-file .gist-syntax .gist-highlight {
  .line-numbers {
    text-align: right;
    font-size: 13px;
    line-height: 1.45em;
    background: $base02 $noise-bg !important;
    border-right: 1px solid darken($base03, 2) !important;
    @include box-shadow(lighten($base02, 2) -1px 0 inset);
    text-shadow: darken($base02, 10) 0 -1px;
    span { color: $base01 !important; }
    padding: .8em !important;
    @include border-radius(0);
  }
}
html .gist .gist-file {
  margin-bottom: 1.5em;
  position: relative;
  border: none;
  padding-top: image-height("code_bg.png") !important;
  .gist-syntax {
    border-bottom: 1px solid darken($base03, 2) !important;
    .gist-highlight{
      background: $base03 !important;
      pre {
        @extend .pre-code;
      }
    }
  }
  .gist-meta {
   padding: .6em 0.8em;
   border: 1px solid lighten($base02, 2) !important;
   color: $base01;
   font-size: .7em !important;
   background: $base02 $noise-bg;
   @extend .sans;
   line-height: 1.5em;
    a {
      color: mix($base1, $base01) !important;
      @include hover-link;
      &:hover { color: $base1 !important; }
    }
    a[href*='#file'] {
      position: absolute; top: 0; left:0; right:-10px;
      color: #474747 !important;
      @extend .code-title;
      &:hover { color: $link-color !important; }
    }
    a[href*=raw]{
      @extend .download-source;
      top: .4em;
    }
  }
}
pre {
  background: $pre-bg $noise-bg;
  @include border-radius(.4em);
  @extend .mono;
  border: 1px solid $pre-border;
  line-height: 1.45em;
  font-size: 13px;
  margin-bottom: 1.5em;
  padding: .8em 1em;
  color: $pre-color;
  overflow: auto;
}
h3.filename {
  @extend .code-title;
  + pre { @include border-top-radius(0px); }
}

p code {
  @extend .mono;
  display: inline-block;
  white-space: no-wrap;
  background: #fff;
  font-size: .8em;
  line-height: 1.5em;
  color: #555;
  border: 1px solid #ddd;
  @include border-radius(.4em);
  padding: 0 .3em;
  margin: -1px 0;
}

.pre-code {
  @include selection(adjust-color($base03, $lightness: 23%, $saturation: -65%), $text-shadow: $base03 0 1px);
  overflow: scroll;
  overflow-y: hidden;
  display: block;
  padding: .8em !important;
  overflow-x: auto;
  line-height: 1.45em;
  background: $base03 $noise-bg !important;
  color: $base1 !important;
  span { color: $base1 !important; }
  span { font-style: normal !important; font-weight: normal !important; }

  .c      { color: $base01 !important; font-style: italic !important; }                     /* Comment */
  .cm     { color: $base01 !important; font-style: italic !important; }                     /* Comment.Multiline */
  .cp     { color: $base01 !important; font-style: italic !important;  }                     /* Comment.Preproc */
  .c1     { color: $base01 !important; font-style: italic !important; }                     /* Comment.Single */
  .cs     { color: $base01 !important; font-weight: bold !important; font-style: italic !important; }   /* Comment.Special */
  .err    { color: $red !important; background: none !important; }                                            /* Error */
  .k      { color: $orange !important; }                       /* Keyword */
  .o      { color: $base1 !important; font-weight: bold !important; }                       /* Operator */
  .p      { color: $base1 !important; }                                             /* Operator */
  .ow     { color: $cyan !important; font-weight: bold !important; }                       /* Operator.Word */
  .gd     { color: $base1 !important; background-color: mix($red, $base03, 25%) !important; display: inline-block; }               /* Generic.Deleted */
  .gd .x  { color: $base1 !important; background-color: mix($red, $base03, 35%) !important; display: inline-block; }               /* Generic.Deleted.Specific */
  .ge     { color: $base1 !important; font-style: italic !important; }                      /* Generic.Emph */
  //.gr     { color: #aa0000 }                                          /* Generic.Error */
  .gh     { color: $base01 !important; }                                          /* Generic.Heading */
  .gi     { color: $base1 !important; background-color: mix($green, $base03, 20%) !important; display: inline-block; }               /* Generic.Inserted */
  .gi .x  { color: $base1 !important; background-color: mix($green, $base03, 40%) !important; display: inline-block; }               /* Generic.Inserted.Specific */
  //.go     { color: #888888 }                                          /* Generic.Output */
  //.gp     { color: #555555 }                                          /* Generic.Prompt */
  .gs     { color: $base1 !important; font-weight: bold !important; }                                       /* Generic.Strong */
  .gu     { color: $violet !important; }                                          /* Generic.Subheading */
  //.gt     { color: #aa0000 }                                          /* Generic.Traceback */
  .kc     { color: $green !important; font-weight: bold !important; }                       /* Keyword.Constant */
  .kd     { color: $blue !important; }                       /* Keyword.Declaration */
  .kp     { color: $orange !important; font-weight: bold !important; }                       /* Keyword.Pseudo */
  .kr     { color: $magenta !important; font-weight: bold !important; }                       /* Keyword.Reserved */
  .kt     { color: $cyan !important; }                       /* Keyword.Type */
  .n      { color: $blue !important; }
  .na     { color: $blue !important; }                                          /* Name.Attribute */
  .nb     { color: $green !important; }                                          /* Name.Builtin */
  //.nc     { color: #445588; font-weight: bold }                       /* Name.Class */
  .no     { color: $yellow !important; }                                          /* Name.Constant */
  //.ni     { color: #800080 }                                          /* Name.Entity */
  .ne     { color: $blue !important; font-weight: bold !important; }                       /* Name.Exception */
  .nf     { color: $blue !important; font-weight: bold !important; }                       /* Name.Function */
  .nn     { color: $yellow !important; }                                          /* Name.Namespace */
  .nt     { color: $blue !important; font-weight: bold !important; }                                          /* Name.Tag */
  .nx     { color: $yellow !Important; }
  //.bp     { color: #999999 }                                          /* Name.Builtin.Pseudo */
  //.vc     { color: #008080 }                                          /* Name.Variable.Class */
  .vg     { color: $blue !important; }                                          /* Name.Variable.Global */
  .vi     { color: $blue !important; }                                          /* Name.Variable.Instance */
  .nv     { color: $blue !important; }                                          /* Name.Variable */
  //.w      { color: #bbbbbb }                                          /* Text.Whitespace */
  .mf     { color: $cyan !important; }                                          /* Literal.Number.Float */
  .m      { color: $cyan !important; }                                          /* Literal.Number */
  .mh     { color: $cyan !important; }                                          /* Literal.Number.Hex */
  .mi     { color: $cyan !important; }                                          /* Literal.Number.Integer */
  //.mo     { color: #009999 }                                          /* Literal.Number.Oct */
  .s      { color: $cyan !important; }                                             /* Literal.String */
  //.sb     { color: #d14 }                                             /* Literal.String.Backtick */
  //.sc     { color: #d14 }                                             /* Literal.String.Char */
  .sd     { color: $cyan !important; }                                             /* Literal.String.Doc */
  .s2     { color: $cyan !important; }                                             /* Literal.String.Double */
  .se     { color: $red !important; }                                             /* Literal.String.Escape */
  //.sh     { color: #d14 }                                             /* Literal.String.Heredoc */
  .si     { color: $blue !important; }                                             /* Literal.String.Interpol */
  //.sx     { color: #d14 }                                             /* Literal.String.Other */
  .sr     { color: $cyan !important; }                                          /* Literal.String.Regex */
  .s1     { color: $cyan !important; }                                             /* Literal.String.Single */
  //.ss     { color: #990073 }                                          /* Literal.String.Symbol */
  //.il     { color: #009999 }                                          /* Literal.Number.Integer.Long */
  div { .gd, .gd .x, .gi, .gi .x { display: block; }}
}

.highlight, .gist-highlight {
  pre { background: none; @include border-radius(none); border: none; padding: 0; margin-bottom: 0; }
  margin-bottom: 1.5em;
  background: $base03;
  overflow-y: hidden;
  overflow-x: auto;
}
pre, .highlight, .gist-highlight {
  &::-webkit-scrollbar {  height: .5em; background: rgba(#fff, .15); }
  &::-webkit-scrollbar-thumb:horizontal { background: rgba(#fff, .2);  -webkit-border-radius: 4px; border-radius: 4px }
}

.highlight code { @extend .pre-code; background: #000;}
figure {
  margin-bottom: 1.5em;
  figcaption {
    position: relative;
    @extend .code-title;
    a { @extend .download-source; }
  }
  .highlight { margin-bottom: 0; border-bottom: 1px solid darken($base03, 2) !important; }
}
.code-title {
  text-align: center;
  font-size: 13px;
  line-height: 2em;
  text-shadow: #cbcccc 0 1px 0;
  color: #474747;
  font-weight: normal;
  margin-bottom: 0;
  @include border-top-radius(5px);
  font-family: "Helvetica Neue", Arial, "Lucida Grande", "Lucida Sans Unicode", Lucida, sans-serif;
  background: #aaaaaa image-url("code_bg.png") top repeat-x;
  border: 1px solid #565656;
  border-top-color: #cbcbcb;
  border-left-color: #a5a5a5;
  border-right-color: #a5a5a5;
  border-bottom: 0;
}

.download-source {
  position: absolute; right: .8em;
  @include hover-link;
  color: #666 !important;
  z-index: 1;
  font-size: 13px;
  text-shadow: #cbcccc 0 1px 0;
  padding-left: 3em;
}