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:
commit
22a14d8985
23 changed files with 56 additions and 234 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ const components = {
|
|||
Icon: null,
|
||||
Border: null,
|
||||
PanelHeader: null,
|
||||
Attachment: null,
|
||||
Panel: null,
|
||||
Chat: null,
|
||||
ChatMessage: null,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue