8000 fixes #5216: calculate heading sizes via math rather than fixed pixel… · rusongyu/bootstrap@af871d5 · GitHub
[go: up one dir, main page]

Skip to content

Commit af871d5

Browse files
committed
fixes twbs#5216: calculate heading sizes via math rather than fixed pixel amounts
1 parent c3ea955 commit af871d5

File tree

2 files changed

+31
-26
lines changed

2 files changed

+31
-26
lines changed

docs/assets/css/bootstrap.css

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ h6 {
655655
margin: 10px 0;
656656
font-family: inherit;
657657
font-weight: bold;
658-
line-height: 1;
658+
line-height: 20px;
659659
color: inherit;
660660
text-rendering: optimizelegibility;
661661
}
@@ -671,42 +671,42 @@ h6 small {
671671
color: #999999;
672672
}
673673

674-
h1 {
675-
font-size: 36px;
674+
h1,
675+
h2,
676+
h3 {
676677
line-height: 40px;
677678
}
678679

680+
h1 {
681+
font-size: 38.5px;
682+
}
683+
679684
h2 {
680-
font-size: 30px;
681-
line-height: 40px;
685+
font-size: 31.5px;
682686
}
683687

684688
h3 {
685-
font-size: 24px;
686-
line-height: 40px;
689+
font-size: 24.5px;
687690
}
688691

689692
h4 {
690-
font-size: 18px;
691-
line-height: 20px;
693+
font-size: 17.5px;
692694
}
693695

694696
h5 {
695697
font-size: 14px;
696-
line-height: 20px;
697698
}
698699

699700
h6 {
700-
font-size: 12px;
701-
line-height: 20px;
701+
font-size: 11.9px;
702702
}
703703

704704
h1 small {
705-
font-size: 24px;
705+
font-size: 24.5px;
706706
}
707707

708708
h2 small {
709-
font-size: 18px;
709+
font-size: 17.5px;
710710
}
711711

712712
h3 small {

less/type.less

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ h1, h2, h3, h4, h5, h6 {
5757
margin: (@baseLineHeight / 2) 0;
5858
font-family: @headingsFontFamily;
5959
font-weight: @headingsFontWeight;
60-
line-height: 1;
60+
line-height: @baseLineHeight;
6161
color: @headingsColor;
6262
text-rendering: optimizelegibility; // Fix the character spacing for headings
6363
small {
@@ -66,17 +66,22 @@ h1, h2, h3, h4, h5, h6 {
6666
color: @grayLight;
6767
}
6868
}
69-
h1 { font-size: 36px; line-height: 40px; }
70-
h2 { font-size: 30px; line-height: 40px; }
71-
h3 { font-size: 24px; line-height: 40px; }
72-
h4 { font-size: 18px; line-height: 20px; }
73-
h5 { font-size: 14px; line-height: 20px; }
74-
h6 { font-size: 12px; line-height: 20px; }
75-
76-
h1 small { font-size: 24px; }
77-
h2 small { font-size: 18px; }
78-
h3 small { font-size: 14px; }
79-
h4 small { font-size: 14px; }
69+
70+
h1,
71+
h2,
72+
h3 { line-height: @baseLineHeight * 2; }
73+
74+
h1 { font-size: @baseFontSize * 2.75; } // ~38px
75+
h2 { font-size: @baseFontSize * 2.25; } // ~32px
76+
h3 { font-size: @baseFontSize * 1.75; } // ~24px
77+
h4 { font-size: @baseFontSize * 1.25; } // ~18px
78+
h5 { font-size: @baseFontSize; }
79+
h6 { font-size: @baseFontSize * .85; } // ~12px
80+
81+
h1 small { font-size: @baseFontSize * 1.75; } // ~24px
82+
h2 small { font-size: @baseFontSize * 1.25; } // ~18px
83+
h3 small { font-size: @baseFontSize; }
84+
h4 small { font-size: @baseFontSize; }
8085

8186

8287
// Page header

0 commit comments

Comments
 (0)
0