mirror of
https://github.com/ZeroCatDev/Classworks.git
synced 2026-02-04 16:03:10 +00:00
Improve font size initialization and style organization
Co-authored-by: Sunwuyuan <88357633+Sunwuyuan@users.noreply.github.com>
This commit is contained in:
parent
a89bca2ca4
commit
a332d9365f
@ -15,14 +15,12 @@
|
|||||||
<div
|
<div
|
||||||
class="font-weight-medium mb-4 serif-font"
|
class="font-weight-medium mb-4 serif-font"
|
||||||
:style="contentStyle"
|
:style="contentStyle"
|
||||||
style="white-space: pre-wrap; line-height: 1.6; text-align: left;"
|
|
||||||
>
|
>
|
||||||
{{ sentence }}
|
{{ sentence }}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="text-medium-emphasis serif-font"
|
class="text-medium-emphasis serif-font"
|
||||||
:style="authorStyle"
|
:style="authorStyle"
|
||||||
style="text-align: left;"
|
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
v-if="author"
|
v-if="author"
|
||||||
@ -68,19 +66,23 @@ export default {
|
|||||||
loading: false,
|
loading: false,
|
||||||
timer: null,
|
timer: null,
|
||||||
unwatch: null,
|
unwatch: null,
|
||||||
fontSize: 28
|
fontSize: SettingsManager.getSetting('font.size')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
contentStyle() {
|
contentStyle() {
|
||||||
return {
|
return {
|
||||||
'font-size': `${this.fontSize}px`
|
'font-size': `${this.fontSize}px`,
|
||||||
|
'white-space': 'pre-wrap',
|
||||||
|
'line-height': '1.6',
|
||||||
|
'text-align': 'left'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
authorStyle() {
|
authorStyle() {
|
||||||
// Author font size is 60% of the main font size
|
// Author font size is 60% of the main font size
|
||||||
return {
|
return {
|
||||||
'font-size': `${this.fontSize * 0.6}px`
|
'font-size': `${this.fontSize * 0.6}px`,
|
||||||
|
'text-align': 'left'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user