tildelog/lib/create_css.sh

52 lines
2.7 KiB
Bash
Raw Permalink Normal View History

2020-12-19 19:43:21 +00:00
#!/usr/bin/env bash
# Create the css file from scratch
declare css_include
2021-02-11 07:01:18 +00:00
2020-12-19 19:43:21 +00:00
create_css() {
# To avoid overwriting manual changes. However it is recommended that
# this function is modified if the user changes the blog.css file
2021-02-11 07:01:18 +00:00
((${#css_include} > 0)) && return || css_include=('main.css' 'blog.css')
if [[ ! -f blog.css ]]; then
2020-12-19 19:43:21 +00:00
# blog.css directives will be loaded after main.css and thus will prevail
echo '#title{font-size: x-large;}
a.ablack{color:black !important;}
li{margin-bottom:8px;}
ul,ol{margin-left:24px;margin-right:24px;}
#all_posts{margin-top:24px;text-align:center;}
.subtitle{font-size:small;margin:12px 0px;}
.content p{margin-left:24px;margin-right:24px;}
h1{margin-bottom:12px !important;}
#description{font-size:large;margin-bottom:12px;}
h3{margin-top:42px;margin-bottom:8px;}
h4{margin-left:24px;margin-right:24px;}
img{max-width:100%;}
#twitter{line-height:20px;vertical-align:top;text-align:right;font-style:italic;color:#333;margin-top:24px;font-size:14px;}' >blog.css
2020-12-19 19:43:21 +00:00
fi
# If there is a style.css from the parent page (i.e. some landing page)
# then use it. This directive is here for compatibility with my own
# home page. Feel free to edit it out, though it doesn't hurt
if [[ -f ../style.css ]] && [[ ! -f main.css ]]; then
ln -s "../style.css" "main.css"
2020-12-19 19:43:21 +00:00
elif [[ ! -f main.css ]]; then
echo 'body{font-family:Georgia,"Times New Roman",Times,serif;margin:0;padding:0;background-color:#F3F3F3;}
#divbodyholder{padding:5px;background-color:#DDD;width:100%;max-width:874px;margin:24px auto;}
#divbody{border:solid 1px #ccc;background-color:#fff;padding:0px 48px 24px 48px;top:0;}
.headerholder{background-color:#f9f9f9;border-top:solid 1px #ccc;border-left:solid 1px #ccc;border-right:solid 1px #ccc;}
.header{width:100%;max-width:800px;margin:0px auto;padding-top:24px;padding-bottom:8px;}
.content{margin-bottom:5%;}
.nomargin{margin:0;}
.description{margin-top:10px;border-top:solid 1px #666;padding:10px 0;}
h3{font-size:20pt;width:100%;font-weight:bold;margin-top:32px;margin-bottom:0;}
.clear{clear:both;}
#footer{padding-top:10px;border-top:solid 1px #666;color:#333333;text-align:center;font-size:small;font-family:"Courier New","Courier",monospace;}
a{text-decoration:none;color:#003366 !important;}
a:visited{text-decoration:none;color:#336699 !important;}
blockquote{background-color:#f9f9f9;border-left:solid 4px #e9e9e9;margin-left:12px;padding:12px 12px 12px 24px;}
blockquote img{margin:12px 0px;}
blockquote iframe{margin:12px 0px;}' >main.css
2020-12-19 19:43:21 +00:00
fi
}