From: Mark Otto Date: Sun, 18 Jun 2017 04:19:36 +0000 (-0700) Subject: Set explicit text-align on element so we can use inherit to override the defau... X-Git-Tag: v4.0.0-beta.2~443 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09019a8ecdccf61b52681dec3376a88509b4e6a3;p=thirdparty%2Fbootstrap.git Set explicit text-align on element so we can use inherit to override the default text-align value --- diff --git a/docs/4.0/content/reboot.md b/docs/4.0/content/reboot.md index 7565bb41a7..f42332874e 100644 --- a/docs/4.0/content/reboot.md +++ b/docs/4.0/content/reboot.md @@ -24,7 +24,7 @@ The `` and `` elements are updated to provide better page-wide defau - The `box-sizing` is globally set on every element—including `*:before` and `*:after`, to `border-box`. This ensures that the declared width of element is never exceeded due to padding or border. - No base `font-size` is declared on the ``, but `16px` is assumed (the browser default). `font-size: 1rem` is applied on the `` for easy responsive type-scaling via media queries while respecting user preferences and ensuring a more accessible approach. -- The `` also sets a global `font-family` and `line-height`. This is inherited later by some form elements to prevent font inconsistencies. +- The `` also sets a global `font-family`, `line-height`, and `text-align`. 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 diff --git a/scss/_reboot.scss b/scss/_reboot.scss index 33fc2d660a..2adedda60d 100644 --- a/scss/_reboot.scss +++ b/scss/_reboot.scss @@ -48,6 +48,8 @@ article, aside, dialog, figcaption, figure, footer, header, hgroup, main, nav, s // // 1. Remove the margin in all browsers. // 2. As a best practice, apply a default `background-color`. +// 3. Set an explicit initial text-align value so that we can later use the +// the `inherit` value on things like `` elements. body { margin: 0; // 1 @@ -56,6 +58,7 @@ body { font-weight: $font-weight-base; line-height: $line-height-base; color: $body-color; + text-align: left; // 3 background-color: $body-bg; // 2 } @@ -304,8 +307,9 @@ caption { } th { - // Matches default `` alignment - text-align: left; + // Matches default `` alignment by inheriting from the ``, or the + // closest parent with a set `text-align`. + text-align: inherit; }