Repository navigation
docs: document CSP-safe styling convention for frontend - #1671
Merged
Merged
Conversation
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
docs: document CSP-safe styling convention for frontend
What was solved
#1670 — docs(frontend): document CSP-safe styling conventions (no inline styles)
Document the CSP-safe styling convention for the frontend: explain that inline
styleprops are stripped by the Content-Security-Policy (per commits 5bd5e51 and e80a15b), mandate CSS classes/CSS modules instead, note the current lack of automated enforcement and whether an ESLint rule (e.g. react/forbid-dom-props forstyle) should back it up, and add a short pointer from CONTRIBUTING.md to the rule.Addressed:
style={{...}}props for anything affecting renderingChanges
CONTRIBUTING.md(modify)frontend/README.md(create)frontend/docs/styling.md(create)Approach
styleprops are stripped by the Content-Security-Policy (refs 5bd5e51, e80a15b), so rendering-affecting styles must use CSS classes / CSS modules instead ofstyle={{...}}.style) as a future option, without adding tooling or dependencies.Issues
Closes #1670