Skip to content

Fix: docs(frontend): document CSP-safe styling conventions (no inline styles) - #1672

Merged
hman38705 merged 2 commits into
solutions-plug:mainfrom
brite-side0:simple/1670
Sep 30, 2026
Merged

hman38705 merged 2 commits into
solutions-plug:mainfrom
brite-side0:simple/1670

Conversation

@brite-side0

Copy link
Copy Markdown
Contributor

Closes #1670

Summary

Primary deliverable is documentation (frontend/docs/styling.md + pointers from CONTRIBUTING.md and frontend/README.md). The ESLint enforcement step is optional per the issue but recommended; before editing, verify which ESLint config format is actually active (the listed .eslintrc.js/.eslintrc.json files appear empty, and the project uses ESLint 9 + eslint-config-next which typically uses flat config). Ensure the chosen rule (react/forbid-dom-props for style) is compatible with the installed eslint-plugin-react version, and that adding it does not break existing code that legitimately uses style (e.g. dynamic CSS variables) — if such cases exist, document the approved escape hatch (e.g. CSS custom properties set via className) rather than disabling the rule. Reference commits 5bd5e51 and e80a15b in the doc for historical context.

Changes

  • Create the CSP-safe styling documentation. Explain the CSP constraint (inline style props are stripped/blocked in production, causing silent rendering failures), document the required CSS-class / CSS-module pattern established by the migration, note that no lint rule currently enforces this and recommend adding react/forbid-dom-props / react/forbid-component-props for style, and reference the two fix commits (5bd5e51, e80a15b) as historical context. Include correct/incorrect code examples. (frontend/docs/styling.md)
  • Add a short section (or bullet in the Code Style section) pointing contributors to frontend/docs/styling.md and summarizing the no-inline-styles rule, so the convention is discoverable from the main contributing guide. (CONTRIBUTING.md)
  • Add a brief pointer in the frontend README to docs/styling.md (e.g. under a 'Styling' or 'Documentation' section) so frontend contributors find the CSP-safe styling convention. (frontend/README.md)
  • Add the react/forbid-dom-props rule (with style in the forbid list) to the ESLint config to prevent regressions. Note: the repo currently has empty .eslintrc.js/.eslintrc.json placeholders and uses ESLint 9 with eslint-config-next; confirm the active flat-config file (e.g. eslint.config.js/.mjs) and add the rule there, or create the appropriate config file if none exists. (frontend/.eslintrc.js)
  • If the project uses flat config rather than .eslintrc.*, add the react/forbid-dom-props rule for style to the flat ESLint config so npm run lint (and CI) enforces the CSP-safe styling convention. (frontend/package.json)

@hman38705
hman38705 merged commit 82b3c6c into solutions-plug:main Sep 30, 2026
4 of 50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(frontend): document CSP-safe styling conventions (no inline styles)

2 participants