@@ -40,7 +44,7 @@ const vnode = computed(() => {
-
+
Error: {{ translation.error }}
diff --git a/components/status/StatusPreviewStackBlitz.vue b/components/status/StatusPreviewStackBlitz.vue
index 7110edf1..d9357238 100644
--- a/components/status/StatusPreviewStackBlitz.vue
+++ b/components/status/StatusPreviewStackBlitz.vue
@@ -47,6 +47,9 @@ const vnodeCode = computed(() => {
})
return vnode
})
+
+const userSettings = useUserSettings()
+const lineHeight = userSettings.value.lineHeight
@@ -60,7 +63,7 @@ const vnodeCode = computed(() => {
pb-2
>
-
+
diff --git a/composables/settings/definition.ts b/composables/settings/definition.ts
index 98f3c337..e1d824ff 100644
--- a/composables/settings/definition.ts
+++ b/composables/settings/definition.ts
@@ -1,7 +1,9 @@
-import { DEFAULT_FONT_SIZE } from '~/constants'
+import { DEFAULT_FONT_SIZE, DEFAULT_LINE_HEIGHT } from '~/constants'
export type FontSize = `${number}px`
+export type LineHeight = 'narrow' | 'normal' | 'wide'
+
// Temporary type for backward compatibility
export type OldFontSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl'
@@ -38,6 +40,7 @@ export interface UserSettings {
preferences: Partial
colorMode?: ColorMode
fontSize: FontSize
+ lineHeight: LineHeight
language: string
disabledTranslationLanguages: string[]
themeColors?: ThemeColors
@@ -94,6 +97,7 @@ export function getDefaultUserSettings(locales: string[]): UserSettings {
return {
language: getDefaultLanguage(locales),
fontSize: DEFAULT_FONT_SIZE,
+ lineHeight: DEFAULT_LINE_HEIGHT,
disabledTranslationLanguages: [],
preferences: DEFAULT__PREFERENCES_SETTINGS,
}
diff --git a/constants/index.ts b/constants/index.ts
index aff99d1f..48874ce3 100644
--- a/constants/index.ts
+++ b/constants/index.ts
@@ -4,6 +4,7 @@ export const APP_NAME = 'Elk'
export const DEFAULT_POST_CHARS_LIMIT = 500
export const DEFAULT_FONT_SIZE = '15px'
+export const DEFAULT_LINE_HEIGHT = 'normal'
export const ELK_PAGE_LIFECYCLE_FROZEN = 'elk-frozen'
diff --git a/locales/en.json b/locales/en.json
index f498f5a8..1915bee4 100644
--- a/locales/en.json
+++ b/locales/en.json
@@ -462,8 +462,13 @@
"font_size": "Font Size",
"label": "Interface",
"light_mode": "Light",
+ "line_height": "Line Height",
+ "narrow": "Narrow",
+ "normal": "Normal",
+ "reload_app": "Reload the app for the changes to take effect.",
"system_mode": "System",
- "theme_color": "Theme Color"
+ "theme_color": "Theme Color",
+ "wide": "Wide"
},
"language": {
"display_language": "Display Language",
diff --git a/pages/settings/interface/index.vue b/pages/settings/interface/index.vue
index 723859b1..219795da 100644
--- a/pages/settings/interface/index.vue
+++ b/pages/settings/interface/index.vue
@@ -15,6 +15,7 @@ useHydratedHead({
+
diff --git a/styles/global.css b/styles/global.css
index 1942824d..257a6f29 100644
--- a/styles/global.css
+++ b/styles/global.css
@@ -125,8 +125,16 @@ em-emoji-picker {
}
}
-.line-compact {
- line-height: calc(4 / 3 * 1em);
+.line-height-narrow {
+ line-height: 1.15;
+}
+
+.line-height-normal {
+ line-height: calc(4 / 3);
+}
+
+.line-height-wide {
+ line-height: 1.5;
}
.content-editor {