feat: take into account font size (#11)
This commit is contained in:
@@ -3,6 +3,7 @@ import { Model } from '@/data/models/Model'
|
|||||||
|
|
||||||
export interface UserSettings extends Model<DataType.UserSettings> {
|
export interface UserSettings extends Model<DataType.UserSettings> {
|
||||||
fontFamily?: string
|
fontFamily?: string
|
||||||
|
fontSize?: string
|
||||||
mode?: 'light' | 'dark'
|
mode?: 'light' | 'dark'
|
||||||
backlink?: boolean
|
backlink?: boolean
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,11 +20,14 @@ export const useUserSettings = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const fontFamily = store.userSettings?.fontFamily
|
const fontFamily = store.userSettings?.fontFamily
|
||||||
|
const fontSize = store.userSettings?.fontSize
|
||||||
const mode = store.userSettings?.mode
|
const mode = store.userSettings?.mode
|
||||||
const root = document.documentElement
|
const root = document.documentElement
|
||||||
|
|
||||||
downloadGoogleFont(fontFamily || DEFAULT_FONT_POLICY)
|
downloadGoogleFont(fontFamily || DEFAULT_FONT_POLICY)
|
||||||
|
|
||||||
|
root.style.setProperty('--font-size', fontSize || '16px')
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case 'dark':
|
case 'dark':
|
||||||
root.style.setProperty('--font-color', DARK_FONT_COLOR)
|
root.style.setProperty('--font-color', DARK_FONT_COLOR)
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
:root {
|
:root {
|
||||||
--primary-color: #2c3a47;
|
--primary-color: #2c3a47;
|
||||||
--font-family: "Courier Prime", monospace;
|
--font-family: "Courier Prime", monospace;
|
||||||
|
--font-size: 13pt;
|
||||||
--font-color: #4a4a4a;
|
--font-color: #4a4a4a;
|
||||||
--link: #445fb9;
|
--link: #445fb9;
|
||||||
--light-link: lighten(#445fb9, 45%);
|
--light-link: lighten(#445fb9, 45%);
|
||||||
@@ -71,6 +72,7 @@ a {
|
|||||||
|
|
||||||
.repo-note {
|
.repo-note {
|
||||||
font-family: var(--font-family);
|
font-family: var(--font-family);
|
||||||
|
font-size: var(--font-size);
|
||||||
transition-property: color, background-color;
|
transition-property: color, background-color;
|
||||||
transition: cubic-bezier(0.39, 0.575, 0.565, 1) 0.3s;
|
transition: cubic-bezier(0.39, 0.575, 0.565, 1) 0.3s;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user