Skip to content

Commit 51ad644

Browse files
authored
feat: Add background color to rules, add TOML highlighting (#55)
* feat: Add background color to rules, add TOML highlighting * Fix ESLint error
1 parent b20d3d3 commit 51ad644

File tree

2 files changed

+31
-4
lines changed

2 files changed

+31
-4
lines changed

src/css/admonition.css

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,33 @@
1515
}
1616
}
1717

18-
/* Change color of the "important" admonition back to the default red */
19-
.doc .admonitionblock.code-rule.warning .icon {
20-
background-color: #e40046;
18+
/* Adjust styles for the "correct" code style rule usage */
19+
.doc .admonitionblock.code-rule.tip {
20+
/* Change the background color of the "tip" admonition to a light green */
21+
& td.content {
22+
background-color: #e7fbe8;
23+
}
24+
25+
/* Change the background color of the code block to a light green */
26+
& td.content div.listingblock pre.highlight code {
27+
background-color: #e7fbe8;
28+
}
29+
}
30+
31+
/* Adjust styles for the "wrong" code style rule usage */
32+
.doc .admonitionblock.code-rule.warning {
33+
/* Change the color of the "important" admonition back to the default red */
34+
& .icon {
35+
background-color: #e40046;
36+
}
37+
38+
/* Change the background color of the "tip" admonition to a light green */
39+
& td.content {
40+
background-color: #f0d2db;
41+
}
42+
43+
/* Change the background color of the code block to a light green */
44+
& td.content div.listingblock pre.highlight code {
45+
background-color: #f0d2db;
46+
}
2147
}

src/js/vendor/highlight.bundle.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
hljs.registerLanguage('shell', require('highlight.js/lib/languages/shell'))
2222
hljs.registerLanguage('sql', require('highlight.js/lib/languages/sql'))
2323
hljs.registerLanguage('xml', require('highlight.js/lib/languages/xml'))
24-
hljs.registerLanguage('yaml', require('highlight.js/lib/languages/yaml'));
24+
hljs.registerLanguage('yaml', require('highlight.js/lib/languages/yaml'))
25+
hljs.registerLanguage('toml', require('highlight.js/lib/languages/ini'));
2526

2627
[].slice.call(document.querySelectorAll('pre code.hljs')).forEach(function (node) {
2728
hljs.highlightElement(node)

0 commit comments

Comments
 (0)