語法:font-family:value / font:value / f:value
範例:font-family:Arial / font:serif / f:mono
當需要對某個元素指定字型時,你可以使用 font-family。
<!-- 使用一種字體,思源黑體 Noto Sans TC -->
<div class="font-family:Noto|Sans|TC"></div>
<!-- 依序嘗試套用三種字體 Roboto, Helvetica Neue, Arial -->
<div class="font-family:Roboto,Helvetica|Neue,Arial"></div>
你也可以使用簡寫 font 或 f 語法來進行設定官方預設的字型,目前共有下列三種類別可以使用。
| Master CSS 類別 | 產生的 CSS 規則 |
|---|---|
| font:serif | font-family: ui-serif, Georgia, Cambria, Times New Roman, Times, serif |
| font:mono | font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace |
| font:sans | font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji |

font 或 f 語法寫起來就像下面這樣:
<div class="font:serif">Aa</div>
<div class="font:mono">Aa</div>
<div class="font:sans">Aa</div>
<div class="f:serif">Aa</div>
<div class="f:mono">Aa</div>
<div class="f:sans">Aa</div>
這邊小提醒大家,因為 Masrer CSS 的簡寫 font 與原生 CSS 屬性 font 可能存在歧異,所以當你使用 font 撰寫屬性,除了下列官方預設或自訂類別會對應至字型家族 font-family,其餘都視為原生 CSS 屬性 font 的屬性值。
語法:font-size:size / font:size / f:size
範例:font-size:16px / font:1rem / f:16
當需要設定某個元素字體大小時,你可以使用 font-size,當你使用 font 或 f 屬性值設定為數值尺寸時,Master CSS 會自動的產生出 font-size 的樣式規則。
<div class="font-size:16px">Aa</div>
<div class="font:1rem">Aa</div>
<div class="f:16">Aa</div>
語法:font-weight:weight / font:weight / f:weight
範例:font-weight:600 / font:normal / f:bold
當需要設定某個元素字體粗細、字重時,你可以使用 font-weight。
<div class="font-weight:normal">Aa</div>
<div class="font-weight:600">Aa</div>
<div class="font-weight:bold">Aa</div>
你也可以使用簡寫 font 或 f 語法,當屬性值為下列官方預設的類別時,Master CSS 會自動的產生出 font-weight 的樣式規則。
| 類別 | 產生的規則 |
|---|---|
| font:lighter | font-weight: lighter |
| font:bolder | font-weight: bolder |
| font:thin | font-weight: 100 |
| font:extralight | font-weight: 200 |
| font:light | font-weight: 300 |
| font:regular | font-weight: 400 |
| font:medium | font-weight: 500 |
| font:semibold | font-weight: 600 |
| font:bold | font-weight: 700 |
| font:extrabold | font-weight: 800 |
| font:heavy | font-weight: 900 |
更多字體(Font)相關的語法可以參考官網。