question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't apply fontSize to headings

See original GitHub issue

Hello!

I have simple React element with the following render method:

  render () {
    const bodyStyles = { fontSize: 12 }
    const titleStyles = { fontSize: 18 }

    return (
      <ScrollView style={styles.container}>
        <KeyboardAvoidingView behavior='position'>
          {
            this.props.items.map((item, index) => {
              return <View key={index} style={styles.item}>
                <Text style={styles.itemIndex}>{index + 1}</Text>
                <Markdown styles={{text: bodyStyles, heading: titleStyles, heading1: titleStyles}}>
                  # Heading
                  Ordinary text
                </Markdown>
              </View>
            })
          }
        </KeyboardAvoidingView>
      </ScrollView>
    )
  }

In this case, Heading has incorrect fontSize (12 instead of 18). I’ve tried without text style and with heading only, but no luck.

Used packages:

"react": "16.0.0-alpha.12",
"react-native": "0.47.1",
"react-native-simple-markdown": "^1.0.60-rc.3"

@CharlesMangwa , is it related to #37 ?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
vpelkonencommented, Dec 14, 2017

Might be related: I’ve noticed text styles seem to override other styles, like those set for link. (In my case I can’t set a custom color to link if text also has one.) Hope this helps to narrow it down. I probably don’t have the time and energy to look into it myself, though. 😕

0reactions
dbelchevcommented, Jan 26, 2018

@CharlesMangwa, as @vpelkonen mentioned, the problem here is that “text” style overwrite the other styling.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Font size change doesn't work on Headings H1, H1…
Going to Customize / Typography changing the font size of the 'Body' does work! But changing the font size of any 'Heading' (H1,...
Read more >
Can't change font for headings (CSS, Bootstrap)
You should put it as: h3, p { font-family: "Times New Roman", serif; }. All the tags and classes should be giving in...
Read more >
Topic: can't change font size in page titles - WordPress.com
Hi, I am having trouble changing font size for static pages (about, contact, etc) in the “lovecraft” theme. Under the Fonts menu, ...
Read more >
Resetting Default Heading and Body Fonts in Word
Here's how to change MicroSoft Word fonts default heading and body ... Select +Body and the size text you want, then click Set...
Read more >
Change the font size - Microsoft Support
Click the Manage Styles button (third from left at the bottom). ... Click the Set Defaults tab and pick the size you want...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found