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

Clarify docs for config.stylesheet. There's strange behavior when given a string #774

Open
librick opened this issue Apr 29, 2024 · 0 comments

Comments

@librick
Copy link
Contributor

librick commented Apr 29, 2024

Is your feature request related to a problem? Please describe.

If users assign a string to config.stylesheet rather than an array, the stylesheet doesn't load and it's confusing to debug. I think either the docs should be improved to explicitly mention that users MUST use an array, or some validation should be added to tell the user that they used a bad value for config.stylesheet. This was really confusing when I tried to configure Homer to use a custom stylesheet.

In config.yml I had stylesheet: assets/custom.css (broken, don't copy this!). This wasn't working and I had to look at the Homer source code to learn why, specifically this part of App.vue where the code loops over the values in config.stylesheet. That led me to look at my dashboard's style tag, which showed this weird code:

image

Basically, because I used stylesheet: assets/custom.css (broken, don't copy this!), when it was looped over in App.vue, it looped over the characters of the string, treating each one as a stylesheet to import.

I also probably could've been tipped off by these weird 404'd requests:
image

Describe the solution you'd like
In the docs for config.yml, maybe add another comment to warn users that the value MUST be an array, not a string. I could've just read the docs more carefully but I'm guessing I'm not the only one to be tripped up by this.

Describe alternatives you've considered
You might also consider adding a more obvious failure mode (either show an error, fail to build, etc.) if config.stylesheet is provided but is not an array of strings.

Additional context
N/A. Thanks for working on a great project and contributing to open source!

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

No branches or pull requests

1 participant