-
Notifications
You must be signed in to change notification settings - Fork 109
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
Move Avatar
+ AvatarStack
styles to PVC
#1607
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
93eafeb
Add Avatar + AvatarStack styles from PCSS
simurai 5a0fe66
Convert .scss to .pcss
simurai 7c30a89
Update previews
simurai fe0d6d5
Create perfect-jokes-switch.md
simurai ab1e22a
Generating component snapshots
simurai 3fc0bd1
Only use 1 avatar as default
simurai fbfe4c8
Generating component snapshots
simurai File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@primer/view-components": patch | ||
--- | ||
|
||
Move `Avatar` + `AvatarStack` styles to PVC |
Binary file modified
BIN
-466 Bytes
(80%)
.playwright/screenshots/previews.test.ts-snapshots/primer/beta/avatar/default.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-466 Bytes
(80%)
.playwright/screenshots/previews.test.ts-snapshots/primer/beta/avatar/focused.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* avatar */ | ||
|
||
.avatar { | ||
display: inline-block; | ||
overflow: hidden; /* Ensure page layout in Firefox should images fail to load */ | ||
line-height: 1; | ||
vertical-align: middle; | ||
background-color: var(--color-avatar-bg); /* adds opaque bg to transparent avatars */ | ||
border-radius: var(--primer-borderRadius-medium, 6px); | ||
flex-shrink: 0; | ||
box-shadow: 0 0 0 1px var(--color-avatar-border); | ||
} | ||
|
||
.avatar-link { | ||
float: left; | ||
line-height: 1; | ||
} | ||
|
||
/* User for example on /stars and /user for grids of avatars */ | ||
.avatar-group-item { | ||
display: inline-block; | ||
margin-bottom: 3px; | ||
} | ||
|
||
/* Border radius */ | ||
|
||
.avatar-1, | ||
.avatar-2, | ||
.avatar-small { | ||
border-radius: var(--primer-borderRadius-small, 4px); | ||
} | ||
|
||
/* Sizes */ | ||
|
||
.avatar-1 { | ||
width: var(--base-size-16, 16px); | ||
height: var(--base-size-16, 16px); | ||
} | ||
|
||
.avatar-2 { | ||
width: var(--base-size-20, 20px); | ||
height: var(--base-size-20, 20px); | ||
} | ||
|
||
.avatar-3 { | ||
width: var(--base-size-24, 24px); | ||
height: var(--base-size-24, 24px); | ||
} | ||
|
||
.avatar-4 { | ||
width: var(--base-size-28, 28px); | ||
height: var(--base-size-28, 28px); | ||
} | ||
|
||
.avatar-5 { | ||
width: var(--base-size-32, 32px); | ||
height: var(--base-size-32, 32px); | ||
} | ||
|
||
.avatar-6 { | ||
width: var(--base-size-40, 40px); | ||
height: var(--base-size-40, 40px); | ||
} | ||
|
||
.avatar-7 { | ||
width: var(--base-size-48, 48px); | ||
height: var(--base-size-48, 48px); | ||
} | ||
|
||
.avatar-8 { | ||
width: var(--base-size-64, 64px); | ||
height: var(--base-size-64, 64px); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
/* AvatarStack */ | ||
|
||
/* Stacked avatars can be used to show who is participating in thread when | ||
** there is limited space available. */ | ||
|
||
.AvatarStack { | ||
position: relative; | ||
min-width: 26px; | ||
height: 20px; | ||
|
||
& .AvatarStack-body { | ||
position: absolute; | ||
} | ||
|
||
&.AvatarStack--two { | ||
min-width: 36px; | ||
} | ||
|
||
&.AvatarStack--three-plus { | ||
min-width: 46px; | ||
} | ||
} | ||
|
||
.AvatarStack-body { | ||
display: flex; | ||
background: var(--color-canvas-default); | ||
border-radius: 100px; | ||
|
||
& .avatar { | ||
position: relative; | ||
z-index: 2; | ||
display: flex; | ||
width: 20px; | ||
height: 20px; | ||
box-sizing: content-box; | ||
margin-right: -11px; | ||
background-color: var(--color-canvas-default); | ||
border-right: var(--primer-borderWidth-thin, 1px) solid var(--color-canvas-default); | ||
border-radius: var(--primer-borderRadius-small, 4px); | ||
box-shadow: none; | ||
transition: margin 0.1s ease-in-out; | ||
|
||
&:first-child { | ||
z-index: 3; | ||
} | ||
|
||
&:last-child { | ||
z-index: 1; | ||
border-right: 0; | ||
} | ||
|
||
& img { | ||
border-radius: var(--primer-borderRadius-small, 4px); | ||
} | ||
|
||
/* Account for 4+ avatars */ | ||
&:nth-child(n + 4) { | ||
display: none; | ||
opacity: 0; | ||
} | ||
} | ||
|
||
&:hover { | ||
& .avatar { | ||
margin-right: 3px; | ||
} | ||
|
||
& .avatar:nth-child(n + 4) { | ||
display: flex; | ||
opacity: 1; | ||
} | ||
|
||
& .avatar-more { | ||
display: none !important; | ||
} | ||
} | ||
} | ||
|
||
.avatar.avatar-more { | ||
z-index: 1; | ||
margin-right: 0; | ||
background: var(--color-canvas-subtle); | ||
|
||
&::before, | ||
&::after { | ||
position: absolute; | ||
display: block; | ||
height: 20px; | ||
content: ''; | ||
border-radius: 2px; | ||
outline: var(--primer-borderWidth-thin, 1px) solid var(--color-canvas-default); | ||
} | ||
|
||
&::before { | ||
width: 17px; | ||
background: var(--color-avatar-stack-fade-more); | ||
} | ||
|
||
&::after { | ||
width: 14px; | ||
background: var(--color-avatar-stack-fade); | ||
} | ||
} | ||
|
||
/* Right aligned variation */ | ||
|
||
.AvatarStack--right { | ||
& .AvatarStack-body { | ||
right: 0; | ||
flex-direction: row-reverse; | ||
|
||
&:hover .avatar { | ||
margin-right: 0; | ||
margin-left: 3px; | ||
} | ||
|
||
& .avatar:not(:last-child) { | ||
border-left: 0; | ||
} | ||
} | ||
|
||
& .avatar.avatar-more { | ||
background: var(--color-avatar-stack-fade); | ||
|
||
&::before { | ||
width: 5px; | ||
} | ||
|
||
&::after { | ||
width: 2px; | ||
background: var(--color-canvas-subtle); | ||
} | ||
} | ||
|
||
& .avatar { | ||
margin-right: 0; | ||
margin-left: -11px; | ||
border-right: 0; | ||
border-left: var(--primer-borderWidth-thin, 1px) solid var(--color-canvas-default); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think the Visual differences found is caused by perviously setting the size to
24
(which is not the default).