aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorZhiming Wang <zmwangx@gmail.com>2016-07-10 11:30:52 +0800
committerZhiming Wang <zmwangx@gmail.com>2016-07-10 11:30:52 +0800
commit2dd20788f37f7c4f25928978810ea968fd57c427 (patch)
tree81c14f8253fb6400912873df5ab2f3daa51e3248 /source
parent2e8d9eae4e2119bd277150e5c2cef953d50d2eb8 (diff)
downloadmy_new_personal_website-2dd20788f37f7c4f25928978810ea968fd57c427.tar.xz
my_new_personal_website-2dd20788f37f7c4f25928978810ea968fd57c427.zip
Add Chinese typography features
Diffstat (limited to 'source')
-rw-r--r--source/css/print-chinese-article.css5
-rw-r--r--source/css/theme-chinese-article.css66
-rw-r--r--source/css/theme.css10
-rw-r--r--source/template.html6
4 files changed, 86 insertions, 1 deletions
diff --git a/source/css/print-chinese-article.css b/source/css/print-chinese-article.css
new file mode 100644
index 00000000..15e663da
--- /dev/null
+++ b/source/css/print-chinese-article.css
@@ -0,0 +1,5 @@
+footer {
+ width: 0;
+ height: 0;
+ visibility: hidden;
+}
diff --git a/source/css/theme-chinese-article.css b/source/css/theme-chinese-article.css
new file mode 100644
index 00000000..8e91477b
--- /dev/null
+++ b/source/css/theme-chinese-article.css
@@ -0,0 +1,66 @@
+h1 {
+ font-size: 140%;
+}
+
+h2 {
+ font-size: 110%;
+}
+
+h3 {
+ font-size: 100%;
+}
+
+p {
+ margin-top: 0;
+ margin-bottom: 0;
+ text-indent: 2em;
+ line-height: 1.3em;
+}
+
+blockquote {
+ margin: 1em 2em 1em 2em;
+ padding: 0;
+ border: none;
+ font-style: normal;
+}
+
+article a {
+ text-decoration: none;
+ color: #777;
+}
+
+sup {
+ margin: 0;
+}
+
+.en p, .en li {
+ text-indent: 0;
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+}
+
+.en blockquote {
+ font-style: italic;
+}
+
+.date-tag {
+ text-align: right;
+}
+
+.poem {
+ text-align: center;
+}
+
+.undent, .footnotes p {
+ text-indent: 0;
+}
+
+.skip {
+ margin-bottom: 1em;
+}
+
+.poem p {
+ margin-top: 1em;
+ margin-bottom: 1em;
+ text-indent: 0;
+}
diff --git a/source/css/theme.css b/source/css/theme.css
index b81f989d..cf1af58f 100644
--- a/source/css/theme.css
+++ b/source/css/theme.css
@@ -1,6 +1,14 @@
body {
color: #000;
- font-family: Times, "Times New Roman", serif;
+ font-family: Times, "Times New Roman",
+ /* Chinese fonts */
+ "Kaiti SC", /* macOS */
+ KaiTi, /* Windows (simkai.ttf, not always included despite
+ https://www.microsoft.com/typography/fonts/product.aspx?PID=161
+ https://www.microsoft.com/typography/fonts/product.aspx?PID=164) */
+ "Microsoft YaHei", /* Windows */
+ "Heiti SC", /* iOS */
+ serif;
font-size: 16px;
-webkit-font-smoothing: antialiased;
margin: 100px 0;
diff --git a/source/template.html b/source/template.html
index eac772c4..5c7895b9 100644
--- a/source/template.html
+++ b/source/template.html
@@ -18,10 +18,16 @@ $endif$
<link href="/css/theme-wide.css" media="only screen and (min-width: 1441px)" rel="stylesheet" type="text/css"/>
<link href="/css/theme-narrow.css" media="only screen and (max-width: 1023px)" rel="stylesheet" type="text/css"/>
<link href="/css/theme-ultranarrow.css" media="only screen and (max-width: 500px)" rel="stylesheet" type="text/css"/>
+$if(chinese_article)$
+ <link href="/css/theme-chinese-article.css" rel="stylesheet" type="text/css"/>
+$endif$
$if(highlighting-css)$
<link href="/css/highlight.css" media="all" rel="stylesheet" type="text/css"/>
$endif$
<link href="/css/print.css" media="print" rel="stylesheet" type="text/css"/>
+$if(chinese_article)$
+ <link href="/css/print-chinese-article.css" media="print" rel="stylesheet" type="text/css"/>
+$endif$
</head>
<body>
<nav class="nav">