feat(config): add pageWidth setting to .remanso.json
Allows repo owners to configure note column width via `"pageWidth": "700px"` in .remanso.json. Applies the value to the --note-width CSS variable and invalidates the cached width so resize/overlay hooks pick it up. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,3 +10,7 @@ export const getNoteWidth = () => {
|
|||||||
}
|
}
|
||||||
return cached
|
return cached
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const resetNoteWidthCache = () => {
|
||||||
|
cached = undefined
|
||||||
|
}
|
||||||
|
|||||||
@@ -10,4 +10,5 @@ export interface UserSettings extends Model<DataType.UserSettings> {
|
|||||||
backlink?: boolean
|
backlink?: boolean
|
||||||
chosenTitleFont?: string
|
chosenTitleFont?: string
|
||||||
chosenBodyFont?: string
|
chosenBodyFont?: string
|
||||||
|
pageWidth?: string
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { watchEffect } from "vue"
|
import { watchEffect } from "vue"
|
||||||
|
|
||||||
|
import { resetNoteWidthCache } from "@/constants/note-width"
|
||||||
import { useUserRepoStore } from "@/modules/repo/store/userRepo.store"
|
import { useUserRepoStore } from "@/modules/repo/store/userRepo.store"
|
||||||
import { downloadFont } from "@/utils/downloadFont"
|
import { downloadFont } from "@/utils/downloadFont"
|
||||||
|
|
||||||
@@ -22,5 +23,11 @@ export const useUserSettings = () => {
|
|||||||
"--title-font-family"
|
"--title-font-family"
|
||||||
)
|
)
|
||||||
root.style.setProperty("--font-size", fontSize || DEFAULT_FONT_SIZE)
|
root.style.setProperty("--font-size", fontSize || DEFAULT_FONT_SIZE)
|
||||||
|
|
||||||
|
const pageWidth = store.userSettings?.pageWidth
|
||||||
|
if (pageWidth) {
|
||||||
|
root.style.setProperty("--note-width", pageWidth)
|
||||||
|
resetNoteWidthCache()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user