From d8e82e2e8fd1ac421177107f4619db8f676813e8 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sat, 6 Feb 2016 13:32:53 -0800 Subject: [PATCH] document --- docs/content/reboot.md | 24 ++++++++++++++++++++++++ docs/content/typography.md | 7 ++++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/docs/content/reboot.md b/docs/content/reboot.md index d55230e59b..2c65e6e219 100644 --- a/docs/content/reboot.md +++ b/docs/content/reboot.md @@ -32,6 +32,30 @@ The `` and `` elements are updated to provide better page-wide defau - The `` also sets a global `font-family` and `line-height`. This is inherited later by some form elements to prevent font inconsistencies. - For safety, the `` has a declared `background-color`, defaulting to `#fff`. +## Native font stack + +The default web (Helvetica Neue, Helvetica, and Arial) fonts have been dropped in Bootstrap 4 and replaced with a "native font stack" for optimum text rendering on every device and OS. Read more about [native font stacks in this Smashing Magazine article](https://www.smashingmagazine.com/2015/11/using-system-ui-fonts-practical-guide/). + +{% highlight sass %} +$font-family-sans-serif: + // Safari for OS X and iOS (San Francisco) + -apple-system, + // Chrome for OS X (San Francisco) and Windows (Segoe UI) + BlinkMacSystemFont, + // Windows + "Segoe UI", + // Android + "Roboto", + // Linux distros + "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", + // Older Android + "Droid Sans", + // Basic web fallback + "Helvetica Neue", Arial, sans-serif !default; +{% endhighlight %} + +This `font-family` is applied to the `` and automatically inherited globally throughout Bootstrap. To switch the global `font-family`, update `$font-family-base` and recompile Bootstrap. + ## Headings and paragraphs All heading elements—e.g., `

`—and `

` are reset to have their `margin-top` removed. Headings have `margin-bottom: .5rem` added and paragraphs `margin-bottom: 1rem` for easy spacing. diff --git a/docs/content/typography.md b/docs/content/typography.md index 82f80a8a87..0456205840 100644 --- a/docs/content/typography.md +++ b/docs/content/typography.md @@ -15,9 +15,10 @@ Bootstrap includes simple and easily customized typography for headings, body te Bootstrap sets basic global display, typography, and link styles. Specifically, we: -- Use `$body-bg` to set a `background-color` on the `` (`#fff` by default) -- Use the `$font-family-base`, `$font-size-base`, and `$line-height-base` attributes as our typographic base -- Set the global link color via `$link-color` and apply link underlines only on `:hover` +- Use a [native font stack](/content/reboot/#native-font-stack) that selects the best `font-family` for each OS and device. +- Use the `$font-family-base`, `$font-size-base`, and `$line-height-base` attributes as our typographic base applied to the ``. +- Set the global link color via `$link-color` and apply link underlines only on `:hover`. +- Use `$body-bg` to set a `background-color` on the `` (`#fff` by default). These styles can be found within `_reboot.scss`, and the global variables are defined in `_variables.scss`.