Benjamin-Dobell / react-native-markdown-view

MarkdownView for React Native
MIT License
190 stars 77 forks source link

"text" style key overriding other styles #22

Closed jamsch closed 6 years ago

jamsch commented 6 years ago

Take the following as an example:

const styles = {
  heading2: {
    fontSize: 20,
  },
  text: {
    color: '#000',
    fontSize: 16,
  },
}

The above example has text is overriding any of heading2's rules. I still want to keep the text style as a default.

Updated: noticed that the paragraph rule allows for this. You'll also need to apply the same base text styles to all other elements (such as table cells and list items). The text key should rather be used as a fallback.


const styles = {
  heading2: {
    color: '#000',
    fontSize: 20,
  },
  paragraph: {
    color: '#000',
    fontSize: 16,
  },
}
`
martsie commented 6 years ago

Thanks for this issue, helped me figure out why headings weren't resizing properly for me.