From baebe67db5cd0ba24c9289995f18a232be7e5e9c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 11 Sep 2017 13:24:49 +0200 Subject: [PATCH] css: styling for higlighted lines in code blocks. And support for .m-inverted-highlight. --- css/m-components.css | 24 +++++++++++++++++++++++- css/m-dark.css | 1 + css/m-light.css | 1 + 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/css/m-components.css b/css/m-components.css index 39e51b5a..fcdea163 100644 --- a/css/m-components.css +++ b/css/m-components.css @@ -54,7 +54,6 @@ pre { color: var(--code-color); background-color: var(--code-background-color); border-radius: 0.2rem; - border-color: var(--line-color); overflow-x: auto; margin-top: 0; /* stupid defaults */ } @@ -945,6 +944,29 @@ figure.m-figure.m-fullwidth img { } } +/* Code block (uses Pygments CSS classes) */ +div.highlight pre span.hll { + background-color: var(--line-color); + border-color: var(--line-color); + margin-left: -1.0rem; + margin-right: -1.0rem; + border-left-style: solid; + border-left-width: 0.25rem; + padding-left: 0.75rem; +} +.m-inverted-highlight div.highlight pre { + color: var(--color-inverse-highlight); +} +.m-inverted-highlight div.highlight pre > span { + opacity: 0.3333; +} +.m-inverted-highlight div.highlight pre > span.hll { + color: var(--color); + opacity: 1; + background-color: transparent; + border-color: transparent; +} + /* Spacing after every block element, but not after the last */ p, ul, ol, dl, blockquote, hr, pre, article, article > header, article section, diff --git a/css/m-dark.css b/css/m-dark.css index c0704402..bde07327 100644 --- a/css/m-dark.css +++ b/css/m-dark.css @@ -20,6 +20,7 @@ /* Basics */ --background-color: #2f363f; --color: #dcdcdc; + --color-inverse-highlight: rgba(220, 220, 220, 0.33); --line-color: #405363; --link-color: #5b9dd9; --link-active-color: #a5c9ea; diff --git a/css/m-light.css b/css/m-light.css index 62685931..b66de2dd 100644 --- a/css/m-light.css +++ b/css/m-light.css @@ -18,6 +18,7 @@ /* Basics */ --background-color: #ffffff; --color: #000000; + --color-inverse-highlight: rgba(0, 0, 0, 0.33); --line-color: #f7e3db; --link-color: #ea7944; --link-active-color: #cb4b16; -- 2.30.2