Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customising font family throughout the design system #30

Closed
mtimofiiv opened this issue Aug 14, 2019 · 0 comments · Fixed by #40
Closed

Customising font family throughout the design system #30

mtimofiiv opened this issue Aug 14, 2019 · 0 comments · Fixed by #40

Comments

@mtimofiiv
Copy link

This comes from akveo/react-native-ui-kitten#569

I think you have a very nice looking and functioning design system. But the one thing in terms of styling I find lacking is the ability to set a font family, specifically in the React-Native part of it.

There's an issue now open there (linked above) but @artyorsh suggested it also get opened here as well!

The nice thing that react-native-elements does is that they allow you to use their ThemeProvider to overwrite individual styles for each of their components.

So you could have something like this:

import config from './config'

export default {
  colors: {
    primary: config.colors.brand
  },

  Text: {
    style: {
      fontFamily: config.fontFamilyRegular
    }
  },

  Button: {
    titleStyle: {
      fontFamily: config.fontFamilyBold,
      top: -1
    }
  },

  Input: {
    containerStyle: {
      marginTop: 15
    },

    labelStyle: {
      fontFamily: config.fontFamilyRegular,
      fontSize: 12
    },

    inputStyle: {
      fontFamily: config.fontFamilyRegular
    }
  },

  ListItem: {
    subtitleStyle: {
      color: config.colors.faded
    }
  },

  Card: {
    containerStyle: {
      backgroundColor: 'transparent',
      borderWidth: 0,
      borderColor: 'transparent'
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant