Merge pull request '2-11-2-fixes' (#3522) from 2-11-2-fixes into develop
Reviewed-on: https://git.pleroma.social/pleroma/pleroma-fe/pulls/3522
This commit is contained in:
commit
43037951ea
7 changed files with 40 additions and 17 deletions
4
changelog.d/2-11-2.fix
Normal file
4
changelog.d/2-11-2.fix
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
Fixed crashing on Firefox 153
|
||||||
|
Fixed serif-fonts being used by default in some cases
|
||||||
|
Fixed font select component showing and using objects instead of strings
|
||||||
|
Fixed generic ('sans-serif', 'monospace' etc) fonts not working
|
||||||
|
|
@ -87,6 +87,11 @@
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
|
|
||||||
|
&.panel-body::before {
|
||||||
|
content: '';
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.notification {
|
.notification {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-bottom: 1px solid;
|
border-bottom: 1px solid;
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@
|
||||||
:model-value="mergedConfig.fontInterface"
|
:model-value="mergedConfig.fontInterface"
|
||||||
name="ui"
|
name="ui"
|
||||||
:label="$t('settings.style.fonts.components_inline.interface')"
|
:label="$t('settings.style.fonts.components_inline.interface')"
|
||||||
:fallback="{ family: 'sans-serif' }"
|
fallback="sans-serif"
|
||||||
no-inherit="1"
|
no-inherit="1"
|
||||||
@update:model-value="v => updateFont('fontInterface', v)"
|
@update:model-value="v => updateFont('fontInterface', v)"
|
||||||
/>
|
/>
|
||||||
|
|
@ -77,7 +77,7 @@
|
||||||
<FontControl
|
<FontControl
|
||||||
:model-value="mergedConfig.fontInput"
|
:model-value="mergedConfig.fontInput"
|
||||||
name="input"
|
name="input"
|
||||||
:fallback="{ family: 'inherit' }"
|
fallback="inherit"
|
||||||
:label="$t('settings.style.fonts.components_inline.input')"
|
:label="$t('settings.style.fonts.components_inline.input')"
|
||||||
@update:model-value="v => updateFont('fontInput', v)"
|
@update:model-value="v => updateFont('fontInput', v)"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@
|
||||||
<FontControl
|
<FontControl
|
||||||
:model-value="mergedConfig.fontPosts"
|
:model-value="mergedConfig.fontPosts"
|
||||||
name="post"
|
name="post"
|
||||||
:fallback="{ family: 'inherit' }"
|
fallback="inherit"
|
||||||
:label="$t('settings.style.fonts.components.post')"
|
:label="$t('settings.style.fonts.components.post')"
|
||||||
@update:model-value="v => updateFont('fontPosts', v)"
|
@update:model-value="v => updateFont('fontPosts', v)"
|
||||||
/>
|
/>
|
||||||
|
|
@ -67,7 +67,7 @@
|
||||||
<FontControl
|
<FontControl
|
||||||
:model-value="mergedConfig.fontMonospace"
|
:model-value="mergedConfig.fontMonospace"
|
||||||
name="postCode"
|
name="postCode"
|
||||||
:fallback="{ family: 'monospace' }"
|
fallback="monospace"
|
||||||
:label="$t('settings.style.fonts.components.monospace')"
|
:label="$t('settings.style.fonts.components.monospace')"
|
||||||
@update:model-value="v => updateFont('fontMonospace', v)"
|
@update:model-value="v => updateFont('fontMonospace', v)"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -44,10 +44,10 @@ import {
|
||||||
} from 'src/api/public.js'
|
} from 'src/api/public.js'
|
||||||
import {
|
import {
|
||||||
blockUser as apiBlockUser,
|
blockUser as apiBlockUser,
|
||||||
|
editUserNote as apiEditUserNote,
|
||||||
muteUser as apiMuteUser,
|
muteUser as apiMuteUser,
|
||||||
unblockUser as apiUnblockUser,
|
unblockUser as apiUnblockUser,
|
||||||
unmuteUser as apiUnmuteUser,
|
unmuteUser as apiUnmuteUser,
|
||||||
editUserNote as apiEditUserNote,
|
|
||||||
fetchBlocks,
|
fetchBlocks,
|
||||||
fetchDomainMutes,
|
fetchDomainMutes,
|
||||||
fetchMutes,
|
fetchMutes,
|
||||||
|
|
|
||||||
|
|
@ -32,16 +32,17 @@ export const createStyleSheet = (id, priority = 1000) => {
|
||||||
newRule = newRule.replace(/backdrop-filter:[^;]+;/g, '') // Remove backdrop-filter
|
newRule = newRule.replace(/backdrop-filter:[^;]+;/g, '') // Remove backdrop-filter
|
||||||
}
|
}
|
||||||
|
|
||||||
// firefox doesn't like invalid selectors
|
if (newRule.startsWith('::-webkit')) {
|
||||||
if (
|
if (typeof CSS.supports !== 'function') return
|
||||||
!CSS.supports?.('selector(::-webkit-scrollbar)') &&
|
// firefox doesn't like invalid selectors
|
||||||
!CSS.supports?.('selector(::-webkit-scrollbar-button)') &&
|
const fullWebkitScrollbarSupport =
|
||||||
!CSS.supports?.('selector(::-webkit-resizer)') &&
|
CSS.supports('selector(::-webkit-scrollbar)') &&
|
||||||
!CSS.supports?.('selector(::-webkit-scrollbar-thumb)') &&
|
CSS.supports('selector(::-webkit-scrollbar-button)') &&
|
||||||
newRule.startsWith('::-webkit')
|
CSS.supports('selector(::-webkit-resizer)') &&
|
||||||
) {
|
CSS.supports('selector(::-webkit-scrollbar-thumb)')
|
||||||
return
|
if (!fullWebkitScrollbarSupport) return
|
||||||
}
|
}
|
||||||
|
|
||||||
this.rules.push(
|
this.rules.push(
|
||||||
newRule.replace(/var\(--shadowFilter\)[^;]*;/g, ''), // Remove shadowFilter references
|
newRule.replace(/var\(--shadowFilter\)[^;]*;/g, ''), // Remove shadowFilter references
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,16 @@ import {
|
||||||
} from 'src/services/theme_data/theme_data.service.js'
|
} from 'src/services/theme_data/theme_data.service.js'
|
||||||
import { convertTheme2To3 } from 'src/services/theme_data/theme2_to_theme3.js'
|
import { convertTheme2To3 } from 'src/services/theme_data/theme2_to_theme3.js'
|
||||||
|
|
||||||
|
const GENERIC_FONT_NAMES = new Set([
|
||||||
|
'serif',
|
||||||
|
'sans-serif',
|
||||||
|
'system-ui',
|
||||||
|
'cursive',
|
||||||
|
'fantasy',
|
||||||
|
'math',
|
||||||
|
'monospace',
|
||||||
|
])
|
||||||
|
|
||||||
export const useInterfaceStore = defineStore('interface', {
|
export const useInterfaceStore = defineStore('interface', {
|
||||||
state: () => ({
|
state: () => ({
|
||||||
localFonts: null,
|
localFonts: null,
|
||||||
|
|
@ -246,7 +256,7 @@ export const useInterfaceStore = defineStore('interface', {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setFontsList(value) {
|
setFontsList(value) {
|
||||||
this.localFonts = [...new Set(value.map((font) => font)).values()]
|
this.localFonts = [...new Set(value.map(({ family }) => family)).values()]
|
||||||
},
|
},
|
||||||
queryLocalFonts() {
|
queryLocalFonts() {
|
||||||
if (this.localFonts !== null) return
|
if (this.localFonts !== null) return
|
||||||
|
|
@ -706,11 +716,14 @@ export const useInterfaceStore = defineStore('interface', {
|
||||||
Object.entries(fontMap).forEach(([font, component]) => {
|
Object.entries(fontMap).forEach(([font, component]) => {
|
||||||
const family = mergedConfig[`font${font}`]
|
const family = mergedConfig[`font${font}`]
|
||||||
const variable = font === 'Monospace' ? '--monoFont' : '--font'
|
const variable = font === 'Monospace' ? '--monoFont' : '--font'
|
||||||
if (family) {
|
if (typeof family === 'string') {
|
||||||
|
const familyString = GENERIC_FONT_NAMES.has(family)
|
||||||
|
? family
|
||||||
|
: `"${family}"`
|
||||||
hacks.push({
|
hacks.push({
|
||||||
component,
|
component,
|
||||||
directives: {
|
directives: {
|
||||||
[variable]: `generic | "${family}"`,
|
[variable]: `generic | ${familyString}`,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue