Skip to content

Instantly share code, notes, and snippets.

@Cardosaum
Created October 12, 2020 18:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Cardosaum/a813008bf70d28154375d4643b21120a to your computer and use it in GitHub Desktop.
Save Cardosaum/a813008bf70d28154375d4643b21120a to your computer and use it in GitHub Desktop.
#!/bin/bash
set -euxo pipefail
# set path for default files
path="$1"
cd "$path"
ch () {
files=$(rg -t css -t svg -l "." $path)
sed -E -i "s/$1/$2/" $files
}
# set default colors
# you can find them all in the official specification site
# https://draculatheme.com/contribute/
background="#282a36"
currentline="#44475a"
foreground="#f8f8f2"
comment="#6272a4"
cyan="#8be9fd"
green="#50fa7b"
orange="#ffb86c"
pink="#ff79c6"
purple="#bd93f9"
red="#ff5555"
yellow="#f1fa8"
# deckbrowser
ch "\s#5CcC00;" " $green;"
ch "\s#FF935B;" " $orange;"
ch "\s#444;" " $currentline;"
ch "\s#e7e7e7;" " $foreground;"
ch "\s#29292B;" " $background;"
ch "\s#777;" " $comment;"
ch "\s#000;" " $background;"
ch "\s#77ccff\s" " $cyan "
ch "\s#aa5555;" " $red;"
ch "\s#3a3a3a;" " $currentline;"
ch "\s#454545;" " $background;"
# webview.css
ch "\s#00a;" " $green;"
ch "\s#222222;" " $comment;"
ch "\s#2f2f31;" " $background;"
ch "\s#555555\s" " $currentline "
ch "\s#646464;" " $comment;"
ch "\s#656565 " " $currentline "
ch "\s#656565;" " $currentline;"
ch "\s#77ccff;" " $cyan;"
ch "\s#848484;" " $comment;"
ch "\s#aaa;" " $comment;"
ch "\s#e5e5e5;" " $comment;"
ch "\sblack;" " $background;"
ch "\swhite;" " $foreground;"
# overview.css
ch "\s#ccc;" " $foreground;"
# reviewer.css
ch "\s#0f0;" " $green;"
ch "\s#f00;" " $red;"
ch "\s#fff;" " $foreground;"
ch "\s#414141;" " $comment;"
# _vars.scss
ch "\s#555555;" " $background;"
# svg images and buttons
ch "\s#808080" " $pink;"
ch "border-radius: 2px;" "border-radius: 20px;"
ch "border-radius: 3px;" "border-radius: 30px;"
ch "border-radius: 8px;" "border-radius: 80px;"
fd -a -e css -e scss "reviewer" | while read -r f; do
cat "$(dirname ${0})/anki-dracula-reviwer.css" >> "${f}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment