Skip to content

Conversation

Chiemezuo
Copy link

This is a first attempt at removing the inline styling for the PlaceholderStyles.tsx. The approach taken in this PR is one of editing the DOM manually (outside of React's typical Shadow DOM). While still far from a final approach, it's meant as an illustration of how I understood the inline styling problem. You can test this against the Wagtail CMS, and run the bakerydemo (also linked to the Wagtail CMS local repo), for the editing interface.

It is an attempt at resolving issue #460

Note:

  • The integration and performance tests were failing, so I commented them out locally to be able to push these changes.
  • In the absence of inline styles, the draftail test segment completely fails, so I skipped the tests. This will be revisited based on feedback.
  • Manipulation in the DOM (as opposed to the shadow DOM) happens here. This is not the most ideal pattern, but the idea of this initial draft is to show my understanding of the problem, and to take corrections/feedback on more ideal ways.
  • Stay on point and keep it small so it can be easily reviewed. For example, try to apply any general refactoring separately outside of the PR.
  • Consider adding unit tests, especially for bug fixes. If you don't, tell us why.
  • All new and existing tests pass, with 100% test coverage (npm run test:coverage)
  • Linting passes (npm run lint)
  • Consider updating documentation. If you don't, tell us why.
  • List the environments / platforms in which you tested your changes.

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.

1 participant