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

Make font families configurable #1757

Closed
GergelyKalmar opened this issue Apr 8, 2023 · 2 comments · Fixed by #1760
Closed

Make font families configurable #1757

GergelyKalmar opened this issue Apr 8, 2023 · 2 comments · Fixed by #1760

Comments

@GergelyKalmar
Copy link
Contributor

Currently it's not that simple to configure font families due to the way toolbar.css is written. It would be great if at least the font families were configurable via CSS variables (similar to how the Django admin site does it: https://docs.djangoproject.com/en/4.2/ref/contrib/admin/#theming-support). The existing css block already allows us to inject custom CSS, so we could use the same technique if the style sheet was using variables.

This is mostly to be able to make the look of the toolbar consistent across different systems.

@matthiask
Copy link
Member

I'm open to the idea of introducing more CSS variables into our CSS given that I have been the one to suggest and implement the CSS variables support for Django's admin panel :-)

I generally don't think everything has to be configurable though, especially not for a debug-only tool. I don't immediately see the value of configurable font families either since we're using the same list of font families as Django's admin does, which should basically give a good fallback for every platform out there without having to provide web fonts of our own.

The main value of the admin's configurability for me is that there's now an easy way to visually distinguish different environments of the same app (e.g. production and stage). I have never used the option to change the font family itself.

So, long story short: I don't immediately see the benefits and I'm slightly against introducing the additional complexity given the previous point. I definitely won't do the work required myself but I'll certainly help with reviewing and releasing if it comes to that.

Thanks!

@GergelyKalmar GergelyKalmar mentioned this issue Apr 10, 2023
2 tasks
@GergelyKalmar
Copy link
Contributor Author

I fully agree with regards to the configurability and YAGNI. I have a specific need where I have to configure font families: I'm developing an opinionated set of Django tools which do ship and set a specific font for both the admin site as well as the debug toolbar. This is to ensure a consistent look for the admin site and the toolbar when developing locally and also for the CI tests (screenshots are part of the test suite).

Theming support here is a relatively niche feature that I suppose not many would need (could be useful for third-party panel developers though), which is why I thought it's not worth documenting it yet. Nonetheless, making this work is a simple change that I think is worth doing. Then whenever a new need arises, the theming support can be extended further by simply introducing further CSS variables and refactoring the CSS a tiny bit accordingly.

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

Successfully merging a pull request may close this issue.

2 participants