Browse Source

Add Zenburn theme

I was doing some work on an old site over the weekend that uses this
color scheme and it reminded me how much I used to like it. Might as
well!
merge-requests/76/head
Deimos 5 years ago
parent
commit
67f6e179f4
  1. 1
      tildes/scss/styles.scss
  2. 41
      tildes/scss/themes/_zenburn.scss
  3. 5
      tildes/tildes/templates/base.jinja2
  4. 1
      tildes/tildes/views/settings.py

1
tildes/scss/styles.scss

@ -46,3 +46,4 @@
@import "themes/dracula"; @import "themes/dracula";
@import "themes/atom_one_dark"; @import "themes/atom_one_dark";
@import "themes/solarized"; @import "themes/solarized";
@import "themes/zenburn";

41
tildes/scss/themes/_zenburn.scss

@ -0,0 +1,41 @@
// Color palette is Jani Nurminen's "Zenburn"
// http://kippura.org/zenburnpage/
// Basic monochrome colors
$background: #3f3f3f;
$background-alt: #4f4f4f;
$foreground: #dcdccc;
$foreground-alt: #aaa;
$border: #5b605e;
// Accent colors
$blue: #8cd0d3;
$green: #7f9f7f;
$green-bright: #80d4aa;
$pink: #dca3a3;
$red: #dc8c6c;
$purple: #bc8cbc;
$yellow: #efef8f;
// Actual theme definition
$theme-zenburn: (
"alert": $green-bright,
"background-primary": $background,
"background-secondary": $background-alt,
"border": $border,
"comment-label-exemplary": $blue,
"comment-label-joke": $green,
"comment-label-noise": $yellow,
"comment-label-offtopic": $pink,
"comment-label-malice": $red,
"error": $red,
"foreground-primary": $foreground,
"foreground-secondary": $foreground-alt,
"link": $blue,
"link-visited": $purple,
"warning": $yellow,
);
body.theme-zenburn {
@include use-theme($theme-zenburn);
}

5
tildes/tildes/templates/base.jinja2

@ -28,6 +28,8 @@
<meta name="theme-color" content="#282c34"> <meta name="theme-color" content="#282c34">
{% elif request.cookies.get('theme', '') == 'black' %} {% elif request.cookies.get('theme', '') == 'black' %}
<meta name="theme-color" content="#222"> <meta name="theme-color" content="#222">
{% elif request.cookies.get('theme', '') == 'zenburn' %}
<meta name="theme-color" content="#3f3f3f">
{% endif %} {% endif %}
{% assets "css" %} {% assets "css" %}
@ -113,7 +115,8 @@
("dark", "Solarized Dark"), ("dark", "Solarized Dark"),
("dracula", "Dracula"), ("dracula", "Dracula"),
("atom-one-dark", "Atom One Dark"), ("atom-one-dark", "Atom One Dark"),
("black", "Black")) %}
("black", "Black"),
("zenburn", "Zenburn")) %}
<option value="{{ theme }}" <option value="{{ theme }}"
{{ 'selected' if theme == request.cookies.get("theme", "white") else '' }} {{ 'selected' if theme == request.cookies.get("theme", "white") else '' }}
> >

1
tildes/tildes/views/settings.py

@ -39,6 +39,7 @@ def get_settings(request: Request) -> dict:
"dracula": "Dracula", "dracula": "Dracula",
"atom-one-dark": "Atom One Dark", "atom-one-dark": "Atom One Dark",
"black": "Black", "black": "Black",
"zenburn": "Zenburn",
} }
if site_default_theme == user_default_theme: if site_default_theme == user_default_theme:

Loading…
Cancel
Save