Skip to content

Commit ac3f30e

Browse files
amcdnljelbourn
authored andcommitted
chore(styles): apply material light / dark styles to highlightjs (angular#213)
1 parent 60b84cc commit ac3f30e

File tree

5 files changed

+207
-1
lines changed

5 files changed

+207
-1
lines changed

angular-cli.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"mobile": false,
2020
"styles": [
2121
"main.scss",
22-
"highlightjs/solarized-light.css",
22+
"highlightjs/material-light.css",
2323
{"input": "assets/pink-bluegrey.css", "lazy": true},
2424
{"input": "assets/deeppurple-amber.css", "lazy": true},
2525
{"input": "assets/indigo-pink.css", "lazy": true},

src/assets/custom-themes/pink-bluegrey.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@import '../../app-theme';
2+
@import '../../highlightjs/material-dark';
23

34
// Define the dark theme.
45
$primary: mat-palette($mat-pink);

src/assets/custom-themes/purple-green.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@import '../../app-theme';
2+
@import '../../highlightjs/material-dark';
23

34
// Define the dark theme.
45
$primary: mat-palette($mat-purple);

src/highlightjs/material-dark.css

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
/*
2+
Orginal Style from https://github.com/Kelbster/highlightjs-material-dark-theme (c) Kelby Gassmanl <[email protected]>
3+
*/
4+
.hljs {
5+
display: block;
6+
overflow-x: auto;
7+
padding: 1em;
8+
background: #2B2B2D;
9+
color: #CDD3D8;
10+
font-family: "Roboto Mono", monospace;
11+
font-size: 1em;
12+
}
13+
14+
.hljs > *::selection {
15+
background-color: #3e4451;
16+
}
17+
18+
.hljs-comment {
19+
color: #656565;
20+
font-style: italic;
21+
}
22+
23+
.hljs-selector-tag {
24+
color: #C792EA;
25+
}
26+
27+
.hljs-string,
28+
.hljs-subst {
29+
color: #C3E88D;
30+
}
31+
32+
.hljs-number,
33+
.hljs-regexp,
34+
.hljs-variable,
35+
.hljs-template-variable {
36+
color: #F77669;
37+
}
38+
39+
.hljs-keyword {
40+
color: #C792EA;
41+
}
42+
.hljs-function > .hljs-title {
43+
color: #75A5FF;
44+
}
45+
.hljs-tag {
46+
color: #abb2bf;
47+
}
48+
.hljs-name {
49+
color: #e06c75;
50+
}
51+
.hljs-type {
52+
color: #da4939;
53+
}
54+
55+
.hljs-attribute {
56+
color: #80CBBF;
57+
}
58+
59+
.hljs-symbol,
60+
.hljs-bullet,
61+
.hljs-built_in,
62+
.hljs-builtin-name,
63+
.hljs-link {
64+
color: #C792EA;
65+
}
66+
67+
.hljs-params {
68+
color: #EEFFF7;
69+
}
70+
71+
72+
.hljs-meta {
73+
color: #75A5FF;
74+
}
75+
76+
.hljs-title {
77+
color: #75A5FF;
78+
}
79+
80+
.hljs-section {
81+
color: #ffc66d;
82+
}
83+
84+
.hljs-addition {
85+
background-color: #144212;
86+
color: #e6e1dc;
87+
display: inline-block;
88+
width: 100%;
89+
}
90+
91+
.hljs-deletion {
92+
background-color: #600;
93+
color: #e6e1dc;
94+
display: inline-block;
95+
width: 100%;
96+
}
97+
98+
.hljs-selector-class {
99+
color: #FFCB68;
100+
}
101+
102+
.hljs-selector-id {
103+
color: #F77669;
104+
}
105+
106+
.hljs-emphasis {
107+
font-style: italic;
108+
}
109+
110+
.hljs-strong {
111+
font-weight: bold;
112+
}
113+
114+
.hljs-link {
115+
text-decoration: underline;
116+
}

src/highlightjs/material-light.css

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/** Adapted from https://github.com/atom-material/atom-material-syntax-light */
2+
.hljs {
3+
display: block;
4+
overflow-x: auto;
5+
padding: 1em;
6+
background: #FAFAFA;
7+
color: #607D8B;
8+
font-family: "Roboto Mono", monospace;
9+
font-size: 1em;
10+
}
11+
12+
.hljs > *::selection,
13+
.hljs-section {
14+
background-color: #D6EDEA;
15+
}
16+
17+
.hljs-comment {
18+
color: #B0BEC5;
19+
font-style: italic;
20+
}
21+
22+
.hljs-tag,
23+
.hljs-selector-tag,
24+
.hljs-regexp,
25+
.hljs-meta {
26+
color: #39ADB5;
27+
}
28+
29+
.hljs-string,
30+
.hljs-subst {
31+
color: #91B859;
32+
}
33+
34+
.hljs-number,
35+
.hljs-variable,
36+
.hljs-template-variable {
37+
color: #80CBC4;
38+
}
39+
40+
.hljs-name,
41+
.hljs-keyword,
42+
.hljs-type,
43+
.hljs-attribute {
44+
color: #7C4DFF;
45+
}
46+
47+
.hljs-title,
48+
.hljs-function > .hljs-title,
49+
.hljs-symbol,
50+
.hljs-bullet,
51+
.hljs-built_in,
52+
.hljs-builtin-name,
53+
.hljs-link {
54+
color: #6182B8;
55+
}
56+
57+
.hljs-params {
58+
color: #F76D47;
59+
}
60+
61+
.hljs-addition {
62+
color: #7C4DFF;
63+
display: inline-block;
64+
width: 100%;
65+
}
66+
67+
.hljs-deletion {
68+
color: #E53935;
69+
display: inline-block;
70+
width: 100%;
71+
}
72+
73+
.hljs-selector-id,
74+
.hljs-selector-class {
75+
color: #8796B0;
76+
}
77+
78+
.hljs-emphasis {
79+
font-style: italic;
80+
}
81+
82+
.hljs-strong {
83+
font-weight: bold;
84+
}
85+
86+
.hljs-link {
87+
text-decoration: underline;
88+
}

0 commit comments

Comments
 (0)