Skip to content
This repository has been archived by the owner on May 16, 2022. It is now read-only.

add w-auto and h-auto #68

Merged
merged 1 commit into from
Jan 5, 2021
Merged

add w-auto and h-auto #68

merged 1 commit into from
Jan 5, 2021

Conversation

jeffreyyoung
Copy link
Contributor

No description provided.

@z0al
Copy link
Owner

z0al commented Jan 4, 2021

Thanks for opening this @jeffreyyoung 👏

Tip: To fix linting simply update your branch with the master and run

yarn format

It looks good to me but I'm still not sure if auto actually works as expected. On React Native Styling Cheat Sheet it's written that:

properties with default value auto marked with asterisk are do not actually have auto as their default value, they just behave like if they would in css if they had auto as their value. auto is not valid value for those properties in react-native

And both width and height are marked with *.

I couldn't find something in the official docs. Do you have a link for that?

@z0al z0al mentioned this pull request Jan 4, 2021
13 tasks
@jeffreyyoung
Copy link
Contributor Author

ooo good catch! I saw that cheat sheet, and assumed "auto" was a valid value 🤦‍♂️. I'm struggling to find documentation on using "auto" for height and width. These are a few random things I found:

From trying the following code samples I see that

  • <View style={[{"width": 25, "height": 25, backgroundColor: "purple"}, {"width": "yay"}]}/> <-- this throws an error
  • <View style={[{"width": 25, "height": 25, backgroundColor: "purple"}, {"width": "auto"}]}/> <-- this sets the width to behave like css auto
  • <View style={[{"width": 25, "height": 25, backgroundColor: "purple"}, {"width": null}]}/> <-- this also sets the width to behave like css auto

Honestly not 100% sure if "auto" is actually a supported value since it isn't well documented, however since I notice it's handled in the code I think it miiiight be. 🤷‍♂️

anyways I've been using this library in a side project and am really enjoying it and appreciate your work!

@z0al
Copy link
Owner

z0al commented Jan 4, 2021

Wow, great research, Thanks :)

The React Native example & Yoga code are enough for me to continue with this PR. We can always investigate this again if someone reports otherwise.

Copy link
Owner

@z0al z0al left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you 🙇

A git rebase & yarn format should fix the conflicts & lining issues.

@jeffreyyoung
Copy link
Contributor Author

sounds good! Just updated the pr

@z0al z0al merged commit d33c98d into z0al:master Jan 5, 2021
@github-actions
Copy link

github-actions bot commented Jan 5, 2021

🎉 This PR is included in version 0.11.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

2 participants