94485: Use relative path for theme CSS

This bug was originally fixed in #1642 but reintroduced in #1805
This commit is contained in:
Yury Bondarenko
2022-09-20 16:21:01 +02:00
parent c844423fc3
commit 594b6d61c3
2 changed files with 2 additions and 2 deletions

View File

@@ -413,7 +413,7 @@ describe('ThemeService', () => {
link.setAttribute('rel', 'stylesheet');
link.setAttribute('type', 'text/css');
link.setAttribute('class', 'theme-css');
link.setAttribute('href', '/custom-theme.css');
link.setAttribute('href', 'custom-theme.css');
expect(headSpy.appendChild).toHaveBeenCalledWith(link);
});

View File

@@ -182,7 +182,7 @@ export class ThemeService {
link.setAttribute('rel', 'stylesheet');
link.setAttribute('type', 'text/css');
link.setAttribute('class', 'theme-css');
link.setAttribute('href', `/${encodeURIComponent(themeName)}-theme.css`);
link.setAttribute('href', `${encodeURIComponent(themeName)}-theme.css`);
// wait for the new css to download before removing the old one to prevent a
// flash of unstyled content
link.onload = () => {