Skip to content

Commit

Permalink
Feedback from code review.
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed Apr 18, 2024
1 parent b374acd commit acb3b83
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions vignettes/customise.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,18 @@ template:

If you want to use a non-Google font, you'll need to do a bit more work. There are two steps: you need to first configure the font with CSS and then use it in your `_pkgdown.yaml`. There are two ways you might get the CSS:

* As a block of CSS which you should put in `pkgdown/extra.css`. The CSS will look something like this:
* As a block of CSS which you should put in `pkgdown/extra.scss` or `pkgdown/extra.css`. The CSS will look something like this:

```css
@font-face {
font-family: "proxima-nova";
src:
local("Proxima Nova Regular"),
local("ProximaNova-Regular"),
url("https://ropensci.org/fonts/proxima/ProximaNova-Regular.eot?#iefix") format("embedded-opentype"),
url("https://ropensci.org/fonts/proxima/ProximaNova-Regular.woff2") format("woff2"),
url("https://ropensci.org/fonts/proxima/ProximaNova-Regular.woff") format("woff"),
url("https://ropensci.org/fonts/proxima/ProximaNova-Regular.ttf") format("truetype");
url("https://example.com/ProximaNova-Regular.eot?#iefix") format("embedded-opentype"),
url("https://example.com/fonts/proxima/ProximaNova-Regular.woff2") format("woff2"),
url("https://example.com/fonts/proxima/ProximaNova-Regular.woff") format("woff"),
url("https://example.com/fonts/proxima/ProximaNova-Regular.ttf") format("truetype");
font-weight: normal;
font-style: normal;
font-display: fallback;
Expand All @@ -159,7 +159,9 @@ template:
base_font: proxima-nova
```

When iterating on fonts, you'll need to run `build_home_index(); init_site()` then refresh you browwser to see the update.
Depending on where the font is from (and if you paid money for it), you may need to take additional steps to ensure that it can only be used from your site, and/or make sure that it can still be used when you're previewing locally. If you're having problems getting a custom font to work, looking for errors in the browser developer console is a good place to start.

When iterating on fonts, you'll need to run `build_home_index(); init_site()` then refresh you browser to see the update.


### Syntax highlighting
Expand Down

0 comments on commit acb3b83

Please sign in to comment.