Skip to content

Commit

Permalink
Merge pull request #111 from mynameisguy/initialCSSText
Browse files Browse the repository at this point in the history
adding initialCSSText option
  • Loading branch information
stulip authored Aug 24, 2021
2 parents 57861f7 + 4f0cdc0 commit 2c2b5db
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export interface RichEditorProps extends WebViewProps {
caretColor?: string; // cursor/selection color
placeholderColor?: string; // editor placeholder text color
contentCSSText?: string; // editor content css text
initialCSSText?: string; // editor global css initial text
cssText?: string; // editor global css text
};
}
Expand Down
4 changes: 3 additions & 1 deletion src/RichEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ export default class RichTextEditor extends Component {
that.layout = {};
that.selectionChangeListeners = [];
const {
editorStyle: {backgroundColor, color, placeholderColor, cssText, contentCSSText, caretColor} = {},
editorStyle: {backgroundColor, color, placeholderColor, initialCSSText, cssText, contentCSSText} = {},
editorStyle: {backgroundColor, color, placeholderColor, initialCSSText, cssText, contentCSSText, caretColor} = {},
html,
pasteAsPlainText,
onPaste,
Expand All @@ -74,6 +75,7 @@ export default class RichTextEditor extends Component {
color,
caretColor,
placeholderColor,
initialCSSText,
cssText,
contentCSSText,
pasteAsPlainText,
Expand Down
6 changes: 3 additions & 3 deletions src/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ function createHTML(options = {}) {
placeholderColor = '#a9a9a9',
contentCSSText = '',
cssText = '',
initialCSSText = '',
pasteAsPlainText = false,
pasteListener = false,
keyDownListener = false,
Expand All @@ -45,12 +46,11 @@ function createHTML(options = {}) {
<title>RN Rich Text Editor</title>
<meta name="viewport" content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0">
<style>
${initialCSSText}
* {outline: 0px solid transparent;-webkit-tap-highlight-color: rgba(0,0,0,0);-webkit-touch-callout: none;box-sizing: border-box;}
html, body { margin: 0; padding: 0;font-family: Arial, Helvetica, sans-serif; font-size:1em; height: 100%}
body { overflow-y: hidden; -webkit-overflow-scrolling: touch;background-color: ${backgroundColor};caret-color: ${caretColor};}
.content {font-family: Arial, Helvetica, sans-serif;color: ${color}; width: 100%;${
!useContainer ? 'height:100%;' : ''
}-webkit-overflow-scrolling: touch;padding-left: 0;padding-right: 0;}
.content {font-family: Arial, Helvetica, sans-serif;color: ${color}; width: 100%;${!useContainer ? 'height:100%;' : ''}-webkit-overflow-scrolling: touch;padding-left: 0;padding-right: 0;}
.pell { height: 100%;} .pell-content { outline: 0; overflow-y: auto;padding: 10px;height: 100%;${contentCSSText}}
</style>
<style>
Expand Down

0 comments on commit 2c2b5db

Please sign in to comment.