-
Notifications
You must be signed in to change notification settings - Fork 1
/
_colors.less
68 lines (58 loc) · 2.65 KB
/
_colors.less
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
// This helper mixin iterates over a comma-separated set;
// calling the .Iteration mixin for each item in the set.
// It must be defined outside the callsite mixin, because
// of https://github.com/less/less.js/issues/2350.
.Loop(@set; @index: length(@set)) when (@index > 0) { // extract() is one-based
.Loop(@set; @index - 1);
.Iteration(extract(@set, @index));
}
// Calls @callback() with each supported color scheme,
// passing @name ('' for tags that are not languages),
// @baseColor, and @textColor via scoped variables, as
// well as @selector with the CSS selector (which will
// be empty for the default scheme) and @class for the
// classname without dot (for concatenation)
.defineCategoryColors(@callback) {
// The text color passed for tags that do not define a custom text color.
@defaultTextColor: #fff;
// Defines a color scheme without a language name
.TagTheme(@classes; @baseColor; @textColor: @defaultTextColor) {
.LanguageTheme(@classes; ''; @baseColor; @textColor);
}
// Defines a color scheme with a language name
.LanguageTheme(@classes; @name; @baseColor; @textColor: @defaultTextColor) {
.Loop(@classes);
.Iteration(@class) {
// Prepend a dot to classnames, while leaving the default empty.
// Replace() doesn't work properly on keywords; https://github.com/less/less.js/issues/2351
@selector: e(replace('@{class}', '(^[a-z])', '.$1'));
@callback();
}
}
.TagTheme(~''; #5DC4F0; @defaultTextColor);
.LanguageTheme(cpp; "C++"; #9fbce1);
.LanguageTheme(csharp; "C♯"; #368832);
.LanguageTheme(css; "CSS"; #97d8ff; #131313);
.LanguageTheme(html; "HTML"; #e34c26; #ebebeb);
.LanguageTheme(java; "Java"; #e76f00);
.LanguageTheme(javascript, js; "Javascript"; #f3df49; #2e2e2c);
.LanguageTheme(jekyll, liquid; "Jekyll"; #fc0; #333);
.LanguageTheme(less; "LESS"; #143352);
.LanguageTheme(razor; "Razor"; #e7f4ff; #000);
// For syntax highlighting; I use "vbnet" (pygments doesn't recognize vb-net)
.LanguageTheme(vb-net, vbnet; "VB.Net"; #00539c);
.LanguageTheme(xaml; "XAML"; #378ce9);
.LanguageTheme(xml; "XML"; #f60);
.TagTheme(async, multi-threading; #ff7700);
.TagTheme(cryptography, security; #a90a0a);
.TagTheme(dot-net; #3babd0);
.TagTheme(roslyn; #68217a);
.TagTheme(type-theory; #570000);
.TagTheme(derby-js; #55b3a6; #f6f0e1);
.TagTheme(jquery; #0769ad; #70c8ee);
.TagTheme(node-js; #8BC84B; #46483e);
.TagTheme(socket-io; #19698a);
.TagTheme(vs-code, visual-studio-code; #038fd6);
.TagTheme(visual-studio, visual-studio-2012, visual-studio-2013; #742894);
.LanguageTheme(april-fools, errorfree; "ErrorFree"; red);
}