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

Layer #42

Closed
satya164 opened this issue Oct 26, 2016 · 3 comments
Closed

Layer #42

satya164 opened this issue Oct 26, 2016 · 3 comments
Assignees

Comments

@satya164
Copy link
Member

To have consistent styling on Android and iOS we need Layer component (have a better name?) which takes an elevation prop and renders a View with correct shadows on both Android and iOS.

We'll need this before working on any component with shadows.

@ahmedlhanafy
Copy link
Contributor

@satya164 i think this can be a function that takes an elevation value and returns the correct shadow, doing a component here is overkill

@satya164
Copy link
Member Author

satya164 commented Oct 26, 2016

@ahmedlhanafy I don't think so. I'd rather do
<Layer {...this.props} elevation={2} /> than doing
<View {...this.props} style={[ this.props.style, { elevation: elevationToShadow(2) } ]} /> to avoid unnecessary boilerplate everywhere.

@himanshusoni
Copy link

We can take inspiration from the paper from material-ui.

I second satya, on creating a component over here. It may have a certain padding and transition. Also, since elevation is android only, i'd suggest something like below for styles

// Layer component definition
render() {
    <View style=[theme.prepareElevation(this.props.elevation), { otherStyles }] >
     {this.props.children}
    </View>
}

satya164 added a commit that referenced this issue Oct 31, 2016
Since Google doesn't document the shadow values anywhere (it was documented earlier, but only upto 5dp), this is an approximation.
satya164 added a commit that referenced this issue Oct 31, 2016
Since Google doesn't document the shadow values anywhere (it was documented earlier, but only upto 5dp), this is an approximation.
satya164 added a commit that referenced this issue Oct 31, 2016
Since Google doesn't document the shadow values anywhere (it was documented earlier, but only upto 5dp), this is an approximation.
satya164 added a commit that referenced this issue Nov 2, 2016
Since Google doesn't document the shadow values anywhere (it was documented earlier, but only upto 5dp), this is an approximation.
This issue was closed.
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

3 participants