Skip to content

Commit d5cfca5

Browse files
committed
Override fonts using Fomantic config
Saves is from doing it manually and saves a few CSS bytes.
1 parent f719e2e commit d5cfca5

File tree

3 files changed

+24
-66
lines changed

3 files changed

+24
-66
lines changed
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
@fontName : 'Roboto';
1+
/* https://github.com/fomantic/Fomantic-UI/blob/develop/src/themes/default/globals/site.variables */
2+
3+
@headerFont: var(--fonts-regular);
4+
@pageFont: var(--fonts-regular);

web_src/fomantic/build/semantic.css

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
.ui.accordion .title:not(.ui) {
4545
padding: 0.5em 0;
46-
font-family: 'Roboto', 'Helvetica Neue', Arial, Helvetica, sans-serif;
46+
font-family: var(--fonts-regular);
4747
font-size: 1em;
4848
color: rgba(0, 0, 0, 0.87);
4949
}
@@ -423,7 +423,7 @@
423423
vertical-align: baseline;
424424
background: #E0E1E2 none;
425425
color: rgba(0, 0, 0, 0.6);
426-
font-family: 'Roboto', 'Helvetica Neue', Arial, Helvetica, sans-serif;
426+
font-family: var(--fonts-regular);
427427
margin: 0 0.25em 0 0;
428428
padding: 0.78571429em 1.5em 0.78571429em;
429429
text-transform: none;
@@ -5179,7 +5179,7 @@
51795179
.ui.card > .content > .header {
51805180
display: block;
51815181
margin: '';
5182-
font-family: 'Roboto', 'Helvetica Neue', Arial, Helvetica, sans-serif;
5182+
font-family: var(--fonts-regular);
51835183
color: rgba(0, 0, 0, 0.85);
51845184
}
51855185

@@ -7619,7 +7619,7 @@ a.inverted.ui.card:hover,
76197619
/* Text Container */
76207620

