Skip to content

Commit

Permalink
Merge pull request #2839 from skeletonlabs/dev
Browse files Browse the repository at this point in the history
Merge for release August 27, 2024
  • Loading branch information
endigo9740 authored Aug 27, 2024
2 parents 252a0be + 4eb0e08 commit b72b970
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions sites/skeleton.dev/src/routes/(inner)/docs/themes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ plugins: [
</p>
<CodeBlock language="html" code={`<html class="dark">`} />
<p>
Note that Skeleton also provides a <a class="anchor" href="/docs/dark-mode#via-selector" target="_blank">Lightswitch</a> utility if you wish
toggle between light and dark modes.
Note that Skeleton also provides a <a class="anchor" href="/docs/dark-mode#via-selector" target="_blank">Lightswitch</a> utility if you
wish to toggle between light and dark modes.
</p>
</section>

Expand Down Expand Up @@ -308,23 +308,27 @@ body {
/>
{/each}
<!-- 5 -->
<h3 class="h3" data-toc-ignore>5. Preloading Fonts.</h3>
<h3 class="h3" data-toc-ignore>5. Handle Font Flickering.</h3>
<p>
To avoid your page flickering during hydration, consider preloading fonts within the <code class="code">head</code>
tag in <code class="code">app.html</code>
To avoid your page flickering during hydration, consider using the <code class="code">font-display</code> descriptor for the
<code class="code">@font-face</code>
at-rule that determines how a font face is displayed based on whether and when it is downloaded and ready to use.
<br />
<br />Replace your <code class="code">@font-face</code> at-rule with the following:
</p>
{#each activeFonts as f}
<CodeBlock
language="html"
language="css"
code={`
<link
rel="preload"
href="%sveltekit.assets%/fonts/${f.file}"
as="font"
type="font/ttf"
crossorigin
/>
`}
@font-face {
/* Reference name */
font-family: '${f.name}';
/* For multiple files use commas, ex: url(), url(), ... */
src: url('/fonts/${f.file}');
/* Gives the font face an extremely small block period and an infinite swap period. */
font-display: swap;
}
`}
/>
{/each}
{:else if tabsFontImport === 1}
Expand Down

0 comments on commit b72b970

Please sign in to comment.