Add dark mode support for code snippets

Basically just darkening the background more.
This commit is contained in:
Robin Whittleton 2019-10-15 20:54:05 +02:00 committed by Alex Cabal
parent 879e8b9c49
commit c4b278982c

View file

@ -1192,6 +1192,15 @@ code.css.full{
color: #fff !important; /* in case code highlighting fails */ color: #fff !important; /* in case code highlighting fails */
} }
@media (prefers-color-scheme: dark){
figure code.html,
figure code.css,
code.html.full,
code.css.full{
background-color: var(--light-body-text);
}
}
code.full{ code.full{
margin-top: 1rem; margin-top: 1rem;
color: #fff !important; /* in case code highlighting fails */ color: #fff !important; /* in case code highlighting fails */
@ -1232,6 +1241,12 @@ code.terminal{
overflow: auto; overflow: auto;
} }
@media (prefers-color-scheme: dark){
code.terminal{
background-color: var(--light-body-text);
}
}
code.terminal::before{ code.terminal::before{
content: url('/images/terminal.svg'); content: url('/images/terminal.svg');
height: 1rem; height: 1rem;