-
Notifications
You must be signed in to change notification settings - Fork 12
/
rouge.scss
100 lines (89 loc) · 2.18 KB
/
rouge.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
$CSS_PROPS: (color, background-color, font-style, font-weight);
/* prettier-ignore */
$ROUGE_CLASSES: (
cm, // Comment::Multiline
cp, // Comment::Preproc
c1, // Comment::Single
cs, // Comment::Special
cd, // Comment
c, // Comment
err, // Error
gd, // Generic::Deleted
ge, // Generic::Emph
gr, // Generic::Error
gh, // Generic::Heading
gi, // Generic::Inserted
go, // Generic::Output
gp, // Generic::Prompt
gs, // Generic::Strong
gu, // Generic::Subheading
gt, // Generic::Traceback
kc, // Keyword::Constant
kd, // Keyword::Declaration
kn, // Keyword::Namespace
kp, // Keyword::Pseudo
kr, // Keyword::Reserved
kt, // Keyword::Type
kv, // Keyword
k, // Keyword
mf, // Literal::Number::Float
mh, // Literal::Number::Hex
il, // Literal::Number::Integer::Long
mi, // Literal::Number::Integer
mo, // Literal::Number::Oct
mb, // Literal::Number
mx, // Literal::Number
m, // Literal::Number
sb, // Literal::String::Backtick
sc, // Literal::String::Char
sd, // Literal::String::Symbol
s2, // Literal::String::Double
se, // Literal::String::Escape
sh, // Literal::String::Heredoc
si, // Literal::String::Interpol
sx, // Literal::String::Other
sr, // Literal::String::Regex
s1, // Literal::String::Single
ss, // Literal::String::Symbol
s, // Literal::String
na, // Name::Attribute
bp, // Name::Builtin::Pseudo
nb, // Name::Builtin
nc, // Name::Class
no, // Name::Constant
nd, // Name::Decorator
ni, // Name::Entity
ne, // Name::Exception
nf, // Name::Function
nl, // Name::Label
nn, // Name::Namespace
nt, // Name::Tag
vc, // Name::Variable::Class
vg, // Name::Variable::Global
vi, // Name::Variable::Instance
nv, // Name::Variable
nx, // Name::Other
ow, // Operator::Word
o, // Operator
w, // Text::Whitespace
// txt, // Text
);
.highlight table td {
padding: 5px;
}
.highlight table pre {
margin: 0;
}
@mixin css_props($class_name) {
@each $prop in $CSS_PROPS {
#{$prop}: var(--primer-spec-rouge-#{$class_name}-#{$prop});
}
}
.highlight {
@include css_props(txt);
}
@each $rouge_class in $ROUGE_CLASSES {
.highlight .#{$rouge_class} {
@include css_props($rouge_class);
}
}