[dev] Remove many inlined style attributes#5908
Conversation
Run: grep -rI --include=\*.html\* --exclude=\*.svg 'style=' app/ > style_src_attr.txt
BenTopping
left a comment
There was a problem hiding this comment.
Nice - definitely good to move to one consistent way of styling.
Are there are lot of remaining inline-styles to change? I assume there are some trickier ones left?
|
There are some trickier ones left: In-lining widths is probably the trickiest: A larger problem is old jQuery which just doesn't understand the concept of CSP, there are now updates to the jQuery library which can handle this smoothly. But that's a challenge for another PR. |
The bootstrap equivalent class="d-none" overrides the display:block that is used as part of loading interactivity.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## sh51/nonce-security-blob-2 #5908 +/- ##
===========================================================
Coverage 84.82% 84.83%
===========================================================
Files 1492 1492
Lines 33936 33936
Branches 3613 3613
===========================================================
+ Hits 28787 28788 +1
+ Misses 4302 4299 -3
- Partials 847 849 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Removes many usages - but not all - of inline style attributes, replacing them with the Bootstrap 4 equivalents.
Based on #5907 and a stepping stone to improved application security - see https://centralcsp.com/docs/style-src-attr
Changes proposed in this pull request
style='display: none'withclass="d-none"style='text-align: center'withclass="text-center"style="background:red"with custom.bg-redstyleInstructions for Reviewers
[All PRs] - Confirm PR template filled
[Feature Branches] - Review code
[Production Merges to
main]- Check story numbers included
- Check for debug code
- Check version