Skip to content

[EuiMarkdownFormat] Added a spacer plugin - #5059

Closed
elizabetdev wants to merge 8 commits into
elastic:masterfrom
elizabetdev:add-md-spacer-plugin
Closed

elizabetdev wants to merge 8 commits into
elastic:masterfrom
elizabetdev:add-md-spacer-plugin

Conversation

@elizabetdev

Copy link
Copy Markdown
Contributor

Summary

This PR adds a EuiSpacer plugin to EuiMarkdownFormat.

The EuiMarkdownFormat can be used outside of the EuiMarkdownEditor for example to render content like documentation. For this type of content, we need a way to add spacers. So I decided to create a plugin that adds a EuiSpacer with the ability to control the size prop.

spacer@2x

Also, I'm improving and simplifying the Getting Started page by adding spaces, removing duplicated content and providing links to our wiki files.

spacer-getting-started

Checklist

  • [ ] Check against all themes for compatibility in both light and dark modes
  • [ ] Checked in mobile
  • Checked in Chrome, Safari, Edge, and Firefox
  • [ ] Props have proper autodocs and playground toggles
  • Added documentation
  • [ ] Checked Code Sandbox works for the any docs examples
  • Added or updated jest tests
  • [ ] Checked for breaking changes and labeled appropriately
  • [ ] Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

@kibanamachine

Copy link
Copy Markdown
Contributor

@chandlerprall

Copy link
Copy Markdown
Contributor

[discussion]

I'm not sure explicitly adding spacers is the right approach.

In the second example, increasing the padding/margin before the next heading is likely better done by applying more margin to titles through component mapping to intercept headings and apply extra styling.

For the first example, if an app needed that extra spacing I could see them re-defining the hr rule to make it render only white space, or providing their own plugin+component for that spacing.

@cchaos

cchaos commented Aug 23, 2021

Copy link
Copy Markdown
Contributor

Agreed and I'll note another option I thought of which is to allow the markdown renderer to "respect whitespace". Meaning that if there were 5 white-space line-breaks in the editor, it would render 5 <br/> tags.

@cchaos

cchaos commented Sep 3, 2021

Copy link
Copy Markdown
Contributor

Related: #5141

@elizabetdev

Copy link
Copy Markdown
Contributor Author

I'm closing this PR. I'll come up with a different solution.

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.

4 participants