Anders Bjerner
08/01/2024, 9:32 AMWarren Buckley
08/01/2024, 1:22 PMWarren Buckley
08/01/2024, 1:22 PMWarren Buckley
08/01/2024, 1:23 PMWarren Buckley
08/01/2024, 1:24 PMts
import { UmbEntryPointOnInit } from '@umbraco-cms/backoffice/extension-api';
export const onInit: UmbEntryPointOnInit = (_host, _extensionRegistry) => {
// HACK THE PLANET
const link = document.createElement('link');
link.rel = 'stylesheet';
link.href = 'path/to/your/stylesheet.css'; // Replace with the actual path to your stylesheet
document.head.appendChild(link);
};
Anders Bjerner
08/01/2024, 1:24 PMWarren Buckley
08/01/2024, 1:24 PMWarren Buckley
08/01/2024, 1:25 PMWarren Buckley
08/01/2024, 1:26 PMAnders Bjerner
08/01/2024, 1:26 PMAnders Bjerner
08/01/2024, 1:28 PMh/umbraco/backoffice/a9c49848b115f12982e330ba15624c222dae4036/css/user-defined.css
and the default contents are /* This file can be overridden by placing a file with the same name in the /wwwroot/umbraco/backoffice/css folder of the website */
. So I suppose I could overwrite this file, but this is not very package friendly 😮Anders Bjerner
08/01/2024, 1:54 PMWarren Buckley
08/01/2024, 1:58 PMAnders Bjerner
08/01/2024, 2:33 PMAnders Bjerner
08/01/2024, 2:33 PMWarren Buckley
08/01/2024, 2:35 PMWarren Buckley
08/01/2024, 2:35 PMWarren Buckley
08/01/2024, 2:36 PMAnders Bjerner
08/01/2024, 3:18 PMWarren Buckley
08/01/2024, 3:18 PMMarkus Johansson
08/01/2024, 6:16 PMAnders Bjerner
08/01/2024, 6:46 PM/wwwroot/umbraco/backoffice/css/user-defined.css
should work, I can't get it to work. At least not when running the site through Visual Studio. I haven't tried deploying my site.
Setting up an ASP.NET rewrite rule for /umbraco/backoffice/css/user-defined.css
(and /umbraco/backoffice/{cacheBuster}/css/user-defined.css
) does however do the trick, in which case I can declare the CSS variables before Umbraco, meaning the UI doesn't flicker with default colors, then with the custom ones.
The login screen has a similar user defined CSS files which I guess can be hijacked the same way. I don't think themes apply to the login screen - even if my custom theme is given the highest weight.Warren Buckley
08/01/2024, 9:18 PM