-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle.css
184 lines (158 loc) · 4.35 KB
/
style.css
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
/* This file contains an example stylesheet for the
* HTML output of the c2html tool.
*
* The HTML output generated by c2html has the form:
*
* <div class="c2h-code">
* <div class="c2h-code-inner">
* <table>
* <tr>
* <td> .. line number .. </td>
* <td> .. line code .. </td>
* </tr>
* .. other lines ..
* </table>
* </div>
* </div>
*
*
* Here's a list of the classes that can be generated
* and their meaning:
*
* |
* c2h-identifier | Variables
* |
* c2h-comment | Comments
* |
* c2h-directive | The first keyword of a
* | preprocessor directive.
* | (the keyword that starts
* | with '#').
* |
* c2h-val-str | String listerals. Also the
* | strings between < and >
* | of preprocessor directives
* | are categorized as strings.
* |
* c2h-val-char | Char literals (the ones between
* | 's).
* |
* c2h-val-int | Integer literals.
* |
* c2h-val-flt | Floating point literals.
* |
* c2h-kword | All of the language's keywords
* | (typedef, const, int, etc).
* |
* c2h-kword-* | Also for the language's
* | keywords, but * is substituted
* | with the keyword (e.g. typedef
* | -> c2h-kword-typedef). This
* | lets you color specific
* | keywords independently.
* |
* c2h-operator | Operators (like == and +).
* |
* c2h-fdeclname | The name of a function in its
* | declaration.
* |
* c2h-fcallname | The name of a function in a
* | function call.
* |
*
* Note that the previous class names only apply when
* the c2h- prefix is used, which is the default in the
* CLI but not in the C API.
*
* Most of the following attributes are merely stylistic,
* but some are necessary for a correct display of the
* code. Read the following comments to know more.
*
*/
div.c2h-code {
padding: 10px;
border-radius: 3px;
font-family: monospace;
font-size: 16px;
color: white;
background: hsl(210, 15%, 22%);
}
div.c2h-code-inner::-webkit-scrollbar {
width: 10px;
background: transparent;
}
div.c2h-code-inner::-webkit-scrollbar-thumb {
background: hsla(210, 13%, 40%, 0.7);
}
div.c2h-code-inner {
height: inherit;
max-height: inherit;
overflow: auto;
scrollbar-color: hsla(210, 13%, 40%, 0.7) transparent;
}
div.c2h-code table {
border-collapse: collapse;
font-size: inherit;
}
div.c2h-code table td {
color: white;
/* The vertical align is nice because for lines that
* are broken in more lines, this makes the line
* number align to the first line.
*/
vertical-align: top;
}
div.c2h-code table td:first-child {
/* Disabling the selection of the line numbers is
* necessary to be able to only select the code.
*/
user-select: none;
text-align: right;
padding: 0 10px;
color: hsla(210, 13%, 40%, 0.7);
}
div.c2h-code table td:last-child {
/* This field is suuper important. By default HTML
* collapses sequences of whitespace into one space.
* This isn't good to display code since it removed
* indentation. By applying this attribute to the
* second column of the table (which contains the
* code), the whitespace is preserved.
* NOTE: 'pre' stands for preserve.
*/
white-space: pre;
}
/* The rest is just defining the colors for each
* type of token.
*/
.c2h-comment {
color: hsl(221, 12%, 69%);
}
.c2h-val-int,
.c2h-val-flt {
color: hsl(32, 93%, 66%);
}
.c2h-val-str,
.c2h-val-char {
color: hsl(114, 31%, 68%);
}
.c2h-directive,
.c2h-kword {
color: hsl(300, 30%, 68%);
}
.c2h-kword-static,
.c2h-kword-const {
color: hsl(357, 79%, 65%);
}
.c2h-operator {
color: hsl(13, 93%, 66%);
}
.c2h-identifier {
color: hsl(219, 28%, 88%);
}
.c2h-fdeclname {
color: hsl(180, 36%, 54%);
}
.c2h-fcallname {
color: hsl(210, 50%, 60%);
}