You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 29, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 29, 2022. It is now read-only.
I want to assign some custom fontsize and font family. I tried to put in below code in styleMap prop of "RNDraftView" but it did not appear on editor.
const styleMap = {
CODE: {
fontFamily: '"Inconsolata", "Menlo", "Consolas", monospace',
fontSize: 16,
padding: 2,
},
};
@DaniAkash how are we able to style the markdown within the webview? It shows there's a styleSheet prop that takes in a CSS string, but nothing I've added seems to work. I've tried things like: styleSheet={"font-size: 16px"} or styleSheet={{ fontSize: 16 }} or styleSheet={"fontSize: 16px"} and nothing seems to actually apply styles to it. I specifically want to change the height and the fontFamily of the rendered HTML.
Activity
quanghungit commentedon Jul 13, 2020
Any clues?
DaniAkash commentedon Jul 13, 2020
This style map actually gets rendered on the web. So, CSS supported styles as shown in this document will work.
for eg:
fontSize: "16px"coopdog95 commentedon Mar 28, 2022
@DaniAkash how are we able to style the markdown within the webview? It shows there's a
styleSheetprop that takes in a CSS string, but nothing I've added seems to work. I've tried things like:styleSheet={"font-size: 16px"}orstyleSheet={{ fontSize: 16 }}orstyleSheet={"fontSize: 16px"}and nothing seems to actually apply styles to it. I specifically want to change the height and the fontFamily of the rendered HTML.ccharliemagne commentedon Sep 6, 2022
@coopdog95
styleSheet={`.DraftEditor-root {padding: 16px; font-family: 'Arial'} .public-DraftStyleDefault-block {margin-bottom: 8px} li > .public-DraftStyleDefault-block {margin-bottom: 4px !important;}`}