Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

fix(Avatar): add white border around avatar in contrast theme #795

Merged
merged 7 commits into from
Jan 31, 2019

Conversation

bcalvery
Copy link
Contributor

@bcalvery bcalvery commented Jan 29, 2019

This change adds properties for setting the border for the avatar, which is used in the contrast theme to draw a white border around the image.
Before:
image
After:
image

Known issues:
The example in the docs with a custom image value (using Icon instead of Image) isn't rendering correctly. It seems like the example is perhaps broken, because it doesn't respect avatar size property.

Default size:
image
Both set to 28:
image

@alinais
Copy link
Contributor

alinais commented Jan 30, 2019

The issue is that, for the second example we don't update the padding on the icon according to the size of the avatar. It seems to be an issue on our side.

@@ -10,6 +10,8 @@ const AvatarExampleImageCustomizationShorthand = () => (
 
<Avatar
image={
// This example does not react to the avatar size variable
Copy link
Contributor

@kuzhelov kuzhelov Jan 31, 2019

Choose a reason for hiding this comment

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

👍 thanks for spotting this!

@@ -2,5 +2,7 @@ import { AvatarVariables } from '../../../teams/components/Avatar/avatarVariable
import { Partial } from 'types/utils'

export default (siteVariables: any): Partial<AvatarVariables> => ({
avatarBorderColor: 'white',
Copy link
Contributor

Choose a reason for hiding this comment

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

would suggest to use color from siteVariables here (i.e. siteVariables.white), for the sake of consistency - or let me know if there any reason to not use it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Thanks!

Copy link
Contributor

@kuzhelov kuzhelov left a comment

Choose a reason for hiding this comment

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

please, just take a look on this comment before merge: https://github.com/stardust-ui/react/pull/795/files#r252747086 . Thank you!

@bcalvery bcalvery merged commit 335669c into master Jan 31, 2019
@layershifter layershifter deleted the fix/avatar-contrast-738 branch January 31, 2019 20:41
@kuzhelov kuzhelov mentioned this pull request Feb 26, 2019
1 task
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants