Skip to content

Conversation

Lunyachek
Copy link
Contributor

This pull request proposes fixing the margin around the body element. This margin comes from the tinyMCE styles. In cases where we don't have a custom theme, and the header and footer are white, it's not noticeable (1st screenshot). However, if the header and footer have any color, it immediately stands out (2nd and 3rd screenshots). The important property is set not by chance, as without it, the styles from the tinyMCE override the styles from the index.scss file.

Снимок экрана 2024-02-19 в 17 02 09
Снимок экрана 2024-02-15 в 11 37 22
Снимок экрана 2024-02-15 в 11 38 08

@openedx-webhooks
Copy link

openedx-webhooks commented Feb 19, 2024

Thanks for the pull request, @Lunyachek!

This repository is currently maintained by @openedx/committers-frontend.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.


Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Feb 19, 2024
Copy link

codecov bot commented Feb 19, 2024

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.14%. Comparing base (20ef900) to head (627e4d5).
⚠️ Report is 19 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #193      +/-   ##
==========================================
+ Coverage   84.02%   84.14%   +0.11%     
==========================================
  Files          47       47              
  Lines         695      700       +5     
  Branches      135      135              
==========================================
+ Hits          584      589       +5     
  Misses        111      111              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mphilbrick211
Copy link

Hi @openedx/committers-frontend! This is ready for review, as is the backport. Thanks!

@brian-smith-tcril brian-smith-tcril self-requested a review March 29, 2024 16:06
@brian-smith-tcril
Copy link
Contributor

This issue seems to be bigger than just the margins. When inspecting I found

image

image

vs

image

image

I don't think that going through and overriding all the tinymce styles with !important is a sustainable solution, have you looked into any recommended strategies for not having tinymce styles leak out into the rest of the page?

@Lunyachek
Copy link
Contributor Author

Lunyachek commented Apr 10, 2024

I don't think that going through and overriding all the tinymce styles with !important is a sustainable solution, have you looked into any recommended strategies for not having tinymce styles leak out into the rest of the page?

You're definitely right! I looked deeper and found a solution in the MFE discussions - https://github.com/openedx/frontend-app-discussions/blob/master/src/components/TinyMCEEditor.jsx I applied the fix in the same way

Снимок экрана 2024-04-10 в 13 53 44

@mphilbrick211
Copy link

Hi @Lunyachek and @brian-smith-tcril, just checking in on this!

@mphilbrick211
Copy link

Hi @Lunyachek and @brian-smith-tcril, just checking in on this!

Friendly follow-up on this @Lunyachek @brian-smith-tcril

@brian-smith-tcril
Copy link
Contributor

I think this is likely a good solution, but I'd like to get a second opinion on using raw-loader. @arbrandes thoughts?

Context: Since my previous review this PR has been updated to follow the raw-loader pattern for loading TinyMCE styles that we are using in the discussions MFE. I'm just not sure if this is a pattern we want to continue using, or if we should be looking for a pattern we like more to apply in places we are currently using this pattern.

@mphilbrick211
Copy link

@Lunyachek @brian-smith-tcril - is this still in progress?

@Lunyachek Lunyachek force-pushed the lunyachek/fix/body-extra-margin-master branch from 9885bee to caba885 Compare February 20, 2025 11:50
@Lunyachek
Copy link
Contributor Author

@Lunyachek @brian-smith-tcril - is this still in progress?

I hope - yes :) Branch have been rebased

@Lunyachek Lunyachek force-pushed the lunyachek/fix/body-extra-margin-master branch from caba885 to 9f38b1d Compare July 2, 2025 14:26
@Lunyachek
Copy link
Contributor Author

Branch has been rebased again

@sarina
Copy link
Contributor

sarina commented Aug 26, 2025

@brian-smith-tcril @arbrandes this is our 2nd oldest PR in the whole Open edX project! Any chance we could get movement on a review?

@Lunyachek could you rebase and addressed failing checks?

@sarina sarina moved this from Ready for Review to Waiting on Author in Contributions Sep 5, 2025
@sarina sarina moved this from Waiting on Author to Ready for Review in Contributions Sep 5, 2025
@sarina
Copy link
Contributor

sarina commented Sep 5, 2025

Bump on this for both a review and a rebase.

Copy link
Contributor

@arbrandes arbrandes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to come back to haunt us when we try to move off of Webpack, but:

  1. It does solve the problem
  2. There's precedent in frontend-app-discussions

Still, I would prefer we try Asset Module syntax instead. It is more similar to what Vite and Rsbuild are doing, don't require a new dependency, and might not require an eslint exclusion.

// eslint-disable-next-line import/no-unresolved
import contentUiCss from '!!raw-loader!tinymce/skins/ui/oxide/content.css';
// eslint-disable-next-line import/no-unresolved
import contentCss from '!!raw-loader!tinymce/skins/content/default/content.css';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we try this instead, as per https://webpack.js.org/guides/asset-modules/#replacing-inline-loader-syntax?

Suggested change
import contentCss from '!!raw-loader!tinymce/skins/content/default/content.css';
import contentCss from 'tinymce/skins/content/default/content.css?raw';

We already have local webpack configuration in this MFE anyway, so might as well add that stanza there, too:

module: {
    rules: [
     {
       resourceQuery: /raw/,
       type: 'asset/source',
     }
    ]
  },

@Lunyachek Lunyachek force-pushed the lunyachek/fix/body-extra-margin-master branch from 9f38b1d to 627e4d5 Compare September 29, 2025 22:10
@Lunyachek
Copy link
Contributor Author

Lunyachek commented Sep 29, 2025

@arbrandes I applied your suggestion. It works perfectly - thanks for pointing me in this direction

Copy link
Contributor

@arbrandes arbrandes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@arbrandes arbrandes merged commit 7ddc950 into openedx:master Sep 30, 2025
6 checks passed
@github-project-automation github-project-automation bot moved this from Ready for Review to Done in Contributions Sep 30, 2025

import contentUiCss from 'tinymce/skins/ui/oxide/content.css';
import contentCss from 'tinymce/skins/content/default/content.css';
import contentCss from 'tinymce/skins/content/default/content.css?raw';
Copy link
Contributor

@brian-smith-tcril brian-smith-tcril Sep 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The !!raw-loader version of this was updating both the contentUiCss import and the contentCss import. Was the contentUiCss change not needed or should that have ?raw added too?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I missed that. @Lunyachek?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants