Hangfire icon indicating copy to clipboard operation
Hangfire copied to clipboard

UseDashboardStylesheet does not load custom CSS

Open BartNetJS opened this issue 1 year ago • 3 comments

This my instrumentation

var assembly = typeof(Program).GetTypeInfo().Assembly;
var styleSheetName = "customhangfire.css";
var resourceName = assembly.GetManifestResourceNames()
                           .FirstOrDefault(name => name.EndsWith(styleSheetName));

if (resourceName != null)
{
    GlobalConfiguration.Configuration.UseDashboardStylesheet(assembly, resourceName);
} else
{
    Log.Warning($"Custom style sheet '{styleSheetName}' for hangfire not found as embedded source in assembly '{assembly.FullName}'");
}

but the css is not loaded:

image

BartNetJS avatar Feb 26 '24 11:02 BartNetJS

I think i am having this issue as well. None of my custom stuff is loaded, it just loads the original css

image

AsuraKev avatar Mar 01 '24 01:03 AsuraKev

The stylesheets are being embedded into the css* and css-dark* resources and not served separately. I think it is UTF-BOM character in the beginning of the custom CSS file, which prevents new styles from appearing. Please check your css files and remove the BOM character from the beginning of the file, the methods depends on your editor.

odinserj avatar Mar 01 '24 06:03 odinserj

Thanks. still not working. None of the styles were being applied

image

my dark.css

image

AsuraKev avatar Mar 01 '24 08:03 AsuraKev