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

feat: adjust elevation usage in components based on Surface #3154

Merged
merged 2 commits into from
Apr 21, 2022

Conversation

lukewalczak
Copy link
Member

@lukewalczak lukewalczak commented Apr 16, 2022

  • After introducing the new Surface functionality according to the doc comment saying:

Note: In version 2 the elevation prop was accepted via style prop i.e. style={{ elevation: 4 }}. It's no longer supported with theme version 3 and you should use elevation property instead.

I've moved the elevation style in Surface to be at the end, so there won't be an option to override it via styles.

  • In the components based on Surface where previously there was an option to use different elevations, I've introduced a dedicated prop.

  • There are couple more components based on Surface but elevation will be adjusted in them separaterly.

  • With theme version 2 nothing has been changed.

More notes:

  • Banner, Searchbar and Snackbar received elevation prop
  • Chip, Card, Button, will receive a new mode with elevation
  • Appbar and FAB will receive elevated (boolean) prop to enable it on demand
  • BottomNavigation won't have elevation with theme version 3
  • Menu, AnimatedFAB and FAB.Group should always have an elevation

Summary

Test plan

  • snapshots are not updated which means there is no regression

@github-actions
Copy link

The mobile version of example app from this branch is ready! You can see it here

.

@callstack-bot
Copy link

Hey @lukewalczak, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

@github-actions
Copy link

The mobile version of example app from this branch is ready! You can see it here

.

Copy link
Contributor

@Drakeoon Drakeoon left a comment

Choose a reason for hiding this comment

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

This looks good to me. I'm personally against overriding/supporting custom elevation in elements like Cards, but this change requires a bigger shift in how we approach components, so let's leave it like that for now

@lukewalczak lukewalczak merged commit 980bd3c into next Apr 21, 2022
@lukewalczak lukewalczak deleted the feat/adjust-shadows branch April 21, 2022 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants