typography.js icon indicating copy to clipboard operation
typography.js copied to clipboard

React Native

Open steida opened this issue 7 years ago • 8 comments

I think Este needs this for React Native ASAP. Should not be hard. Universal typography FTW.

steida avatar Jul 25 '16 23:07 steida

That'd be amazing!

Yeah, this should totally be doable. Reuse the same options values but create React Native specific styles.

Is your thought that this would just auto-create a bunch of components wrapping the <Text> component? E.g. <H1>, <H2>, <Bold> etc.?

Haven't really dived deep into React Native so not 100% on styling conventions there but would love to support this.

KyleAMathews avatar Jul 25 '16 23:07 KyleAMathews

It'd be really amazing if there was a React Native Google Fonts plugin that'd auto-include fonts specified in the Typography.js theme.

KyleAMathews avatar Jul 25 '16 23:07 KyleAMathews

BTW, in-progress screenshot of design tools. Goal is to completely design typography in-browser and then export to JS module.

screen shot 2016-07-25 at 4 50 56 pm

KyleAMathews avatar Jul 25 '16 23:07 KyleAMathews

All we need for the React Native are constants and common vocabulary for https://github.com/este/este/blob/master/src/common/app/theme.js

Then the helper for fonts.

steida avatar Jul 26 '16 00:07 steida

Is your thought that this would just auto-create a bunch of components wrapping...

Not at all. https://twitter.com/estejs/status/757338696735653889 and https://twitter.com/estejs/status/757709752004710400

steida avatar Jul 26 '16 00:07 steida

Ok, universal components then 💃

For now perhaps you just need a este-specific wrapper around typography's toJSON function to pull out what you want — https://github.com/KyleAMathews/typography.js/blob/master/packages/typography/src/index.js#L66

So something like this?

import Typography from 'typography'
import funstonTheme from 'typography-theme-funston'

const typography = new Typography(funstonTheme)

export default esteTypographyWrapper(typography)

KyleAMathews avatar Jul 26 '16 00:07 KyleAMathews

Yeah, something like that. Will investigate soon. Thank you.

steida avatar Jul 26 '16 01:07 steida

any update on this?

fantapop avatar Mar 24 '17 06:03 fantapop