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

Add root text styles #2102

Open
nandorojo opened this issue May 14, 2023 · 2 comments
Open

Add root text styles #2102

nandorojo opened this issue May 14, 2023 · 2 comments

Comments

@nandorojo
Copy link

nandorojo commented May 14, 2023

Motivation

It's really difficult to edit text styles to match our brand. I have custom text styles that I want, such as a custom font family. However, stream has so many text node styles that it would take so many hours to set the text styles for all of them.

Proposed solution

Add a text field, similar to colors, inside of style. All text nodes would inherit from this, and would be overridden at the theme level.

Acceptance Criteria

Since React Native often needs a different font-family per weight, maybe the API could look like this:

Something like:

const style = { 
    fontFamily: {
     // any time stream uses fontWeight, it should instead do fontFamily: style.fontFamily[weight]
     default: 'arial',
     600: 'arial-bold',
   },
   text: { // all text nodes inherit this style
     fontFamily: 'arial'
   }
}

Here I add fontFamily and text as keys to style. If Stream's internals want to set bold text, they should do fontFamily: style.fontFamily.bold in the text style.

Also, all Text nodes could set the style.text as their base style, allowing all text nodes to easily set a font family.

Curious to get feedback.

@vanGalilea
Copy link
Contributor

Hey @nandorojo thanks for reaching out, please update your description to follow our feature request temp.

@nandorojo
Copy link
Author

@vanGalilea thanks for the pointer, just did!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants