Allow overriding CSS and JavaScript - #1418
Merged
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1418 +/- ##
=======================================
Coverage 87.76% 87.76%
=======================================
Files 29 29
Lines 1577 1577
Branches 220 220
=======================================
Hits 1384 1384
Misses 142 142
Partials 51 51 Continue to review full report at Codecov.
|
matthiask
approved these changes
Dec 3, 2020
matthiask
left a comment
Member
There was a problem hiding this comment.
I'm fine with this. I asked myself whether you wouldn't want to add your own CSS and JS on top instead of replacing the bundled assets (e.g. using {% block extrahead %} similar to Django's administration panel) but then I remembered that django-debug-toolbar isn't added to the <head> at all.
Contributor
Author
|
Thanks for reviewing, @matthiask! 💯 Merging. 🚀 |
Contributor
Author
|
Can we push a new release to PyPI with this soon? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If I want to override the CSS and JavaScript shipped with debug toolbar there is no easy way to do this cleanly.
This change adds two template blocks to the base template, which allows extending the template cleanly, patching just CSS and/or JavaScript, as follows:
I also fixed a minor syntax highlighting issue, but I included that with a separate commit. I hope that's fine.