blog/themes/modify_slick.sh

60 lines
2.6 KiB
Bash
Executable File

#!/bin/sh
if [ "$(basename ${PWD})" != "themes" ]; then
echo "cd to theme directory, please." >&2
exit 1
fi
mkdir -p tastytea/static/assets
for file in style.css style-compat.css; do
cp slick/static/assets/${file} tastytea/static/assets/${file}
# Remove fonts, save >400KiB (~92,5%)
sed -Ei 's/@font-face\{[^\}]+\}//g' tastytea/static/assets/${file}
# Increase font-size
sed -i 's/font-size:16px/font-size:18px/g' tastytea/static/assets/${file}
# Set maximum characters per line to 100
sed -i 's/body{margin:0}/body{max-width:100ch;margin:auto}/' tastytea/static/assets/${file}
# Add dark background to <code>
sed -i 's/$/p>code,td>code{background-color:#10111280}/' tastytea/static/assets/${file}
# Reduce margin above listing blocks
sed -i 's/$/div.listingblock pre{margin-top:0.1em}/' tastytea/static/assets/${file}
# Reduce margin between list items
sed -i 's/$/li>p{margin:0.1em;}/' tastytea/static/assets/${file}
# Style NOTE: (AsciiDoc)
sed -i 's/$/div.note>table,div.note td{border:0}/' tastytea/static/assets/${file}
sed -i 's/$/div.note td.icon{background-color:#282a2e;color:#b5bd68;border-radius:20%}/' tastytea/static/assets/${file}
sed -i 's/#1d1f21/#101112/g' tastytea/static/assets/${file} # Code Background
sed -i 's/#ffffff/#1d1f21/g' tastytea/static/assets/${file} # Background
sed -i 's/#fff/#1d1f21/g' tastytea/static/assets/${file} # Background
sed -i 's/#efefef/#282a2e/g' tastytea/static/assets/${file} # Current Line
sed -i 's/#eee/#282a2e/g' tastytea/static/assets/${file} # Current Line
sed -i 's/#d6d6d6/#373b41/g' tastytea/static/assets/${file} # Selection
sed -i 's/#4d4d4c/#c5c8c6/g' tastytea/static/assets/${file} # Foreground
sed -i 's/#8e908c/#969896/g' tastytea/static/assets/${file} # Comment
sed -i 's/#c82829/#cc6666/g' tastytea/static/assets/${file} # Red
sed -i 's/#f5871f/#de935f/g' tastytea/static/assets/${file} # Orange
sed -i 's/#eab700/#f0c674/g' tastytea/static/assets/${file} # Yellow
sed -i 's/#718c00/#b5bd68/g' tastytea/static/assets/${file} # Green
sed -i 's/#3e999f/#8abeb7/g' tastytea/static/assets/${file} # Aqua
sed -i 's/#4271ae/#81a2be/g' tastytea/static/assets/${file} # Blue
sed -i 's/#8959a8/#b294bb/g' tastytea/static/assets/${file} # Purple
sed -i 's/#000/#e2e0de/g' tastytea/static/assets/${file} # Some links
# Make CSS more readable
sed -i 's/}/}\n/g' tastytea/static/assets/${file}
sed -i 's/{/ {/g' tastytea/static/assets/${file}
sed -i 's/,/, /g' tastytea/static/assets/${file}
sed -i 's/;/; /g' tastytea/static/assets/${file}
done