Syntax highlighting (#691)
* Syntax highlighting mostly... Exists. * Add dependency to dockerfile * Handle non-existent languages better * Make the default a bit nicer * Improve highlighting. Clean up function * Add dark theme, add the comment scope to the allowed classes * update build env * Address review comments * Use find_syntax_by_token which produces the desired behavior * Change flat_map into flatten (commit cargo.lock)
This commit is contained in:
@@ -17,3 +17,12 @@ $text-color: $white;
|
||||
$primary: $purple;
|
||||
$primary-text-color: $white; // text color on primary background (buttons for instance)
|
||||
$success-color: $blue;
|
||||
|
||||
//Code Highlighting
|
||||
|
||||
$code-keyword-color: #f79ac1;
|
||||
$code-source-color: #a6f0ab;
|
||||
$code-constant-color: #dfec84;
|
||||
$code-operator-color: #eddf95;
|
||||
$code-string-color: #f2ae60;
|
||||
$code-comment-color: #a3b4f9;
|
||||
|
||||
@@ -623,3 +623,28 @@ figure {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//highlighting
|
||||
code {
|
||||
.constant{
|
||||
color: $code-constant-color;
|
||||
}
|
||||
.string{
|
||||
color: $code-string-color;
|
||||
}
|
||||
.keyword.type,.keyword.control,.type{
|
||||
color: $code-keyword-color;
|
||||
}
|
||||
.keyword.operator{
|
||||
color: $code-operator-color;
|
||||
}
|
||||
.source{
|
||||
color: $code-source-color;
|
||||
}
|
||||
.comment{
|
||||
color: $code-comment-color;
|
||||
}
|
||||
.function{
|
||||
color:inherit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,3 +27,11 @@ $margin: 0 $horizontal-margin;
|
||||
$route159: "Route159", serif;
|
||||
$playfair: "Playfair Display", serif;
|
||||
$lora: "Lora", serif;
|
||||
|
||||
//Code Highlighting
|
||||
$code-keyword-color: #45244a;
|
||||
$code-source-color: #4c588c;
|
||||
$code-constant-color: scale-color(magenta,$lightness:-5%);
|
||||
$code-operator-color: scale-color($code-source-color,$lightness:-5%);
|
||||
$code-string-color: #8a571c;
|
||||
$code-comment-color: #1c4c8a;
|
||||
|
||||
Reference in New Issue
Block a user