react-md-editor icon indicating copy to clipboard operation
react-md-editor copied to clipboard

Change color on textarea text

Open MartinJohannesNilsen opened this issue 4 years ago • 5 comments

Hi.

I want to change the color on the textarea-text, and have tried using the prop textareaProps={{ style: { color: "white" } }}, but something seems off. I am not that confident in passing props like this, so I do believe this may be a syntax-error.

I would be grateful if someone could have pointed me in the right direction

MartinJohannesNilsen avatar Mar 28 '21 15:03 MartinJohannesNilsen

https://github.com/uiwjs/react-md-editor/blob/c46b9fe0afeed20f2ac2b2ba5ba851b655f572cf/src/components/TextArea/index.less#L1-L116

You can change the style through CSS.

@Martinnilsen99

jaywcjlove avatar Mar 28 '21 15:03 jaywcjlove

@jaywcjlove

Thank you for your reply! I have tried editing the classes you provided, and tried in different browsers - but can't seem to change all the text in the edit-view. I want to have the notepad with black background and white text on everything except links. Have also tried editing the file you provided in my node_modules, but don't seem to get the results I want.

Do you have any clue why I am having these issues? Or have anyone done what I want or something similar already?

MartinJohannesNilsen avatar Mar 28 '21 17:03 MartinJohannesNilsen

https://github.com/uiwjs/react-md-editor/blob/c46b9fe0afeed20f2ac2b2ba5ba851b655f572cf/src/components/TextArea/Markdown.tsx#L20-L23

@Martinnilsen99 Color control is here.

jaywcjlove avatar Mar 29 '21 01:03 jaywcjlove

@Martinnilsen99 Refactored update

jaywcjlove avatar May 29 '21 07:05 jaywcjlove

This problem is similar to mine. I cant seem to change the text color and background color when highlighted.

I have trace the problem to this piece of code under textarea styling.

/**
 * Hack to apply on some CSS on IE10 and IE11
 */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
  /**
    * IE doesn't support '-webkit-text-fill-color'
    * So we use 'color: transparent' to make the text transparent on IE
    * Unlike other browsers, it doesn't affect caret color in IE
    */
  .@{md-editor}-text-input {
    color: transparent !important;
    &::selection {
      background-color: #accef7 !important;
      color: transparent !important;
    }
  }
}

I dont understand why !important was used but it seems to be stopping the customization. Please help.

chidexebere avatar Mar 07 '22 07:03 chidexebere