LoginSignup
21
20

More than 5 years have passed since last update.

CSSでSan Franciscoフォントを指定する

Posted at

iOS9やapple watch、MacOSX El Capitan等で採用されているシステムフォントのSan Franciscoですが
現在のところCSSではそのままfont-familyに指定しても表示されません。

font-familyの指定方法

.target {
  font-family: -apple-system, 'BlinkMacSystemFont', '.SFNSDisplay-Regular', sans-serif;
}

-apple-systemだけではchromeなどで表示されないのでBlinkMacSystemFontも併記します。
また一部記号が正常に表示されないこともあるので気になる場合は.SFNSDisplay-Regularも指定してください。
最後のsans-serifSan Franciscoフォントが無い場合のフォールバックです。
必要な場合はsans-serifの前にその他のフォントを任意で指定してください。

参考

How to use Apple's new San Francisco font on a webpage

21
20
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
21
20