Move mobile-nav background to CSS class (strict-CSP)#479
Merged
dereuromark merged 2 commits intomasterfrom Apr 26, 2026
Merged
Conversation
Drops the inline `style="background: linear-gradient(...)"` attribute on the mobile offcanvas in favour of a `.queue-mobile-nav-bg` class that reuses the existing `--queue-sidebar-bg` custom property. Removes the `style-src 'unsafe-inline'` requirement for this element.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #479 +/- ##
============================================
+ Coverage 77.14% 77.17% +0.02%
Complexity 950 950
============================================
Files 45 45
Lines 3216 3202 -14
============================================
- Hits 2481 2471 -10
+ Misses 735 731 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Continues the strict-CSP cleanup on top of #479's gradient fix. - Static `<th style="width:Npx">` widths in QueuedJobs/{view,migrate}.php and QueueProcesses/view.php → `.queue-col-w-50` / `.queue-col-w-200` classes in the layout. - `<div style="position:relative;height:400px">` chart wrapper in QueuedJobs/stats.php → `.queue-chart-wrapper` class. - Dynamic heatmap cell + legend colors in QueuedJobs/heatmap.php (`style="background-color:...;color:...;"`) → `data-bg-color` / `data-text-color` attributes; the layout's existing nonced `<script>` reads them and assigns to `el.style` (JS-driven style mutation is not subject to `style-src 'unsafe-inline'`). Templates now contain zero inline `style=` attributes.
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.
Summary
Drops the inline
style="background: linear-gradient(...)"attribute on the mobile-nav offcanvas in favour of a.queue-mobile-nav-bgclass defined in the layout's existing<style>block. The class reuses the existing--queue-sidebar-bgcustom property, so the visual is unchanged.This removes the
style-src 'unsafe-inline'requirement for this element. The remaining inline styles in admin templates (static<th style="width:...">widths, dynamic heatmap colors inQueuedJobs/heatmap.php) are left as follow-ups.Files changed
templates/layout/queue.php— add.queue-mobile-nav-bgrule + swapstyle=forclass=