jpuri / react-draft-wysiwyg

A Wysiwyg editor build on top of ReactJS and DraftJS. https://jpuri.github.io/react-draft-wysiwyg
MIT License
6.41k stars 1.16k forks source link

Feature request: Can directions be icons or customizable? #471

Open copycut opened 6 years ago

copycut commented 6 years ago

It is possible to add a props to overwrite this "L", "C" & "R" letters?

https://github.com/jpuri/react-draft-wysiwyg/blob/3bcd7eec5f2c008c6a555d9b5453e41b2de5e3d5/src/renderer/Image/index.js#L64

jpuri commented 6 years ago

No its not possible right now, but good idea I should make it possible.

copycut commented 6 years ago

Thanks! Because for now, I must hide the content and use pseudo element to avoid this.

.rdw-image-alignment-option {
    background: none;
    height: 30px;
    width: 30px;
    text-indent: -999em;
    overflow: hidden;
    position: relative;
    color: #666;
    z-index: 1;

    &:before {
      content: '•';
      display: block;
      position: absolute;
      top: 0;
      left: 0;
      bottom: 0;
      right: 0;
      height: 30px;
      width: 30px;
      text-align: center;
      line-height: 32px;
      font-size: 20px;
      text-indent: 0;
      z-index: 2;
      background: #FFF;
    }

    &:first-child {
      &:before {
        content: '⇤';
      }
    }

    &:last-child {
      &:before {
        content: '⇥';
      }
    }
  }