-
Notifications
You must be signed in to change notification settings - Fork 53
fix: Remove extra margin around body element #193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Remove extra margin around body element #193
Conversation
Thanks for the pull request, @Lunyachek! This repository is currently maintained by 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 approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo 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:
🔘 Get a green buildIf 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:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Hi @openedx/committers-frontend! This is ready for review, as is the backport. Thanks! |
This issue seems to be bigger than just the margins. When inspecting I found vs I don't think that going through and overriding all the tinymce styles with |
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 ![]() |
Hi @Lunyachek and @brian-smith-tcril, just checking in on this! |
Friendly follow-up on this @Lunyachek @brian-smith-tcril |
I think this is likely a good solution, but I'd like to get a second opinion on using Context: Since my previous review this PR has been updated to follow the |
@Lunyachek @brian-smith-tcril - is this still in progress? |
9885bee
to
caba885
Compare
I hope - yes :) Branch have been rebased |
caba885
to
9f38b1d
Compare
Branch has been rebased again |
@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? |
Bump on this for both a review and a rebase. |
There was a problem hiding this 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:
- It does solve the problem
- 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'; |
There was a problem hiding this comment.
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?
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',
}
]
},
9f38b1d
to
627e4d5
Compare
@arbrandes I applied your suggestion. It works perfectly - thanks for pointing me in this direction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
|
||
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'; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
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.