Merge branch 'themes-3-1' into 'develop'

Themes 3.1: You can (not) overthink

See merge request pleroma/pleroma-fe!2209
This commit is contained in:
HJ 2025-08-14 09:01:15 +00:00
commit 22a14d8985
23 changed files with 56 additions and 234 deletions

View file

@ -42,6 +42,7 @@ export const createStyleSheet = (id, priority = 1000) => {
export const adoptStyleSheets = throttle(() => {
console.log('adopt')
if (supportsAdoptedStyleSheets) {
document.adoptedStyleSheets = Object
.values(stylesheets)
@ -137,8 +138,7 @@ export const tryLoadCache = async () => {
eagerStyles.ready = true
lazyStyles.ready = true
// Don't do this, we need to wait until config adopts its styles first
//adoptStyleSheets()
adoptStyleSheets()
console.info(`Loaded theme from cache`)
return true
@ -253,6 +253,7 @@ export const applyConfig = (input) => {
const styleSheet = createStyleSheet('theme-holder', 30)
styleSheet.clear()
styleSheet.addRule(`:root { ${rules} }`)
// TODO find a way to make this not apply to theme previews

View file

@ -244,9 +244,6 @@ export const convertTheme2To3 = (data) => {
case 'tooltip':
rule.component = 'Popover'
break
case 'attachment':
rule.component = 'Attachment'
break
case 'ChatMessage':
rule.component = 'Button'
break

View file

@ -33,7 +33,6 @@ const components = {
Icon: null,
Border: null,
PanelHeader: null,
Attachment: null,
Panel: null,
Chat: null,
ChatMessage: null,