Add css backwards-compatibility

Hardcoded some values for older browsers which may not understand css
custom properties.
This commit is contained in:
Chris Josten 2020-06-30 12:42:39 +02:00
parent 791a08363a
commit c958780e76
2 changed files with 39 additions and 15 deletions

View file

@ -33,6 +33,11 @@
--colour-bg-code: #ccc; --colour-bg-code: #ccc;
--colour-fg: #000000; --colour-fg: #000000;
--colour-fg-highlight: #7f0602; --colour-fg-highlight: #7f0602;
--colour-fg-lineno: #111;
--colour-fg-code-number: #06027f;
--colour-fg-code-string: #027f06;
--colour-fg-code-fun: #7b7f02;
--colour-fg-code-com: #027b7f;
} }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
@ -42,15 +47,22 @@
--colour-bg-code: #222; --colour-bg-code: #222;
--colour-fg: #ffffff; --colour-fg: #ffffff;
--colour-fg-highlight: #fc918d; --colour-fg-highlight: #fc918d;
--colour-fg-lineno: #ccc;
--colour-fg-code-number: #918dfc;
--colour-fg-code-string: #8dfc91;
--colour-fg-code-fun: #f8fc8d;
--colour-fg-code-com: #8df8fc;
} }
} }
body { body {
background-color: #f0f0f0;
background-color: var(--colour-bg); background-color: var(--colour-bg);
margin: 0; margin: 0;
display: flex; display: flex;
justify-content: center; justify-content: center;
min-height: 100vh; min-height: 100vh;
color: #000000;
color: var(--colour-fg); color: var(--colour-fg);
} }
@ -79,9 +91,12 @@ body > main {
flex: 1 1; flex: 1 1;
padding: 2em; padding: 2em;
/* width: 600px; */ /* width: 600px; */
border-left: #7f0602 dotted 1px;
border-right: #7f0602 dotted 1px;
border-left: var(--colour-fg-highlight) dotted 1px; border-left: var(--colour-fg-highlight) dotted 1px;
border-right: var(--colour-fg-highlight) dotted 1px; border-right: var(--colour-fg-highlight) dotted 1px;
max-width: 600px; max-width: 600px;
background-color: #ddd;
background-color: var(--colour-bg-main); background-color: var(--colour-bg-main);
} }
@ -98,6 +113,7 @@ h1, .title {
} }
header { header {
border-bottom: 1px dotted #000000;
border-bottom: 1px dotted var(--colour-fg); border-bottom: 1px dotted var(--colour-fg);
padding-top: 0.5em; padding-top: 0.5em;
padding-bottom: 0.5em; padding-bottom: 0.5em;
@ -106,10 +122,12 @@ header {
hr { hr {
border: none; border: none;
border-top: 1px dotted #000000;
border-top: 1px dotted var(--colour-fg); border-top: 1px dotted var(--colour-fg);
} }
footer { footer {
border-top: 1px dotted #000000;
border-top: 1px dotted var(--colour-fg); border-top: 1px dotted var(--colour-fg);
padding-top: 0.5em; padding-top: 0.5em;
padding-bottom: 0.5em; padding-bottom: 0.5em;
@ -152,12 +170,15 @@ nav ul {
dl.project-platforms-technologies { dl.project-platforms-technologies {
padding: 0.5em 0; padding: 0.5em 0;
border-top: 1px dotted #000000;
border-top: 1px dotted var(--colour-fg); border-top: 1px dotted var(--colour-fg);
border-bottom: 1px dotted #000000;
border-bottom: 1px dotted var(--colour-fg); border-bottom: 1px dotted var(--colour-fg);
} }
.tag { .tag {
display: inline-block; display: inline-block;
background-color: #ccc;
background-color: var(--colour-bg-code); background-color: var(--colour-bg-code);
border-radius: 1em; border-radius: 1em;
font-size: 0.75em; font-size: 0.75em;
@ -187,6 +208,7 @@ dl.project-platforms-technologies {
/* MARKDOWN */ /* MARKDOWN */
:not(pre) > code { :not(pre) > code {
background-color: #ccc;
background-color: var(--colour-bg-code); background-color: var(--colour-bg-code);
padding: 0.2em 0.4em; padding: 0.2em 0.4em;
} }
@ -198,6 +220,7 @@ article :not(figure) > img {
div.sourceCode, blockquote, .screenshots { div.sourceCode, blockquote, .screenshots {
scrollbar-color: var(--colour-fg-highlight) var(--colour-bg-code); scrollbar-color: var(--colour-fg-highlight) var(--colour-bg-code);
/*scrollbar-width: thin;*/ /*scrollbar-width: thin;*/
background-color: #ccc;
background-color: var(--colour-bg-code); background-color: var(--colour-bg-code);
} }
@ -205,6 +228,7 @@ pre.sourceCode {
} }
pre, blockquote { pre, blockquote {
border-left: 1px solid #7f0602;
border-left: 1px solid var(--colour-fg-highlight); border-left: 1px solid var(--colour-fg-highlight);
padding-left: 1em; padding-left: 1em;
padding-right: 1em; padding-right: 1em;

View file

@ -23,7 +23,7 @@ border: none; display: inline-block;
-khtml-user-select: none; -moz-user-select: none; -khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none; -ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em; padding: 0 4px; width: 4em;
color: #000000; color: var(--colour-fg-lineno);
} }
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; } pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode div.sourceCode
@ -33,30 +33,30 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
} }
code span.al { color: #ff0000; font-weight: bold; } /* Alert */ code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */ code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */ code span.at { color: var(--colour-fg); font-style: italic; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */ code span.bn { color: #40a070; } /* BaseN */
code span.bu { } /* BuiltIn */ code span.bu { } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */ code span.cf { color: var(--colour-fg-highlight); font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */ code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */ code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */ code span.co { color: var(--colour-fg-code-com); font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */ code span.cv { color: var(--colour-fg-code-com); font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */ code span.do { color: var(--colour-fg-code-com); font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */ code span.dt { color: var(--colour-fg-highlight); } /* DataType */
code span.dv { color: #40a070; } /* DecVal */ code span.dv { color: var(--colour-fg-code-number); } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */ code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */ code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */ code span.fl { color: var(--colour-fg-code-number); } /* Float */
code span.fu { color: #06287e; } /* Function */ code span.fu { color: var(--colour-fg-code-fun); } /* Function */
code span.im { } /* Import */ code span.im { } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */ code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */ code span.kw { color: var(--colour-fg-highlight); font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */ code span.op { color: var(--colour-fg); } /* Operator */
code span.ot { color: #007020; } /* Other */ code span.ot { color: var(--colour-fg); } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */ code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */ code span.sc { color: var(--colour-fg-highlight); } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */ code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */ code span.st { color: var(--colour-fg-code-string); } /* String */
code span.va { color: #19177c; } /* Variable */ code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */ code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */