Skip to content

Commit 2a8227d

Browse files
committed
[DOC] preload font
1 parent abf061f commit 2a8227d

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

docs/source/_static/css/custom.css

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
/* Custom CSS for Hyperactive documentation */
22
/* Purple/Violet theme matching the Hyperactive logo */
33

4-
/* ============================================
5-
Google Font Import for Hero Title
6-
============================================ */
7-
@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;600;700&display=swap');
4+
/* NOTE: Raleway font is loaded via layout.html with preload for better performance.
5+
This prevents the Flash of Unstyled Text (FOUT) on the hero title. */
86

97
/* ============================================
108
PyData Theme Color Overrides (purple theme)

docs/source/_templates/layout.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,10 @@
33
{% block extrahead %}
44
{{ super() }}
55
<meta name="python-version-range" content="{{ python_version_range }}">
6+
<!-- Preconnect to Google Fonts for faster font loading -->
7+
<link rel="preconnect" href="https://fonts.googleapis.com">
8+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9+
<!-- Preload Raleway font to prevent FOUT (Flash of Unstyled Text) -->
10+
<link rel="preload" href="https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;600;700&display=swap" as="style" onload="this.onload=null;this.rel='stylesheet'">
11+
<noscript><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;600;700&display=swap"></noscript>
612
{% endblock %}

0 commit comments

Comments
 (0)