-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Use shadow dom to render the toolbar #2266
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
89960a5
Use shadow dom to render the toolbar
federicobond d75cd33
Change shadow root element ID for fetching debug element
tim-schilling 46e3abf
Add USE_SHADOW_DOM setting to opt-out to shadow DOM toolbar rendering
federicobond 9c5fe81
Use JSDoc format for comments
federicobond fd7bc05
Add a note about the changed selector for CSS variables
federicobond aef37bf
Update frontend tests for new shadow DOM structure
federicobond a5d6a9e
Update changelog
federicobond b86e123
Add lookups to spelling wordlist
federicobond d709c1e
Merge branch 'main' into shadowdom
matthiask File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Use shadow dom to render the toolbar
- Loading branch information
commit 89960a582371f0a6964c96fccb6698ef311fa6d7
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,43 +1,46 @@ | ||
| {% load i18n static %} | ||
| {% block css %} | ||
| <link{% if toolbar.csp_nonce %} nonce="{{ toolbar.csp_nonce }}"{% endif %} rel="stylesheet" href="{% static 'debug_toolbar/css/print.css' %}" media="print"> | ||
| <link{% if toolbar.csp_nonce %} nonce="{{ toolbar.csp_nonce }}"{% endif %} rel="stylesheet" href="{% static 'debug_toolbar/css/toolbar.css' %}"> | ||
| {% endblock css %} | ||
| {% block js %} | ||
| <script{% if toolbar.csp_nonce %} nonce="{{ toolbar.csp_nonce }}"{% endif %} type="module" src="{% static 'debug_toolbar/js/toolbar.js' %}" async></script> | ||
| {% endblock js %} | ||
| <div id="djDebug" class="djdt-hidden" dir="ltr" | ||
| {% if not toolbar.should_render_panels %} | ||
| data-request-id="{{ toolbar.request_id }}" | ||
| data-render-panel-url="{% url 'djdt:render_panel' %}" | ||
| {% endif %} | ||
| {% url 'djdt:history_sidebar' as history_url %} | ||
| {% if history_url %} | ||
| data-sidebar-url="{{ history_url }}" | ||
| {% endif %} | ||
| data-default-show="{% if toolbar.config.SHOW_COLLAPSED %}false{% else %}true{% endif %}" | ||
| {{ toolbar.config.ROOT_TAG_EXTRA_ATTRS|safe }} data-update-on-fetch="{{ toolbar.config.UPDATE_ON_FETCH }}"> | ||
| <div class="djdt-hidden" id="djDebugToolbar"> | ||
| <ul id="djDebugPanelList"> | ||
| <li><a id="djHideToolBarButton" href="#" title="{% translate 'Hide toolbar' %}">{% translate "Hide" %} »</a></li> | ||
| <li> | ||
| <a id="djToggleThemeButton" href="#" title="{% translate 'Toggle Theme' %}"> | ||
| {% translate "Toggle Theme" %} {% include "debug_toolbar/includes/theme_selector.html" %} | ||
| </a> | ||
| </li> | ||
| <div id="djDebugShadowRootContainer" {{ toolbar.config.ROOT_TAG_EXTRA_ATTRS|safe }}> | ||
| <template shadowrootmode="open"> | ||
| {% block css %} | ||
| <link{% if toolbar.csp_nonce %} nonce="{{ toolbar.csp_nonce }}"{% endif %} rel="stylesheet" href="{% static 'debug_toolbar/css/print.css' %}" media="print"> | ||
| <link{% if toolbar.csp_nonce %} nonce="{{ toolbar.csp_nonce }}"{% endif %} rel="stylesheet" href="{% static 'debug_toolbar/css/toolbar.css' %}"> | ||
| {% endblock css %} | ||
| {% block js %} | ||
| <script{% if toolbar.csp_nonce %} nonce="{{ toolbar.csp_nonce }}"{% endif %} type="module" src="{% static 'debug_toolbar/js/toolbar.js' %}" async></script> | ||
| {% endblock js %} | ||
| <div id="djDebug" class="djdt-hidden" dir="ltr" | ||
| {% if not toolbar.should_render_panels %} | ||
| data-request-id="{{ toolbar.request_id }}" | ||
| data-render-panel-url="{% url 'djdt:render_panel' %}" | ||
| {% endif %} | ||
| {% url 'djdt:history_sidebar' as history_url %} | ||
| {% if history_url %} | ||
| data-sidebar-url="{{ history_url }}" | ||
| {% endif %} | ||
| data-default-show="{% if toolbar.config.SHOW_COLLAPSED %}false{% else %}true{% endif %}" | ||
| data-update-on-fetch="{{ toolbar.config.UPDATE_ON_FETCH }}"> | ||
| <div class="djdt-hidden" id="djDebugToolbarHandle"> | ||
| <div title="{% translate 'Show toolbar' %}" id="djShowToolBarButton"> | ||
| <span id="djShowToolBarD">D</span><span id="djShowToolBarJ">J</span>DT | ||
| </div> | ||
| </div> | ||
| <div class="djdt-hidden" id="djDebugToolbar"> | ||
| <ul id="djDebugPanelList"> | ||
| <li><a id="djHideToolBarButton" href="#" title="{% translate 'Hide toolbar' %}">{% translate "Hide" %} »</a></li> | ||
| <li> | ||
| <a id="djToggleThemeButton" href="#" title="{% translate 'Toggle Theme' %}"> | ||
| {% translate "Toggle Theme" %} {% include "debug_toolbar/includes/theme_selector.html" %} | ||
| </a> | ||
| </li> | ||
| {% for panel in toolbar.panels %} | ||
| {% include "debug_toolbar/includes/panel_button.html" %} | ||
| {% endfor %} | ||
| </ul> | ||
| </div> | ||
| {% for panel in toolbar.panels %} | ||
| {% include "debug_toolbar/includes/panel_button.html" %} | ||
| {% include "debug_toolbar/includes/panel_content.html" %} | ||
| {% endfor %} | ||
| </ul> | ||
| </div> | ||
| <div class="djdt-hidden" id="djDebugToolbarHandle"> | ||
| <div title="{% translate 'Show toolbar' %}" id="djShowToolBarButton"> | ||
| <span id="djShowToolBarD">D</span><span id="djShowToolBarJ">J</span>DT | ||
| <div id="djDebugWindow" class="djdt-panelContent djdt-hidden"></div> | ||
| </div> | ||
| </div> | ||
|
|
||
| {% for panel in toolbar.panels %} | ||
| {% include "debug_toolbar/includes/panel_content.html" %} | ||
| {% endfor %} | ||
| <div id="djDebugWindow" class="djdt-panelContent djdt-hidden"></div> | ||
| </template> | ||
| </div> |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -492,7 +492,7 @@ could add a **debug_toolbar/base.html** template override to your project: | |
|
|
||
| {% block css %}{{ block.super }} | ||
| <style> | ||
| :root { | ||
| :host { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't work because the |
||
| --djdt-font-family-primary: 'Roboto', sans-serif; | ||
| } | ||
| </style> | ||
|
|
||
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
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.
Uh oh!
There was an error while loading. Please reload this page.