@@ -94,13 +94,13 @@ const shortcutsDisabled = loadState('theming', 'shortcutsDisabled', false)
9494
9595const background = loadState (' theming' , ' background' )
9696const themingDefaultBackground = loadState (' theming' , ' themingDefaultBackground' )
97- const shippedBackgroundList = loadState (' theming' , ' shippedBackgrounds' )
9897const isUserThemingDisabled = loadState (' theming' , ' isUserThemingDisabled' )
9998
10099console .debug (' Available themes' , availableThemes)
101100
102101export default {
103102 name: ' UserThemes' ,
103+
104104 components: {
105105 ItemPreview,
106106 NcCheckboxRadioSwitch,
@@ -123,6 +123,7 @@ export default {
123123 themes () {
124124 return this .availableThemes .filter (theme => theme .type === 1 )
125125 },
126+
126127 fonts () {
127128 return this .availableThemes .filter (theme => theme .type === 2 )
128129 },
@@ -141,9 +142,11 @@ export default {
141142 .replace (' {guidelines}' , this .guidelinesLink )
142143 .replace (' {linkend}' , ' </a>' )
143144 },
145+
144146 guidelinesLink () {
145147 return ' <a target="_blank" href="https://www.w3.org/WAI/standards-guidelines/wcag/" rel="noreferrer nofollow">'
146148 },
149+
147150 descriptionDetail () {
148151 return t (
149152 ' theming' ,
@@ -153,9 +156,11 @@ export default {
153156 .replace (' {designteam}' , this .designteamLink )
154157 .replace (/ \{ linkend\} / g , ' </a>' )
155158 },
159+
156160 issuetrackerLink () {
157161 return ' <a target="_blank" href="https://github.com/nextcloud/server/issues/" rel="noreferrer nofollow">'
158162 },
163+
159164 designteamLink () {
160165 return ' <a target="_blank" href="https://nextcloud.com/design" rel="noreferrer nofollow">'
161166 },
@@ -167,32 +172,12 @@ export default {
167172 },
168173 },
169174
170- mounted () {
171- this .updateGlobalStyles ()
172- },
173-
174175 methods: {
175176 updateBackground (data ) {
176177 this .background = (data .type === ' custom' || data .type === ' default' ) ? data .type : data .value
177- this .updateGlobalStyles ()
178178 this .$emit (' update:background' )
179179 },
180180
181- updateGlobalStyles () {
182- // Override primary-invert-if-bright and color-primary-text if background is set
183- const isBackgroundBright = shippedBackgroundList[this .background ]? .theming === ' dark'
184- if (isBackgroundBright) {
185- document .querySelector (' #header' ).style .setProperty (' --primary-invert-if-bright' , ' invert(100%)' )
186- document .querySelector (' #header' ).style .setProperty (' --color-primary-text' , ' #000000' )
187- // document.body.removeAttribute('data-theme-dark')
188- // document.body.setAttribute('data-theme-light', 'true')
189- } else {
190- document .querySelector (' #header' ).style .setProperty (' --primary-invert-if-bright' , ' no' )
191- document .querySelector (' #header' ).style .setProperty (' --color-primary-text' , ' #ffffff' )
192- // document.body.removeAttribute('data-theme-light')
193- // document.body.setAttribute('data-theme-dark', 'true')
194- }
195- },
196181 changeTheme ({ enabled, id }) {
197182 // Reset selected and select new one
198183 this .themes .forEach (theme => {
@@ -206,6 +191,7 @@ export default {
206191 this .updateBodyAttributes ()
207192 this .selectItem (enabled, id)
208193 },
194+
209195 changeFont ({ enabled, id }) {
210196 // Reset selected and select new one
211197 this .fonts .forEach (font => {
0 commit comments