Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"jquery": "3.6.1",
"popper.js": "1.16.1",
"prop-types": "15.8.1",
"raw-loader": "4.0.2",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-helmet": "^6.1.0",
Expand Down
17 changes: 14 additions & 3 deletions src/components/bulk-email-tool/text-editor/TextEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,25 @@
import 'tinymce/plugins/codesample';
import '@edx/tinymce-language-selector';

import contentUiCss from 'tinymce/skins/ui/oxide/content.css';
import contentCss from 'tinymce/skins/content/default/content.css';
/* eslint import/no-webpack-loader-syntax: off */
// 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';

export default function TextEditor(props) {
const {
onChange, onKeyUp, onInit, disabled, value,
} = props;

let contentStyle;
// In the test environment this causes an error so set styles to empty since they aren't needed for testing.
try {
contentStyle = [contentCss, contentUiCss].join('\n');

Check warning on line 34 in src/components/bulk-email-tool/text-editor/TextEditor.jsx

View check run for this annotation

Codecov / codecov/patch

src/components/bulk-email-tool/text-editor/TextEditor.jsx#L33-L34

Added lines #L33 - L34 were not covered by tests
} catch (err) {
contentStyle = '';

Check warning on line 36 in src/components/bulk-email-tool/text-editor/TextEditor.jsx

View check run for this annotation

Codecov / codecov/patch

src/components/bulk-email-tool/text-editor/TextEditor.jsx#L36

Added line #L36 was not covered by tests
}

return (
<Editor
initialValue=""
Expand All @@ -38,7 +49,7 @@
'formatselect fontselect bold italic underline forecolor | codesample bullist numlist alignleft aligncenter alignright alignjustify indent | blockquote link image code ',
skin: false,
content_css: false,
content_style: `${contentUiCss.toString()}\n${contentCss.toString()}`,
content_style: contentStyle,
extended_valid_elements: 'span[lang|id] -span',
block_unsupported_drop: false,
image_advtab: true,
Expand Down
4 changes: 4 additions & 0 deletions src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@

@import "~@edx/frontend-component-header/dist/index";
@import "~@edx/frontend-component-footer/dist/footer";

body {
margin: 0 !important;
}