From 25c58a44a707865e57729d2cb730c67eb96308e8 Mon Sep 17 00:00:00 2001 From: Techassi Date: Mon, 29 Jan 2024 12:26:17 +0100 Subject: [PATCH 1/2] feat: Add background color to rules, add TOML highlighting --- src/css/admonition.css | 32 ++++++++++++++++++++++++++++--- src/js/vendor/highlight.bundle.js | 1 + 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/css/admonition.css b/src/css/admonition.css index 7b89125..cc6567d 100644 --- a/src/css/admonition.css +++ b/src/css/admonition.css @@ -15,7 +15,33 @@ } } -/* Change color of the "important" admonition back to the default red */ -.doc .admonitionblock.code-rule.warning .icon { - background-color: #e40046; +/* Adjust styles for the "correct" code style rule usage */ +.doc .admonitionblock.code-rule.tip { + /* Change the background color of the "tip" admonition to a light green */ + & td.content { + background-color: #e7fbe8; + } + + /* Change the background color of the code block to a light green */ + & td.content div.listingblock pre.highlight code { + background-color: #e7fbe8; + } +} + +/* Adjust styles for the "wrong" code style rule usage */ +.doc .admonitionblock.code-rule.warning { + /* Change the color of the "important" admonition back to the default red */ + & .icon { + background-color: #e40046; + } + + /* Change the background color of the "tip" admonition to a light green */ + & td.content { + background-color: #f0d2db; + } + + /* Change the background color of the code block to a light green */ + & td.content div.listingblock pre.highlight code { + background-color: #f0d2db; + } } diff --git a/src/js/vendor/highlight.bundle.js b/src/js/vendor/highlight.bundle.js index d8586df..342043e 100644 --- a/src/js/vendor/highlight.bundle.js +++ b/src/js/vendor/highlight.bundle.js @@ -22,6 +22,7 @@ hljs.registerLanguage('sql', require('highlight.js/lib/languages/sql')) hljs.registerLanguage('xml', require('highlight.js/lib/languages/xml')) hljs.registerLanguage('yaml', require('highlight.js/lib/languages/yaml')); + hljs.registerLanguage('toml', require('highlight.js/lib/languages/ini')); [].slice.call(document.querySelectorAll('pre code.hljs')).forEach(function (node) { hljs.highlightElement(node) From f06b2ff814f42a3ae99f2b46bb0bf17afcfae786 Mon Sep 17 00:00:00 2001 From: Techassi Date: Mon, 29 Jan 2024 12:31:03 +0100 Subject: [PATCH 2/2] Fix ESLint error --- src/js/vendor/highlight.bundle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/vendor/highlight.bundle.js b/src/js/vendor/highlight.bundle.js index 342043e..1a77b5a 100644 --- a/src/js/vendor/highlight.bundle.js +++ b/src/js/vendor/highlight.bundle.js @@ -21,7 +21,7 @@ hljs.registerLanguage('shell', require('highlight.js/lib/languages/shell')) hljs.registerLanguage('sql', require('highlight.js/lib/languages/sql')) hljs.registerLanguage('xml', require('highlight.js/lib/languages/xml')) - hljs.registerLanguage('yaml', require('highlight.js/lib/languages/yaml')); + hljs.registerLanguage('yaml', require('highlight.js/lib/languages/yaml')) hljs.registerLanguage('toml', require('highlight.js/lib/languages/ini')); [].slice.call(document.querySelectorAll('pre code.hljs')).forEach(function (node) {