aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Rebert <[email protected]>2015-10-27 09:38:20 -0700
committerChris Rebert <[email protected]>2015-10-27 09:38:20 -0700
commitc3834b8d5aedf1c632da8b612c736eec25108100 (patch)
treed3fddc36c2ae73895cdaf1a6f346e804c27010a7
parent368eda788d66c5cd8b39a20878c3302f5e61b351 (diff)
parentdeeb74e321f8ba676dce8f13809c2aace0e0c537 (diff)
downloadbootstrap-c3834b8d5aedf1c632da8b612c736eec25108100.tar.xz
bootstrap-c3834b8d5aedf1c632da8b612c736eec25108100.zip
Merge pull request #18038 from twbs/fix-16947
Make heading class styles trump heading element styles
-rw-r--r--scss/_type.scss22
1 files changed, 16 insertions, 6 deletions
diff --git a/scss/_type.scss b/scss/_type.scss
index 183209898..1d55ccb2d 100644
--- a/scss/_type.scss
+++ b/scss/_type.scss
@@ -19,12 +19,22 @@ h6, .h6 {
margin-bottom: $headings-margin-bottom;
}
-h1, .h1 { font-size: $font-size-h1; }
-h2, .h2 { font-size: $font-size-h2; }
-h3, .h3 { font-size: $font-size-h3; }
-h4, .h4 { font-size: $font-size-h4; }
-h5, .h5 { font-size: $font-size-h5; }
-h6, .h6 { font-size: $font-size-h6; }
+h1 { font-size: $font-size-h1; }
+h2 { font-size: $font-size-h2; }
+h3 { font-size: $font-size-h3; }
+h4 { font-size: $font-size-h4; }
+h5 { font-size: $font-size-h5; }
+h6 { font-size: $font-size-h6; }
+
+// These declarations are kept separate from and placed after
+// the previous tag-based declarations so that the classes beat the tags in
+// the CSS cascade, and thus <h1 class="h2"> will be styled like an h2.
+.h1 { font-size: $font-size-h1; }
+.h2 { font-size: $font-size-h2; }
+.h3 { font-size: $font-size-h3; }
+.h4 { font-size: $font-size-h4; }
+.h5 { font-size: $font-size-h5; }
+.h6 { font-size: $font-size-h6; }
.lead {
font-size: $lead-font-size;