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

Consistency in StyleSheet code #50

Open
dominicduffin1 opened this issue Dec 23, 2020 · 3 comments
Open

Consistency in StyleSheet code #50

dominicduffin1 opened this issue Dec 23, 2020 · 3 comments

Comments

@dominicduffin1
Copy link
Contributor

Is your feature request related to a problem? Please describe.
At present, most stylistic values are defined on a screen-by-screen basis in the StyleSheet.create() function. There are also some colors declared in a Colors.ts file. It feels difficult to ensure consistency between screens with this setup.

Describe the solution you'd like

My thinking is that it would help to ensure consistency if values (colors, lengths, amount of padding etc) were all defined in the constants folder along the lines of Colors.ts. This would provide a single point of reference for contributors (easing onboarding for new contributors), ease consistent style implementation, and aid maintainability by providing a single place from which to apply stylistic changes across the whole app.

Describe alternatives you've considered

An alternative option would be to create comprehensive documentation of styles for the app to serve as a point of reference for contributors when writing or editing StyleSheet.create() functions. This would still aid the onboarding process and ease aid consistent styling. If styles were to be changed, though, it would still be necessary to make the changes separately for each screen. If there are advantages to defining style values on a screen-by-screen basis that I am not aware of (I am not a React Native expert) this would be an option to consider.

@firstChairCoder
Copy link

Hello,

I would like to be assigned this. If it is not too much of a rearrangement, I would also suggest using the library restyle by Shopify. That would help keep our colors (initially at least) at a single point of reference.

Apart from that, just keeping the styles in a separate file per screen component is also a decent suggestion.

Cheers.

@BekahHW
Copy link
Owner

BekahHW commented Feb 2, 2022

@firstChairCoder awesome! I'll assign this to you. I'm fine with adding restyle to the project. It looks super useful.

@BekahHW BekahHW assigned BekahHW and firstChairCoder and unassigned BekahHW Feb 2, 2022
@BekahHW
Copy link
Owner

BekahHW commented Sep 30, 2022

@firstChairCoder are you still interested in this? I've made some updates to get the project moving again. If you're not interested, I'd like to open up this issue to a new contributor.

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

No branches or pull requests

3 participants