Skip to content

Commit

Permalink
feat: update fonts and homepage image (#1851)
Browse files Browse the repository at this point in the history
* This commit addresses feature request #1848, update homepage messaging + visuals
#1848

Update index.md: Revise hero section with new text and tagline, and change image source

* feat: update fonts to Youth and Untitled Sans

Addresses #1850

- Replace Ruberoid with Youth for titles
- Replace Inter with Untitled Sans for body text
- Update font paths and formats in style.css and config.ts
- Add font-display: swap for better loading performance
- Add specific font family classes for VPDoc and VPHome components

Youth is now used for titles (h1-h6) and Untitled Sans for regular text,
following the typography guidelines.

* Apply suggestions from code review

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update .vitepress/theme/style.css

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix: font path

---------

Co-authored-by: Josh Stein <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 9, 2025
1 parent 5c630b4 commit a089fbc
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 20 deletions.
31 changes: 17 additions & 14 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,54 +150,57 @@ export default {
],

transformHead(assets: string[]): HeadConfig[] {
const ruberoidLightFont = assets.find(
(file) => /Ruberoid-Light\.\w+\.otf/,
const youthRegularFont = assets.find(
(file) => /youth\/Youth-Regular\.\w+\.woff2/
);
const ruberoidRegularFont = assets.find(
(file) => /Ruberoid-Regular\.\w+\.otf/,
const untitledSansRegularFont = assets.find(
(file) => /Untitled-Sans-Regular\.\w+\.woff2/
);
const untitledSansMediumFont = assets.find(
(file) => /Unititled-Sans-Medium\.\w+\.woff2/
);
const ruberoidBoldFont = assets.find((file) => /Ruberoid-Bold\.\w+\.otf/);

const headConfig: HeadConfig[] = [];

if (ruberoidLightFont) {
if (youthRegularFont) {
headConfig.push([
"link",
{
rel: "preload",
href: ruberoidLightFont,
href: youthRegularFont,
as: "font",
type: "font/opentype",
type: "font/woff2",
crossorigin: "",
},
]);
}

if (ruberoidRegularFont) {
if (untitledSansRegularFont) {
headConfig.push([
"link",
{
rel: "preload",
href: ruberoidRegularFont,
href: untitledSansRegularFont,
as: "font",
type: "font/opentype",
type: "font/woff2",
crossorigin: "",
},
]);
}

if (ruberoidBoldFont) {
if (untitledSansMediumFont) {
headConfig.push([
"link",
{
rel: "preload",
href: ruberoidBoldFont,
href: untitledSansMediumFont,
as: "font",
type: "font/opentype",
type: "font/woff2",
crossorigin: "",
},
]);
}

return headConfig;
},
},
Expand Down
38 changes: 35 additions & 3 deletions .vitepress/theme/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,32 @@
}

@font-face {
font-family: "RuberoidBold";
src: url("/fonts/Ruberoid/Ruberoid-Bold.otf") format("opentype");
font-family: "Untitled-Sans";
src: url("/fonts/untitled-sans/untitled-sans-regular.woff2") format("woff2");
font-weight: normal;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: "Untitled-Sans";
src: url("/fonts/untitled-sans/untitled-sans-medium.woff2") format("woff2");
font-weight: 500;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: "Youth";
src: url("/fonts/youth/Youth-Regular.woff2") format("woff2");
font-weight: normal;
font-style: normal;
font-display: swap;
}

:root {
--font-primary: "RuberoidBold", sans-serif;
--font-primary: "Youth", sans-serif;
--font-body: "Untitled-Sans", sans-serif;
}

h1,
Expand Down Expand Up @@ -126,3 +146,15 @@ h6 {
height: 100%;
border: none;
}

body {
font-family: var(--font-body);
}

.VPDoc {
font-family: var(--font-body);
}

.VPHome {
font-family: var(--font-body);
}
6 changes: 3 additions & 3 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ titleTemplate: ":title"

hero:
name: "Celestia"
text: "The first modular blockchain network"
tagline: Celestia is a modular data availability network that securely scales with the number of users, making it easy for anyone to launch their own blockchain.
text: "Build whatever"
tagline: Celestia is the modular blockchain powering unstoppable applications with full-stack customizability.
image:
src: /modular.svg
src: /Blobspace.png
alt: Celestia
actions:
- theme: brand
Expand Down
Binary file added public/Blobspace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/fonts/Ruberoid/Ruberoid-Bold.otf
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 4 additions & 0 deletions public/fonts/youth/Youth-Regular.woff
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<ttFont sfntVersion="OTTO" ttLibVersion="4.55">

</ttFont>
Binary file added public/fonts/youth/Youth-Regular.woff2
Binary file not shown.

0 comments on commit a089fbc

Please sign in to comment.