Skip to content

Commit 8b7a8bd

Browse files
committed
feat(typography): use consistent fonts
It also removes code that we do not need from bootstrap source files. Update #429
1 parent f4bee2f commit 8b7a8bd

File tree

6 files changed

+62
-83
lines changed

6 files changed

+62
-83
lines changed

static/bootstrap/code.less

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
code,
88
pre {
99
padding: 0 3px 2px;
10-
#font > #family > .monospace;
1110
font-size: @baseFontSize - 2;
1211
color: @grayDark;
1312
.border-radius(3px);

static/bootstrap/type.less

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -53,51 +53,6 @@ a.text-success:focus { color: darken(@successText, 10%); }
5353
.text-center { text-align: center; }
5454

5555

56-
// Headings
57-
// -------------------------
58-
59-
h1, h2, h3, h4, h5, h6 {
60-
margin: (@baseLineHeight / 2) 0;
61-
font-family: @headingsFontFamily;
62-
font-weight: @headingsFontWeight;
63-
line-height: @baseLineHeight;
64-
color: @headingsColor;
65-
text-rendering: optimizelegibility; // Fix the character spacing for headings
66-
small {
67-
font-weight: normal;
68-
line-height: 1;
69-
color: @grayLight;
70-
}
71-
}
72-
73-
h1,
74-
h2,
75-
h3 { line-height: @baseLineHeight * 2; }
76-
77-
h1 { font-size: @baseFontSize * 2.75; } // ~38px
78-
h2 { font-size: @baseFontSize * 2.25; } // ~32px
79-
h3 { font-size: @baseFontSize * 1.75; } // ~24px
80-
h4 { font-size: @baseFontSize * 1.25; } // ~18px
81-
h5 { font-size: @baseFontSize; }
82-
h6 { font-size: @baseFontSize * 0.85; } // ~12px
83-
84-
h1 small { font-size: @baseFontSize * 1.75; } // ~24px
85-
h2 small { font-size: @baseFontSize * 1.25; } // ~18px
86-
h3 small { font-size: @baseFontSize; }
87-
h4 small { font-size: @baseFontSize; }
88-
89-
90-
// Page header
91-
// -------------------------
92-
93-
.page-header {
94-
padding-bottom: (@baseLineHeight / 2) - 1;
95-
margin: @baseLineHeight 0 (@baseLineHeight * 1.5);
96-
border-bottom: 1px solid @grayLighter;
97-
}
98-
99-
100-
10156
// Lists
10257
// --------------------------------------------------
10358

static/css/admonition.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ div.note p.admonition-title:before,
103103
div.hint p.admonition-title:before,
104104
div.tip p.admonition-title:before {
105105
display: inline-block;
106-
font-family: FontAwesome;
107106
font-style: normal;
108107
font-weight: normal;
109108
line-height: 1;

static/css/blockquote.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ blockquote {
88
padding: 0.1rem 1.2rem;
99
position: relative;
1010
width: 80%;
11-
& p {
12-
font-family: "Helvetica Neue", Helvetica, Arial, Sans-Serif;
13-
font-weight: 400;
14-
}
1511
&:before,
1612
&:after {
1713
color: dimgray;

static/css/elegant.css

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ a {
4747
hr {
4848
border-width: 3px;
4949
}
50-
/* site title */
51-
.site-name {
52-
font-family: "Monaco", "Inconsolata", "Andale Mono", "Lucida Console",
53-
"Bitstream Vera Sans Mono", "Courier New", Courier, Monospace;
54-
}
5550
/* Top navigation menu */
5651
.top-menu li a {
5752
font-weight: bold;
@@ -125,7 +120,6 @@ table.highlighttable tbody > tr:nth-child(odd) > td {
125120
}
126121
/* Tags */
127122
.list-of-tags {
128-
font-family: "Helvetica Neue", Helvetica, Arial, Sans-Serif;
129123
list-style: none;
130124
margin: 0;
131125
overflow: hidden;
@@ -151,30 +145,18 @@ table.highlighttable tbody > tr:nth-child(odd) > td {
151145
float: none;
152146
line-height: 28px;
153147
}
154-
.tag-title {
155-
font-family: "Trebuchet MS", Trebuchet, "Lucida Sans Unicode", "Lucida Grande",
156-
"Lucida Sans", Arial, Sans-Serif;
157-
}
158148
.articles-in-tag li {
159149
font: 1.1em/1.6 "Trebuchet MS", Trebuchet, "Lucida Sans Unicode",
160150
"Lucida Grande", "Lucida Sans", Arial, Sans-Serif;
161151
}
162152
/* Article */
163153
.article-content,
164154
div.recent-posts p {
165-
font: 1.2em/1.6 "PT Serif", Georgia, "Times New Roman", Times, Serif;
166155
text-align: justify;
167156
}
168157
.article-content {
169158
max-width: 50em;
170159
}
171-
.article-content p,
172-
div.recent-posts p {
173-
font-size: inherit;
174-
font-variant: normal;
175-
line-height: 1.6;
176-
text-transform: none;
177-
}
178160
.article-content p {
179161
margin: 20px 0;
180162
}
@@ -211,8 +193,6 @@ div.recent-posts p {
211193
.page-header {
212194
border-bottom: 2px solid maroon;
213195
color: maroon;
214-
margin: 10px 10px 20px;
215-
padding: 5px;
216196
}
217197
.page-header h1 {
218198
border: none;
@@ -271,7 +251,6 @@ ul.list-articles-category {
271251
ul.list-articles-category li time {
272252
color: #8f8f8f;
273253
display: inline-block;
274-
font: 0.9em "PT Sans", "Helvetica Neue", Arial, Sans-Serif;
275254
width: 7em;
276255
}
277256
a.category-link {
@@ -280,11 +259,6 @@ a.category-link {
280259
a.category-link:hover {
281260
text-decoration: none;
282261
}
283-
a.list-of-categories {
284-
font-family: "Trebuchet MS", Trebuchet, "Lucida Sans Unicode", "Lucida Grande",
285-
"Lucida Sans", Arial, Sans-Serif;
286-
font-size: 1.1em;
287-
}
288262
a.list-of-categories:hover {
289263
background-color: #08c;
290264
border-radius: var(--border-radius);
@@ -445,8 +419,6 @@ a#allposts:hover {
445419
border-radius: var(--border-radius);
446420
border: 1px solid #e1e1e8;
447421
color: #d14;
448-
font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
449-
font-size: 12px;
450422
padding: 2px 4px;
451423
white-space: nowrap;
452424
}

static/css/typography.css

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,43 @@
44
/* Headings that are not inside article. Like in sidebar are "others" */
55
--heading-others-line-height: 1.3rem;
66
--heading-others-h4-font-size: 1.1rem;
7+
--sansFontFamily: "PT Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
8+
--monoFontFamily: "PT Mono", Monaco, Menlo, Consolas, "Courier New", monospace;
9+
--serifFontFamily: "PT Serif", Georgia, "Times New Roman", Times, serif;
10+
--serifHeadingFontFamily: "PT Serif Caption", Baskerville, Garamond, Georgia,
11+
"DejaVu Serif", "Times New Roman", Times, serif;
712
}
813
h1,
914
h2,
1015
h3,
1116
h4,
1217
h5,
13-
h6 {
14-
font-family: Baskerville, Garamond, Georgia, "DejaVu Serif", "Times New Roman",
15-
Times, Serif;
18+
h6,
19+
.page-header {
1620
font-weight: normal;
1721
margin: 10px 0px;
1822
text-align: left;
1923
& small {
2024
font-style: italic;
2125
}
2226
}
27+
header.page-header h1 {
28+
font-family: var(--serifHeadingFontFamily);
29+
}
30+
h1,
31+
h2,
32+
h3,
33+
h4,
34+
h5,
35+
h6,
36+
.tag-title,
37+
.list-of-tags,
38+
a.list-of-categories,
39+
ul.list-articles-category li time {
40+
font-family: var(--sansFontFamily);
41+
}
2342
h1 {
24-
font-size: 2.5rem;
43+
font-size: 2.4rem;
2544
}
2645
h2 {
2746
font-size: 2.2rem;
@@ -101,3 +120,42 @@ nav h4 {
101120
font-size: var(--heading-others-h4-font-size);
102121
line-height: var(--heading-others-line-height);
103122
}
123+
/* code */
124+
code,
125+
pre,
126+
.literal, /* reST */
127+
.site-name {
128+
/*Site title */
129+
font-family: var(--monoFontFamily);
130+
}
131+
/* code */
132+
code,
133+
pre,
134+
.literal /* reST */ {
135+
font-size: 0.9rem;
136+
}
137+
.site-name {
138+
font-size: 1.5rem;
139+
}
140+
/* article */
141+
.article-content,
142+
div.recent-posts p {
143+
font-size: 1.125rem;
144+
font-family: var(--serifFontFamily);
145+
font-weight: 400;
146+
line-height: 1.6;
147+
text-transform: none;
148+
}
149+
/* blockquotes */
150+
blockquote {
151+
& p {
152+
font-family: var(--sansFontFamily);
153+
font-weight: 400;
154+
}
155+
}
156+
a.list-of-categories {
157+
font-size: 1.1rem;
158+
}
159+
ul.list-articles-category li time {
160+
font-size: 0.7rem;
161+
}

0 commit comments

Comments
 (0)