-
Notifications
You must be signed in to change notification settings - Fork 116
[V2 Snackbar] Added Elevation Tokens to Snackbar #788
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds elevation and shadow to the Fluent Snackbar component by introducing a new token for elevation values and applying a shadow modifier in the composable.
- Imported
shadow
API and applied.shadow()
to the Snackbar container - Introduced
shadowElevationValue
token mapping eachSnackbarStyle
to aDp
elevation - Added corresponding method in
SnackBarTokens
and updated imports
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
fluentui_notification/src/main/java/com/microsoft/fluentui/tokenized/notification/Snackbar.kt | Imported shadow API, retrieved elevation from token, and applied .shadow() modifier |
fluentui_core/src/main/java/com/microsoft/fluentui/theme/token/controlTokens/SnackbarTokens.kt | Added shadowElevationValue composable method mapping styles to Dp elevations |
Comments suppressed due to low confidence (2)
fluentui_core/src/main/java/com/microsoft/fluentui/theme/token/controlTokens/SnackbarTokens.kt:95
- [nitpick] Add KDoc to
shadowElevationValue
explaining its purpose and detailing elevation values for eachSnackbarStyle
.
@Composable
fluentui_core/src/main/java/com/microsoft/fluentui/theme/token/controlTokens/SnackbarTokens.kt:96
- Add automated tests for
shadowElevationValue
to ensure eachSnackbarStyle
returns the correct elevation.
open fun shadowElevationValue(snackBarInfo: SnackBarInfo): Dp {
fluentui_notification/src/main/java/com/microsoft/fluentui/tokenized/notification/Snackbar.kt
Outdated
Show resolved
Hide resolved
fluentui_notification/src/main/java/com/microsoft/fluentui/tokenized/notification/Snackbar.kt
Show resolved
Hide resolved
…enized/notification/Snackbar.kt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Composable | ||
open fun shadowElevationValue(snackBarInfo: SnackBarInfo): Dp { | ||
return when (snackBarInfo.style) { | ||
SnackbarStyle.Neutral -> FluentGlobalTokens.ShadowTokens.Shadow02.value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we have common shadow for all styles ?
Changes
Added Elevation and Shadow to Fluent Snackbar V2
Screenshots
Pull request checklist
This PR has considered: