Skip to content

Percentages are handled in confusing way #81

@michalchudziak

Description

@michalchudziak

Percent values are supported natively since React Native 0.43. EStyleSheet passes them through to original StyleSheet except cases, when you use calculations with percents, e.g. "100% - 20". Percents are calculated relative to screen width/height on application launch.

The way library handles it right now seems to be confusing. How about splitting percentages based on parent and screen to two (or three) separate units.

My proposal would be to handle it the way it's working on the web, so:

  • X% - uses native RN implementation.
  • Xvw - uses screen's width
  • Xvh - uses screen's height

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions