design: add roboto slab font
This commit is contained in:
8 files changed
+45
-11
No files matched your search
+28
-1
@@ -7,8 +7,8 @@
|
|||||||
@theme {
|
@theme {
|
||||||
--font-sans: sans-serif;
|
--font-sans: sans-serif;
|
||||||
--font-system: system-ui;
|
--font-system: system-ui;
|
||||||
--font-inter: Inter, system-ui, sans-serif;
|
|
||||||
--font-display: Inter, system-ui, sans-serif;
|
--font-display: Inter, system-ui, sans-serif;
|
||||||
|
--font-reading: Inter, system-ui, sans-serif;
|
||||||
--font-mono: monospace;
|
--font-mono: monospace;
|
||||||
|
|
||||||
--animate-pop-in: pop-in 0.8s cubic-bezier(0.075, 0.82, 0.165, 1) forwards;
|
--animate-pop-in: pop-in 0.8s cubic-bezier(0.075, 0.82, 0.165, 1) forwards;
|
||||||
@@ -56,6 +56,33 @@
|
|||||||
font-display: swap;
|
font-display: swap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Roboto Slab';
|
||||||
|
src: url('/font/RobotoSlab.woff2') format('woff2');
|
||||||
|
font-display: swap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font--serifs {
|
||||||
|
--font-display: 'Roboto Slab', serif;
|
||||||
|
--font-reading: 'Roboto Slab', serif;
|
||||||
|
--font-sans: 'Roboto Slab', serif;
|
||||||
|
}
|
||||||
|
.font--inter {
|
||||||
|
--font-display: Inter, sans-serif;
|
||||||
|
--font-reading: Inter, sans-serif;
|
||||||
|
--font-sans: Inter, sans-serif;
|
||||||
|
}
|
||||||
|
.font--system {
|
||||||
|
--font-display: system-ui, sans-serif;
|
||||||
|
--font-reading: system-ui, sans-serif;
|
||||||
|
--font-sans: system-ui, sans-serif;
|
||||||
|
}
|
||||||
|
.font--browser {
|
||||||
|
--font-display: sans-serif;
|
||||||
|
--font-reading: sans-serif;
|
||||||
|
--font-sans: sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
@apply bg-slate-50 text-slate-900 dark:bg-zinc-950 dark:text-zinc-100 accent-slate-950 dark:accent-zinc-50;
|
@apply bg-slate-50 text-slate-900 dark:bg-zinc-950 dark:text-zinc-100 accent-slate-950 dark:accent-zinc-50;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html class="dark" lang="en">
|
<html class="dark font-sans" lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<link rel="icon" href="%sveltekit.assets%/img/logo-background.svg" />
|
<link rel="icon" href="%sveltekit.assets%/img/logo-background.svg" />
|
||||||
|
|||||||
@@ -154,7 +154,10 @@
|
|||||||
<svelte:element
|
<svelte:element
|
||||||
this={inline ? 'div' : 'article'}
|
this={inline ? 'div' : 'article'}
|
||||||
dir="auto"
|
dir="auto"
|
||||||
class={[!noStyle && 'break-words space-y-4 leading-normal', clazz]}
|
class={[
|
||||||
|
!noStyle && 'wrap-break-word space-y-4 leading-normal font-reading',
|
||||||
|
clazz,
|
||||||
|
]}
|
||||||
{style}
|
{style}
|
||||||
>
|
>
|
||||||
<MdTree {tokens} renderers={inline ? inlineRenderers : renderers} />
|
<MdTree {tokens} renderers={inline ? inlineRenderers : renderers} />
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ interface Settings {
|
|||||||
debugInfo: boolean
|
debugInfo: boolean
|
||||||
expandImages: boolean
|
expandImages: boolean
|
||||||
|
|
||||||
font: 'inter' | 'system' | 'browser'
|
font: 'inter' | 'system' | 'browser' | 'serifs'
|
||||||
leftAlign: boolean
|
leftAlign: boolean
|
||||||
|
|
||||||
newWidth: boolean
|
newWidth: boolean
|
||||||
|
|||||||
@@ -266,7 +266,7 @@
|
|||||||
source={node.comment_view.comment.content}
|
source={node.comment_view.comment.content}
|
||||||
noStyle
|
noStyle
|
||||||
class={[
|
class={[
|
||||||
'text-[15px] sm:text-base text-slate-700 dark:text-zinc-300 *:leading-[1.6] break-words space-y-3',
|
'text-[15px] font-reading sm:text-base text-slate-700 dark:text-zinc-300 *:leading-[1.6] wrap-break-word space-y-3',
|
||||||
node.comment_view.comment.distinguished
|
node.comment_view.comment.distinguished
|
||||||
? 'material-success px-3 py-1.5 rounded-xl max-w-max'
|
? 'material-success px-3 py-1.5 rounded-xl max-w-max'
|
||||||
: page.url.hash.slice(1) ==
|
: page.url.hash.slice(1) ==
|
||||||
|
|||||||
@@ -55,16 +55,19 @@
|
|||||||
$effect(() => {
|
$effect(() => {
|
||||||
if (settings) {
|
if (settings) {
|
||||||
document.documentElement.classList.remove(
|
document.documentElement.classList.remove(
|
||||||
'font-inter',
|
'font--inter',
|
||||||
'font-sans',
|
'font--sans',
|
||||||
'font-system',
|
'font--system',
|
||||||
)
|
)
|
||||||
document.documentElement.classList.add(
|
document.documentElement.classList.add(
|
||||||
|
// i should be fired for nested ternaries
|
||||||
settings.font == 'inter'
|
settings.font == 'inter'
|
||||||
? 'font-inter'
|
? 'font--inter'
|
||||||
: settings.font == 'system'
|
: settings.font == 'system'
|
||||||
? 'font-system'
|
? 'font--system'
|
||||||
: 'font-sans',
|
: settings.font == 'serifs'
|
||||||
|
? 'font--serifs'
|
||||||
|
: 'font--sans',
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -287,6 +287,7 @@
|
|||||||
<Option value="inter">Inter</Option>
|
<Option value="inter">Inter</Option>
|
||||||
<Option value="system">System UI</Option>
|
<Option value="system">System UI</Option>
|
||||||
<Option value="browser">Browser</Option>
|
<Option value="browser">Browser</Option>
|
||||||
|
<Option value="serifs">Roboto Slab</Option>
|
||||||
</Select>
|
</Select>
|
||||||
</Setting>
|
</Setting>
|
||||||
<ToggleSetting
|
<ToggleSetting
|
||||||
|
|||||||
Binary file not shown.
Reference in new issue
Block a user