Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Unable to change fontsize and font family  #20

Open

Description

@Raghvender-Kataria

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,
},
};

Any clues?

Activity

  1. quanghungit commented on Jul 13, 2020

    @quanghungit

    Any clues?

  2. DaniAkash commented on Jul 13, 2020

    @DaniAkash
    Member

    This style map actually gets rendered on the web. So, CSS supported styles as shown in this document will work.

    for eg: fontSize: "16px"

  3. coopdog95 commented on Mar 28, 2022

    @coopdog95

    @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.

  4. ccharliemagne commented on Sep 6, 2022

    @ccharliemagne

    @coopdog95 styleSheet={`.DraftEditor-root {padding: 16px; font-family: 'Arial'} .public-DraftStyleDefault-block {margin-bottom: 8px} li > .public-DraftStyleDefault-block {margin-bottom: 4px !important;}`}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions