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

Option to set/override editor preview class #99

Closed
sn3p opened this issue Jul 12, 2019 · 3 comments
Closed

Option to set/override editor preview class #99

sn3p opened this issue Jul 12, 2019 · 3 comments

Comments

@sn3p
Copy link

sn3p commented Jul 12, 2019

It would be nice to have more control over the preview styling.
In our app users can write content (in EasyMDE) and we render this content with specific styling. I want to apply the same styling to the preview in EasyMDE without having to override default styling from .editor-preview and .editor-preview-side.

Proposal

Introduce a classname solely for preview content styling, e.g. .editor-preview-content. And use .editor-preview and .editor-preview-side only for positioning the preview within the editor.

In addition introduce an option to set a custom class(es):

const editor = new EasyMDE({
  // Default class
  previewClass: "editor-preview-content",
  // Custom class
  previewClass: "custom-editor",
  // Default and custom class
  previewClass: ["editor-preview-content", "custom-overrides"],
});

Personally I think editor-preview as default for the content would be better, and use .editor-preview-full and .editor-preview-side for internal display variants.

Alternative solution would be building a separate css file for the bare editor styling, e.g. easymde-nopreview.css. This way we have more control over what styling we import.

Related issues (from SimpleMDE):

@sn3p sn3p changed the title Option to set editor preview class(es) Option to set/override editor preview class Jul 12, 2019
@Ionaru
Copy link
Owner

Ionaru commented Jul 12, 2019

@sn3p, please have a look at #100, does this work for you?

@sn3p
Copy link
Author

sn3p commented Jul 12, 2019

Wow thats was quick ⚡️
Thanks, I will check this out ASAP!

@sn3p
Copy link
Author

sn3p commented Jul 13, 2019

@Ionaru tested and works!

@Ionaru Ionaru closed this as completed in 71170a7 Jul 13, 2019
Ionaru added a commit that referenced this issue Jul 13, 2019
Added option to override the preview screen styling, closes #99
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants