feat: show font family selectors with default fonts when no .remanso.json

This commit is contained in:
Julien Calixte
2026-04-05 10:49:01 +02:00
parent 99c349f6df
commit 3de9eb35f6

View File

@@ -7,7 +7,21 @@ import { useUserRepoStore } from "../modules/repo/store/userRepo.store"
const store = useUserRepoStore() const store = useUserRepoStore()
const fontFamilies = computed(() => store.userSettings?.fontFamilies ?? []) const DEFAULT_FONT_FAMILIES = [
"EB Garamond",
"Inter",
"Lato",
"Libertinus Serif",
"Lora",
"Merriweather",
"Playfair Display",
"Roboto",
"Source Serif 4"
]
const fontFamilies = computed(
() => store.userSettings?.fontFamilies ?? DEFAULT_FONT_FAMILIES
)
const sortedFontFamilies = computed(() => const sortedFontFamilies = computed(() =>
[...fontFamilies.value].sort((a, b) => a.localeCompare(b)) [...fontFamilies.value].sort((a, b) => a.localeCompare(b))
) )
@@ -16,7 +30,7 @@ const fontSizes = Array.from({ length: 7 }, (_, i) => `${9 + i * 2}pt`)
<template> <template>
<div class="font-change"> <div class="font-change">
<div v-if="sortedFontFamilies.length > 0"> <div>
<label for="title-font" class="font-label">t</label> <label for="title-font" class="font-label">t</label>
<select <select
id="title-font" id="title-font"