Skip to content

Commit 12f1cb2

Browse files
authored
feat: set fonts for htmlized doc template (ietf-tools#5636)
1 parent 37118a6 commit 12f1cb2

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

ietf/static/css/document_html.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ $btn-font-family: inherit !default;
66
$nav-link-font-weight: inherit !default;
77
$tooltip-margin: inherit !default;
88

9+
$font-family-sans-serif: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
10+
$font-family-monospace: "Noto Sans Mono", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
11+
912
@import "bootstrap/scss/functions";
1013
@import "bootstrap/scss/variables";
1114
@import "bootstrap/scss/maps";

ietf/static/css/ietf.scss

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ $enable-negative-margins: true;
1010

1111
$popover-max-width: 100%;
1212

13-
// Only import what we need:
14-
15-
@import "bootstrap/scss/variables";
13+
// Override default fonts
1614

1715
$font-family-sans-serif: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
1816
$font-family-monospace: "Noto Sans Mono", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
1917

18+
// Only import what we need:
19+
20+
@import "bootstrap/scss/variables";
21+
2022
$h1-font-size: $font-size-base * 2.2;
2123
$h2-font-size: $font-size-base * 1.8;
2224
$h3-font-size: $font-size-base * 1.6;

ietf/templates/doc/document_html.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
{% endif %}
1919
</title>
2020
<meta name="viewport" content="width=device-width, initial-scale=1">
21+
<link href="https://static.ietf.org/fonts/inter/import.css" rel="stylesheet">
22+
<link href="https://static.ietf.org/fonts/noto-sans-mono/import.css" rel="stylesheet">
2123
{% if request.COOKIES.pagedeps == 'inline' %}
2224
<script>{{ js|safe }}</script>
2325
<style>{{ css|safe }}</style>
@@ -28,10 +30,7 @@
2830
{% endif %}
2931
<script src="{% static 'ietf/js/document_html.js' %}"></script>
3032
{% endif %}
31-
<link rel="alternate"
32-
type="application/atom+xml"
33-
title="Document changes"
34-
href="/feed/document-changes/{{ doc.name }}/">
33+
<link rel="alternate" type="application/atom+xml" title="Document changes" href="/feed/document-changes/{{ doc.name }}/">
3534
<meta name="description"
3635
{% if not snapshot and doc.get_state_slug == 'rfc' %}
3736
content="{{ doc.title }} (RFC {{ doc.rfc_number }}{% if published %}, {{ published.time|date:'F Y' }}{% endif %}{% if obsoleted_by %}; obsoleted by {% for rel in obsoleted_by %}{{ rel.source.canonical_name|prettystdname}}{% if not forloop.last%}, {% endif %}{% endfor %}{% endif %})"
@@ -40,7 +39,7 @@
4039
{% endif %}>
4140
{% include "base/icons.html" %}
4241
{% include "doc/opengraph.html" %}
43-
{% analytical_head_bottom %}
42+
{% analytical_head_bottom %}
4443
<style>
4544
{# Force "text-overflow: ellipsis" to hide the beginning of a doc name #}
4645
.diff-form .select2-selection__rendered {

0 commit comments

Comments
 (0)