Skip to content

Commit 9f78c53

Browse files
CldfireJoshua Nelson
authored and
Joshua Nelson
committed
Add ayu-highlight.css
1 parent 03c321f commit 9f78c53

File tree

3 files changed

+83
-1
lines changed

3 files changed

+83
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ target
55
*.css
66
*.css.map
77
!vendor/**/*.css
8+
!static/ayu-highlight.css
89
.sass-cache
910
.vagrant
1011
.rustwide

static/ayu-highlight.css

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/*
2+
Based off of the Ayu theme
3+
Original by Dempfi (https://github.com/dempfi/ayu)
4+
*/
5+
6+
.hljs {
7+
display: block;
8+
overflow-x: auto;
9+
background: #191f26;
10+
color: #e6e1cf;
11+
padding: 0.5em;
12+
}
13+
14+
.hljs-comment,
15+
.hljs-quote {
16+
color: #5c6773;
17+
font-style: italic;
18+
}
19+
20+
.hljs-variable,
21+
.hljs-template-variable,
22+
.hljs-attribute,
23+
.hljs-attr,
24+
.hljs-regexp,
25+
.hljs-link,
26+
.hljs-selector-id,
27+
.hljs-selector-class {
28+
color: #ff7733;
29+
}
30+
31+
.hljs-number,
32+
.hljs-meta,
33+
.hljs-builtin-name,
34+
.hljs-literal,
35+
.hljs-type,
36+
.hljs-params {
37+
color: #ffee99;
38+
}
39+
40+
.hljs-string,
41+
.hljs-bullet {
42+
color: #b8cc52;
43+
}
44+
45+
.hljs-title,
46+
.hljs-built_in,
47+
.hljs-section {
48+
color: #ffb454;
49+
}
50+
51+
.hljs-keyword,
52+
.hljs-selector-tag,
53+
.hljs-symbol {
54+
color: #ff7733;
55+
}
56+
57+
.hljs-name {
58+
color: #36a3d9;
59+
}
60+
61+
.hljs-tag {
62+
color: #00568d;
63+
}
64+
65+
.hljs-emphasis {
66+
font-style: italic;
67+
}
68+
69+
.hljs-strong {
70+
font-weight: bold;
71+
}
72+
73+
.hljs-addition {
74+
color: #91b362;
75+
}
76+
77+
.hljs-deletion {
78+
color: #d96c75;
79+
}

templates/macros.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@
2626
// Choose which highlight.js theme to load based on the user theme
2727
var stylesheet;
2828
switch(document.documentElement.dataset.theme) {
29-
case "dark":
3029
case "ayu":
30+
stylesheet = "/-/static/ayu-highlight.css";
31+
break;
32+
case "dark":
3133
stylesheet = "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.4.0/styles/dark.min.css";
3234
break;
3335
case "null": // The user is visiting docs.rs for the first time and hasn't set a theme yet.

0 commit comments

Comments
 (0)