feat: remove the indent from chinese punctuation

This commit is contained in:
Hakadao
2024-09-26 22:33:24 +08:00
parent a071be8b8f
commit ea083c527a
7 changed files with 54 additions and 6 deletions

View File

@@ -67,6 +67,33 @@ export function setupNecessarySettingsWatchers() {
{ immediate: true },
)
const removeTheIndentFromChinesePunctuationStyleEl = injectCSS(`
.video-info-container .special-text-indent[data-title^='《'],
.video-info-container .special-text-indent[data-title^='「'],
.video-info-container .special-text-indent[data-title^='『'],
.video-info-container .special-text-indent[data-title^='【'],
p[title^='\\300c'],
p[title^='\\300e'],
p[title^='\\3010'],
h3[title^='\\300c'],
h3[title^='\\300e'],
h3[title^='\\3010'] {
text-indent: 0 !important;
}
`)
watch(
() => settings.value.removeTheIndentFromChinesePunctuation,
() => {
if (settings.value.removeTheIndentFromChinesePunctuation) {
document.documentElement.appendChild(removeTheIndentFromChinesePunctuationStyleEl)
}
else {
document.documentElement.removeChild(removeTheIndentFromChinesePunctuationStyleEl)
}
},
{ immediate: true },
)
watch(
() => settings.value.disableFrostedGlass,
() => {