forked from github/CopilotForXcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHighlightJSThemeTemplate.swift
More file actions
107 lines (104 loc) · 2.49 KB
/
HighlightJSThemeTemplate.swift
File metadata and controls
107 lines (104 loc) · 2.49 KB
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
import Foundation
func buildHighlightJSTheme(_ theme: XcodeTheme) -> String {
/// The source value is an `r g b a` string, for example: `0.5 0.5 0.2 1`
return """
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: \(theme.backgroundColor.hexString);
color: \(theme.plainTextColor.hexString);
}
.xml .hljs-meta {
color: \(theme.marksColor.hexString);
}
.hljs-comment,
.hljs-quote {
color: \(theme.commentColor.hexString);
}
.hljs-tag,
.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-name {
color: \(theme.keywordsColor.hexString);
}
.hljs-attribute {
color: \(theme.attributesColor.hexString);
}
.hljs-variable,
.hljs-template-variable {
color: \(theme.otherPropertiesAndGlobalsColor.hexString);
}
.hljs-code,
.hljs-string,
.hljs-meta-string {
color: \(theme.stringsColor.hexString);
}
.hljs-regexp {
color: \(theme.regexLiteralsColor.hexString);
}
.hljs-link {
color: \(theme.urlsColor.hexString);
}
.hljs-title {
color: \(theme.headingColor.hexString);
}
.hljs-symbol,
.hljs-bullet {
color: \(theme.attributesColor.hexString);
}
.hljs-number {
color: \(theme.numbersColor.hexString);
}
.hljs-section {
color: \(theme.marksColor.hexString);
}
.hljs-meta {
color: \(theme.keywordsColor.hexString);
}
.hljs-type,
.hljs-built_in,
.hljs-builtin-name {
color: \(theme.otherTypeNamesColor.hexString);
}
.hljs-class .hljs-title,
.hljs-title .class_ {
color: \(theme.typeDeclarationsColor.hexString);
}
.hljs-function .hljs-title,
.hljs-title .function_ {
color: \(theme.otherDeclarationsColor.hexString);
}
.hljs-params {
color: \(theme.otherDeclarationsColor.hexString);
}
.hljs-attr {
color: \(theme.attributesColor.hexString);
}
.hljs-subst {
color: \(theme.plainTextColor.hexString);
}
.hljs-formula {
background-color: \(theme.selectionColor.hexString);
font-style: italic;
}
.hljs-addition {
background-color: #baeeba;
}
.hljs-deletion {
background-color: #ffc8bd;
}
.hljs-selector-id,
.hljs-selector-class {
color: \(theme.plainTextColor.hexString);
}
.hljs-doctag,
.hljs-strong {
font-weight: bold;
}
.hljs-emphasis {
font-style: italic;
}
"""
}