Skip to content

Commit

Permalink
Delete a lot of unnecessary (i think?) CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
Sophie Shepherd committed Oct 27, 2017
1 parent e003cd0 commit f0393d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 deletions.
21 changes: 2 additions & 19 deletions modules/primer-avatars/lib/avatar-stack.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@
// Refactored, new avatar stack:

.AvatarStack {
position: absolute;
padding-right: 5px;
background: $bg-white;
background: inherit;

.avatar {
position: relative;
Expand Down Expand Up @@ -80,24 +78,16 @@
}
// stylelint-enable selector-max-type

&:nth-child(3) {
z-index: 1;
}

// Account for 4+ avatars
&:nth-child(n+4) {
z-index: 0;
display: none;
margin-left: -15px;
opacity: 0;
}
}

&:hover .avatar:nth-child(n+4) {
display: inline-block;
margin-left: 0;
opacity: 1;
transition: opacity 0.1s, margin-left 0.1s;
}

&:hover .avatar {
Expand All @@ -106,25 +96,18 @@
}

.avatar.avatar-more {
z-index: 1;
margin-right: 0;
background: $gray-100;

&::before,
&::after {
position: absolute;
display: block;
height: 20px;
content: "";
border-radius: 2px;
outline: $border-width $border-style $white;
}

&::before {
z-index: 2;
width: 14px;
background: $gray-300;
}

&::after {
width: 17px;
background: $gray-200;
Expand Down
6 changes: 5 additions & 1 deletion modules/primer-avatars/stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,18 @@ storiesOf('Avatars', module)
))
.add('AvatarStack', () => (
<div>
<div className='AvatarStack tooltipped tooltipped-se temp-tooltipped-align-left' aria-label='califa, sophshep, jonrohan, and broccolini'>
<div className='AvatarStack tooltipped tooltipped-se temp-tooltipped-align-left' aria-label='five avatars'>
<img className='avatar' alt='Uncle Cat' width='20' height='20' src='https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png'/>
<img className='avatar' alt='Uncle Cat' width='20' height='20' src='https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png'/>
<div className='avatar-more avatar'></div>
<img className='avatar' alt='Uncle Cat' width='20' height='20' src='https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png'/>
<img className='avatar' alt='Uncle Cat' width='20' height='20' src='https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png'/>
<img className='avatar' alt='Uncle Cat' width='20' height='20' src='https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png'/>
</div>
<div className='AvatarStack tooltipped tooltipped-se temp-tooltipped-align-left' aria-label='two avatars'>
<img className='avatar' alt='Uncle Cat' width='20' height='20' src='https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png'/>
<img className='avatar' alt='Uncle Cat' width='20' height='20' src='https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png'/>
</div>
</div>
))
.add('CircleBadge--small', () => (
Expand Down

0 comments on commit f0393d7

Please sign in to comment.