76217621
.ui.text.container {
7622-
font-family: 'Roboto', 'Helvetica Neue', Arial, Helvetica, sans-serif;
7622+
font-family: var(--fonts-regular);
76237623
max-width: 700px;
76247624
line-height: 1.5;
76257625
font-size: 1.14285714rem;
@@ -10723,7 +10723,7 @@ select.ui.dropdown {
1072310723
.ui.form input[type="text"],
1072410724
.ui.form input[type="file"],
1072510725
.ui.form input[type="url"] {
10726-
font-family: 'Roboto', 'Helvetica Neue', Arial, Helvetica, sans-serif;
10726+
font-family: var(--fonts-regular);
1072710727
margin: 0;
1072810728
outline: none;
1072910729
-webkit-appearance: none;
@@ -10755,7 +10755,7 @@ select.ui.dropdown {
1075510755
box-shadow: 0 0 0 0 transparent inset;
1075610756
transition: color 0.1s ease, border-color 0.1s ease;
1075710757
font-size: 1em;
10758-
font-family: 'Roboto', 'Helvetica Neue', Arial, Helvetica, sans-serif;
10758+
font-family: var(--fonts-regular);
1075910759
line-height: 1.2857;
1076010760
resize: vertical;
1076110761
}
@@ -14784,7 +14784,7 @@ select.ui.dropdown {
1478414784
border: none;
1478514785
margin: calc(2rem - 0.1428571428571429em) 0 1rem;
1478614786
padding: 0 0;
14787-
font-family: 'Roboto', 'Helvetica Neue', Arial, Helvetica, sans-serif;
14787+
font-family: var(--fonts-regular);
1478814788
font-weight: bold;
1478914789
line-height: 1.28571429em;
1479014790
text-transform: none;
@@ -24986,7 +24986,7 @@ img.ui.bordered.image {
2498624986
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
2498724987
text-align: left;
2498824988
line-height: 1.21428571em;
24989-
font-family: 'Roboto', 'Helvetica Neue', Arial, Helvetica, sans-serif;
24989+
font-family: var(--fonts-regular);
2499024990
padding: 0.67857143em 1em;
2499124991
background: #FFFFFF;
2499224992
border: 1px solid rgba(34, 36, 38, 0.15);
@@ -25868,7 +25868,7 @@ img.ui.bordered.image {
2586825868
.ui.items > .item > .content > .header {
2586925869
display: inline-block;
2587025870
margin: -0.21425em 0 0;
25871-
font-family: 'Roboto', 'Helvetica Neue', Arial, Helvetica, sans-serif;
25871+
font-family: var(--fonts-regular);
2587225872
font-weight: bold;
2587325873
color: rgba(0, 0, 0, 0.85);
2587425874
}
@@ -28905,7 +28905,7 @@ ol.ui.list ol li,
2890528905
.ui.list > .item .header {
2890628906
display: block;
2890728907
margin: 0;
28908-
font-family: 'Roboto', 'Helvetica Neue', Arial, Helvetica, sans-serif;
28908+
font-family: var(--fonts-regular);
2890928909
font-weight: bold;
2891028910
color: rgba(0, 0, 0, 0.87);
2891128911
}
@@ -30779,7 +30779,7 @@ ol.ui.suffixed.list li:before,
3077930779
.ui.menu {
3078030780
display: flex;
3078130781
margin: 1rem 0;
30782-
font-family: 'Roboto', 'Helvetica Neue', Arial, Helvetica, sans-serif;
30782+
font-family: var(--fonts-regular);
3078330783
background: #FFFFFF;
3078430784
font-weight: normal;
3078530785
border: 1px solid rgba(34, 36, 38, 0.15);
@@ -33232,7 +33232,7 @@ Floated Menu / Item
3323233232

3323333233
.ui.message .header {
3323433234
display: block;
33235-
font-family: 'Roboto', 'Helvetica Neue', Arial, Helvetica, sans-serif;
33235+
font-family: var(--fonts-regular);
3323633236
font-weight: bold;
3323733237
margin: -0.14285714em 0 0 0;
3323833238
}
@@ -33958,7 +33958,7 @@ Floated Menu / Item
3395833958

3395933959
.ui.modal > .header {
3396033960
display: block;
33961-
font-family: 'Roboto', 'Helvetica Neue', Arial, Helvetica, sans-serif;
33961+
font-family: var(--fonts-regular);
3396233962
background: #FFFFFF;
3396333963
margin: 0;
3396433964
padding: 1.25rem 1.5rem;
@@ -34747,7 +34747,7 @@ Floated Menu / Item
3474734747

3474834748
.ui.popup > .header {
3474934749
padding: 0;
34750-
font-family: 'Roboto', 'Helvetica Neue', Arial, Helvetica, sans-serif;
34750+
font-family: var(--fonts-regular);
3475134751
font-size: 1.14285714em;
3475234752
line-height: 1.2;
3475334753
font-weight: bold;
@@ -37054,7 +37054,7 @@ template {
3705437054

3705537055
.ui.search > .results .result .title {
3705637056
margin: -0.14285714em 0 0;
37057-
font-family: 'Roboto', 'Helvetica Neue', Arial, Helvetica, sans-serif;
37057+
font-family: var(--fonts-regular);
3705837058
font-weight: bold;
3705937059
font-size: 1em;
3706037060
color: rgba(0, 0, 0, 0.85);
@@ -37080,7 +37080,7 @@ template {
3708037080
}
3708137081

3708237082
.ui.search > .results > .message .header {
37083-
font-family: 'Roboto', 'Helvetica Neue', Arial, Helvetica, sans-serif;
37083+
font-family: var(--fonts-regular);
3708437084
font-size: 1rem;
3708537085
font-weight: bold;
3708637086
color: rgba(0, 0, 0, 0.87);
@@ -37288,7 +37288,7 @@ template {
3728837288
width: 100px;
3728937289
white-space: nowrap;
3729037290
background: transparent;
37291-
font-family: 'Roboto', 'Helvetica Neue', Arial, Helvetica, sans-serif;
37291+
font-family: var(--fonts-regular);
3729237292
font-size: 1em;
3729337293
padding: 0.4em 1em;
3729437294
font-weight: bold;
@@ -39034,7 +39034,7 @@ body {
3903439034
overflow-x: hidden;
3903539035
min-width: 320px;
3903639036
background: #FFFFFF;
39037-
font-family: 'Roboto', 'Helvetica Neue', Arial, Helvetica, sans-serif;
39037+
font-family: var(--fonts-regular);
3903839038
font-size: 14px;
3903939039
line-height: 1.4285em;
3904039040
color: rgba(0, 0, 0, 0.87);
@@ -39049,7 +39049,7 @@ h2,
3904939049
h3,
3905039050
h4,
3905139051
h5 {
39052-
font-family: 'Roboto', 'Helvetica Neue', Arial, Helvetica, sans-serif;
39052+
font-family: var(--fonts-regular);
3905339053
line-height: 1.28571429em;
3905439054
margin: calc(2rem - 0.1428571428571429em) 0 1rem;
3905539055
font-weight: bold;

web_src/less/_base.less

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -100,52 +100,7 @@
100100
url("../fonts/noto-color-emoji/NotoColorEmoji.ttf") format("truetype");
101101
}
102102

103-
/* Most of these selectors override fomantic ui */
104-
body,
105-
textarea,
106-
h1,
107-
h2,
108-
h3,
109-
h4,
110-
h5,
111-
.markdown:not(code),
112-
.ui.accordion .title:not(.ui),
113-
.ui.button,
114-
.ui.card > .content > .header.ui.card > .content > .header,
115-
.ui.category.search > .results .category > .name,
116-
.ui.form input:not([type]),
117-
.ui.form input[type="date"],
118-
.ui.form input[type="datetime-local"],
119-
.ui.form input[type="email"],
120-
.ui.form input[type="file"],
121-
.ui.form input[type="number"],
122-
.ui.form input[type="password"],
123-
.ui.form input[type="search"],
124-
.ui.form input[type="tel"],
125-
.ui.form input[type="text"],
126-
.ui.form input[type="time"],
127-
.ui.form input[type="url"],
128-
.ui.input textarea,
129-
.ui.form textarea,
130-
.ui.header,
131-
.ui.items > .item > .content > .header,
132-
.ui.list .list > .item .header,
133-
.ui.list > .item .header,
134-
.ui.menu,
135-
.ui.message .header,
136-
.ui.modal > .header,
137-
.ui.popup > .header,
138-
.ui.search > .results .result .title,
139-
.ui.search > .results > .message .header,
140-
.ui.input > input,
141-
.ui.input input,
142-
.ui.statistics .statistic > .value,
143-
.ui.statistic > .value,
144-
.ui.statistics .statistic > .label,
145-
.ui.statistic > .label,
146-
.ui.steps .step .title,
147-
.ui.text.container,
148-
.ui.language > .menu > .item {
103+
textarea {
149104
font-family: var(--fonts-regular);
150105
}
151106

0 commit comments

Comments
 (0)