Skip to content

Unable to override styles #58

Description

@colinbes

Using: Expo@44.0.6 on a Mac and running in IOS Simulator.

I am trying to override the font style for codeBlock and inlineCode, see below, but continue to get message that courier font is not found even though I am setting font to Courier New.

If I edit style.js file and substitute "Courier New" for "Courier" for codeBlock and inlineCode then it works.

It doesn't appear that my styles overrides styles.js

Additionally I am using Expo if this makes a difference

const RecipeDetailsView = (props: RecipeTableProps) => {
  return (
    <Modal      
    transparent={false}    
    visible={props.isVisible}                         
  >
    <View style={{paddingTop: 36,
                  justifyContent: 'center',
                  alignItems: 'center', 
                  height: 90}}>
      <Button title="Close" onPress={props.onClose} />
    </View>
    <View style={{marginHorizontal: 10}}>
      <ScrollView >
        <MarkdownView styles={markdownStyle} >
          {text}
        </MarkdownView>
      </ScrollView>
    </View>
  </Modal>
  )
}

const text = `
hello \`there\`


const markdownStyle = ({
  codeBlock: {
    fontFamily: "Arial",
    fontWeight: '500',
  },
  inlineCode: {
    backgroundColor: 'rgba(128, 128, 128, 0.25)',
    fontFamily: 'Arial',
    fontWeight: '500',
  },
})

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions