-
Notifications
You must be signed in to change notification settings - Fork 1
/
_hl-adoc-template.scss
164 lines (151 loc) · 5.04 KB
/
_hl-adoc-template.scss
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
// "_hl-adoc-template.scss" v1.0.0 | 2019/03/25 | by Tristano Ajmone
// *****************************************************************************
// * *
// * Highlight Theme Template for Asciidoctor *
// * *
// *****************************************************************************
// A reusable variables-based '@import' template to quickly define Highlight
// themes for Asciidoctor. It can create both generic themes as well as themes
// targetting a specific language, via the $HL-Lang variable.
// =============================================================================
// Default Values
// =============================================================================
// Let's define some defaults for the template variables, so users don't have to
// define every single variable.
$HL-Border-radius: 4px !default;
$HL-Border-width: 1px !default;
$HL-Font-family: Consolas, Monaco, "Courier New", Courier, monospace !default;
$HL-Font-size: 1em !default;
// -----------------------------------------------------------------------------
// Default Scheme: Base16 Eighties, by Chris Kempson (http://chriskempson.com)
// -----------------------------------------------------------------------------
$HL-LangNameHover: #a09f93 !default; // base04 : Lang name color (when hovering)
$HL-Canvas: #2d2d2d !default; // base00
$HL-Default: #d3d0c8 !default; // base05
$HL-LineNum: #747369 !default; // base03
$HL-Border-color: #a09f93 !default; // base04
$HL-Border-radius: 4px !default;
$HL-Border-width: 1px !default;
$HL-Number: #f99157 !default; // base09
$HL-Escape: #f99157 !default; // base09
$HL-Interpolation: #d27b53 !default; // base0F
$HL-String: #99cc99 !default; // base0B
$HL-PreProcessor: #cc99cc !default; // base0E
$HL-StringPreProc: #66cccc !default; // base0C
$HL-BlockComment: #a09f93 !default; // base04
$HL-LineComment: $HL-BlockComment !default;
$HL-Operator: $HL-Default !default;
$HL-Keywords1: #f2777a !default; // base08
$HL-Keywords2: #ffcc66 !default; // base0A
$HL-Keywords3: #6699cc !default; // base0D
$HL-Keywords4: #cc99cc !default; // base0E
$HL-Keywords5: #66cccc !default; // base0C
$HL-Keywords6: #d27b53 !default; // base0F
// -----------------------------------------------------------------------------
// Optional Language Settings
// -----------------------------------------------------------------------------
// If $HL-Lang is set, the output theme will target that language, otherwise it
// will be a generic theme for Highlight.
$HL-Lang: null !default;
$ref_datalang: "data-lang" !default;
$ref_lang: "lang" !default;
@if $HL-Lang == null {
$ref_datalang: "data-lang" !global;
$ref_lang: "lang" !global;
} @else {
$ref_datalang: "data-lang=#{$HL-Lang}" !global;
$ref_lang: "lang=#{$HL-Lang}" !global;
}
// =============================================================================
// Theme Definition
// =============================================================================
.listingblock code[#{$ref_datalang}]::before{
// Color of language name (shown when hovering)
color: $HL-LangNameHover;
}
.listingblock pre[class="highlight"][#{$ref_lang}] {
background-color: $HL-Canvas;
&>code {
color: $HL-Default;
font-family: $HL-Font-family;
font-size: $HL-Font-size;
}
border-radius: $HL-Border-radius;
border: $HL-Border-width solid $HL-Border-color;
.hl {
color: $HL-Default;
&.num {
// Numbers
color: $HL-Number;
}
&.esc {
// Escape sequences
color: $HL-Escape;
}
&.ipl {
// Interpolation sequences
color: $HL-Interpolation;
}
&.str {
// Strings
color: $HL-String;
}
&.ppc {
// Preprocessor directives
color: $HL-PreProcessor;
}
&.pps {
// Strings within preprocessor directives
color: $HL-StringPreProc;
}
&.com {
// Block comments
color: $HL-BlockComment;
font-style: italic;
}
&.slc {
// Single-line comments
color: $HL-LineComment;
font-style: italic;
}
&.lin {
// Line numbers
color: $HL-LineNum;
}
&.opt {
// Operators
color: $HL-Operator;
}
// ---------------------
// Keywords Groups
// ---------------------
&.kwa, &.kwb, &.kwc, &.kwd, &.kwe, &.kwf {
// font-weight: bold;
}
&.kwa {
// Keywords group 1
color: $HL-Keywords1;
}
&.kwb {
// Keywords group 2
color: $HL-Keywords2;
}
&.kwc {
// Keywords group 3
color: $HL-Keywords3;
}
&.kwd {
// Keywords group 4
color: $HL-Keywords4;
}
&.kwde{
// Keywords group 5
color: $HL-Keywords5;
}
&.kwf {
// Keywords group 6
color: $HL-Keywords6;
}
}
}
// EOF //