Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UseDashboardStylesheet does not load custom CSS #2373

Open
BartNetJS opened this issue Feb 26, 2024 · 3 comments
Open

UseDashboardStylesheet does not load custom CSS #2373

BartNetJS opened this issue Feb 26, 2024 · 3 comments

Comments

@BartNetJS
Copy link

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

@AsuraKev
Copy link

AsuraKev commented Mar 1, 2024

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

image

@odinserj
Copy link
Member

odinserj commented Mar 1, 2024

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.

@AsuraKev
Copy link

AsuraKev commented Mar 1, 2024

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

image

my dark.css

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants