han-css
Version:
The CSS typography framework optimised for Hanzi
85 lines (76 loc) • 1.91 kB
text/stylus
// Root
// ------
{$han-root}
han-typeface-by-lang(sans, true)
$han-ligature, $han-no-locl
[lang^='zh'],
[lang*='Hant'],
[lang='zh-TW'],
[lang='zh-HK']
$han-sans-hant, $han-no-locl
.no-unicoderange &
$han-sans-hant-nu
[lang*='Hans'],
[lang='zh-CN']
$han-sans-hans, $han-no-locl
.no-unicoderange &
$han-sans-hans-nu
[lang^='ja']
$han-sans-ja
.no-unicoderange &
$han-sans-ja-nu
// Sections & grouping content
// -----------------------------
// * Different typefaces in different situations.
// *
blockquote
{$han-article} &
han-typeface-by-lang(cursive)
figure &
{$han-article} &
han-typeface-by-lang(serif)
// Text-level semantics
// ----------------------
// * Importance in articles should be in sans-serif
// * (opinionated).
// *
{$han-article} strong
han-typeface-by-lang(sans)
$han-no-locl
// * Correct Chinese monospace typeface issue in WebKit.
// *
code,
kbd,
samp,
pre
han-typeface-by-lang(mono)
$han-no-locl
// * Fonts for alternative voice and variable
// * in different situations.
i,
var
han-typeface-by-lang(cursive-italic)
font-style: inherit
// 1
{$han-article} blockquote &
han-typeface-by-lang(sans-italic)
$han-no-locl
// * 1. Use `Zhuyin Kaiti` for non-checked tones.
// * 2. Zhuyin: checked tone ligatures (方言音符號入聲連字).
// * 3. Romanisation: checked tone ligatures (拉丁字母入聲連字).
// *
ruby,
h-ruby
h-zhuyin,
h-zhuyin h-diao
// 1, 2
$han-ligature
.no-unicoderange &
font-family: "Zhuyin Kaiti", cursive, serif
h-diao
font-family: "Zhuyin Kaiti", cursive, serif
&.romanization rt,
[annotation] rt
// 3
$han-ligature
font-family: "Romanization Sans", $han-sans, han-typeface("Han Heiti", $han-glyph-set-hant, $han-sans-zh), sans-serif