Merge branch 'master' into selenized-black

This commit is contained in:
Dylan Hackworth 2020-06-06 23:54:51 -05:00 committed by GitHub
commit db23a17eca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 87 additions and 11 deletions

View file

@ -14,7 +14,7 @@
"roomlist-text-secondary-color": "#FFF3A4",
"timeline-background-color": "#05192D",
"timeline-highlights-color": "#32353b",
"timeline-highlights-color": "#011223",
"timeline-text-color": "#FFF3A4",
"timeline-text-secondary-color": "#A79000",
"reaction-row-button-selected-bg-color": "#FFEC70"

View file

Before

Width:  |  Height:  |  Size: 170 KiB

After

Width:  |  Height:  |  Size: 170 KiB

Before After
Before After

View file

@ -13,15 +13,18 @@ Join us in [#riot-web-themes:dhdf.dev](https://matrix.to/#/!pjCLhvJxLkGjNQFqcB:m
* [If you are a Firefox user](#if-you-are-a-firefox-user)
* [Or use my instance of Riot Web](#use-my-riot-web-instance)
- [Themes](#themes)
* [ThomCat Black](#thomcat-black)
* [Discord Dark Theme](#discord-dark-theme)
* [Geeko Dark Theme](#geeko-dark-theme)
* [Luxury Dark Theme](#luxury-dark-theme)
* [Nord Dark Theme](#nord-dark-theme)
* [Nord Light Theme](#nord-light-theme)
* [Selenized Light Theme](#selenized-light-theme)
* [Selenized Dark Theme](#selenized-dark-theme)
* [Selenized Black Theme](#selenized-black-theme)
* [Geeko Dark Theme](#geeko-dark-theme)
- [Advanced](#workarounds)
* [Selenized Dark Theme](#selenized-dark-theme)
* [Selenized Light Theme](#selenized-light-theme)
* [ThomCat Black](#thomcat-black)
- [Advanced](#advanced)
* [Workarounds](#workarounds)
* [build.py](#build.py)
### How to use themes
@ -80,11 +83,11 @@ Made by `@dhmf:dhdf.dev`
![Discord Dark Theme Screenshot](Discord/Discord-Dark/Discord-Dark-Theme.png)
## [Luxury Dark Theme](./Luxury/Luxury%20Dark.json)
## [Luxury Dark Theme](./Luxury/Luxury%20Dark/Luxury%20Dark.json)
Made by `@dhmf:dhdf.dev`
![Luxury Dark Theme Screenshot](./Luxury/Luxury%20Dark.png)
![Luxury Dark Theme Screenshot](./Luxury/Luxury%20Dark/Luxury%20Dark.png)
## [Nord Dark Theme](https://raw.githubusercontent.com/aaronraimist/riot-web-themes/master/Nord/Nord%20Dark/Nord%20Dark.json)
@ -129,7 +132,9 @@ Made by `@swedneck:hielle.com`
# Workarounds
# Advanced
## Workarounds
Riot's theme implementation is fairly limited so custom themes might introduce some odd elements. For example, when using ThomCat Black, the selected reaction 'pill' is outlined in green since Riot doesn't give us a variable to control the color that is used there.
@ -145,3 +150,7 @@ sudo -u <nginx/apache_user> cp /tmp/theme-dark-custom.css /<riot_directory>/bund
The results:
![pill_after](images/Pill2.png)
## build.py
There is a [build.py](./build.py) python file which takes all the themes and
outputs it to a file as an array of JSON. Simply execute it in this directory.

View file

@ -16,7 +16,7 @@
"timeline-background-color": "#2d5b69",
"timeline-text-color": "#FFFFFF",
"timeline-text-secondary-color": "#72898f",
"timeline-highlights-color": "#bf616a",
"timeline-highlights-color": "#184956",
"reaction-row-button-selected-bg-color": "#4695f7"
}
}

View file

@ -16,7 +16,7 @@
"timeline-background-color": "#fbf3db",
"timeline-text-color": "#000000",
"timeline-text-secondary-color": "#777777",
"timeline-highlights-color": "#bf616a",
"timeline-highlights-color": "#ece3cc",
"reaction-row-button-selected-bg-color": "#4695f7"
}
}

67
build.py Executable file
View file

@ -0,0 +1,67 @@
#!/usr/bin/python
# This takes all the themes and puts it in one file
import json
import os
OUTPUT = "./output.json"
BLACKLIST = [
".git",
"images"
]
if __name__ == '__main__':
result = []
json_paths = []
# 1. Let's recursively look for all the JSON files
# root_dirs = ["Discord", "Geeko Dark", etc...]
root = os.listdir("./")
for root_dir in root:
is_dir = os.path.isdir(f"./{root_dir}")
if root_dir in BLACKLIST or not is_dir:
continue
# if root_dir is "Discord" then deep_dirs is
# deep_dirs = ["Discord-Dark"]
# ./Discord
# └── Discord-Dark
# ├── Discord-Dark-Theme.json
# └── Discord-Dark-Theme.png
deep_dirs = os.listdir(f"./{root_dir}")
for deep in deep_dirs:
current_path = f"./{root_dir}/{deep}"
is_dir = os.path.isdir(current_path)
if is_dir:
files = os.listdir(current_path)
for file in files:
current_path = f"./{root_dir}/{deep}/{file}"
if file.lower().endswith(".json"):
json_paths.append(current_path)
print(f"Added {file}")
elif deep.lower().endswith(".json"):
json_paths.append(current_path)
print(f"Added {file}")
# 2. Now let's parse all the JSON files
for json_path in json_paths:
with open(json_path, 'r') as file:
parsed = json.load(file)
result.append(parsed)
# 3. Finally output the themes as a JSON array
with open(OUTPUT, 'w') as output:
output.write(
json.dumps(result, indent=2)
)
output.close()
print(f"Output: {OUTPUT}")