Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
2f1a72f
Copy CSS over from https://github.com/github/github/blob/8d6e8bcea9f4…
Oct 27, 2017
dbf4b84
Rename AvatarStack
Oct 27, 2017
20b3186
Remove container (for now). And Authors 1&2 css.
Oct 27, 2017
db3ef68
Add new AvatarStack to storybook
Oct 27, 2017
e003cd0
lint
Oct 27, 2017
f0393d7
Delete a lot of unnecessary (i think?) CSS
Oct 27, 2017
314b630
cleanup
Oct 27, 2017
ef42395
fix avatar-more styling
califa Oct 31, 2017
e942b6d
implement container and switch classes around
califa Oct 31, 2017
ac78db0
make avatar stacks position absolute, reduce margin
califa Oct 31, 2017
6af7e76
fix linter
califa Nov 1, 2017
bb5bd3b
add specific sizes for avatar count
califa Nov 1, 2017
b3d3ebb
update storybook
califa Nov 1, 2017
0f6465d
remove temp tooltip alignment css back to github/github
califa Nov 2, 2017
e374740
add first version of non-working right aligned modifier
califa Nov 2, 2017
ff7967f
refactor right align modifier, update storybook
califa Nov 2, 2017
a03d4e6
modify spacing so it works with storybook
califa Nov 2, 2017
8cca4f5
white space workaround
califa Nov 2, 2017
9c57895
make ci happy
califa Nov 2, 2017
80fd1fa
flip padding
califa Nov 2, 2017
251036d
refactor css
califa Nov 2, 2017
a73abae
add margins to storybook
califa Nov 2, 2017
2fa1d34
replace inline-block with flexbox
califa Nov 2, 2017
ef0f1e5
re-add last child z-index
califa Nov 3, 2017
da3ae73
remove padding now that avatars have margins
califa Nov 3, 2017
6ab6594
remove unrequired css
califa Nov 3, 2017
081392e
Update README.md
NuttasitBoonwat Nov 4, 2017
9e9d9c1
first draft for new avatar stack docs
califa Nov 6, 2017
7e491e2
move position absolute into container class
broccolini Nov 7, 2017
03a3d75
replace people avatars with octocats in storybook
broccolini Nov 7, 2017
8b99d32
update modifier class names
broccolini Nov 7, 2017
4956549
fix length modifiers
califa Nov 9, 2017
c2a392f
replace employees with octocats, remove redundant alts
califa Nov 13, 2017
8a1074a
Merge branch 'dev' into avatar-stack
jonrohan Nov 13, 2017
9fec40d
Add AvatarStack-body to the readme file
califa Nov 13, 2017
29f2689
Merge branch 'avatar-stack' of github.com:primer/primer-css into avat…
califa Nov 13, 2017
dd641e6
Merge pull request #399 from primer/master
broccolini Nov 14, 2017
ef4ac3e
Merge pull request #385 from primer/avatar-stack
broccolini Nov 14, 2017
5ee6c2b
Merge branch 'master' into dev
jonrohan Nov 14, 2017
fa17932
tweak padding and alignment:
broccolini Nov 15, 2017
562fbd3
remove retina include because isn't needed
broccolini Nov 15, 2017
07a15da
add tooltip alignment options
broccolini Nov 15, 2017
47dee2c
add tooltip stories
broccolini Nov 15, 2017
c0ae6d0
add alignment example to docs
broccolini Nov 15, 2017
73f81d7
add toc, fix heading sizes, and re-org docs
broccolini Nov 15, 2017
18c27bd
remove transparency from tooltips:
broccolini Nov 15, 2017
2d00828
Merge branch 'dev' into patch-1
jonrohan Nov 15, 2017
2c266f5
Merge branch 'dev' into patch-1
jonrohan Nov 15, 2017
79e0d79
Merge branch 'dev' into release-10.1.0
jonrohan Nov 15, 2017
7af254d
Merge pull request #391 from NuttasitBoonwat/patch-1
jonrohan Nov 15, 2017
a830f2c
Changing shields.io url to https
jonrohan Nov 15, 2017
59b72d6
Adding deprecation warning about .avatar-stack
jonrohan Nov 15, 2017
7872868
Merge pull request #405 from primer/deprecate_avatar_stack
jonrohan Nov 15, 2017
f7b1ec7
update readme example with caret variations
broccolini Nov 15, 2017
00f6644
Merge pull request #404 from primer/brocs/tooltips_fix
broccolini Nov 15, 2017
e43f2f4
update changelog
broccolini Nov 15, 2017
1ea2e5f
removing temp tooltip
jonrohan Nov 15, 2017
09d50e6
Publish
jonrohan Nov 15, 2017
18166a0
Temp in readme
jonrohan Nov 15, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
## 10.1.0 (2017-11-15)

#### :rocket: Enhancement
* [#385](https://github.com/primer/primer/pull/385) New Avatar stack. ([@califa](https://github.com/califa) & [@sophshep](https://github.com/sophshep))
* [#404](https://github.com/primer/primer/pull/404) Tooltip component updates ([@broccolini](https://github.com/broccolini))

#### :memo: Documentation
* [#405](https://github.com/primer/primer/pull/405) Add deprecation warning for `.avatar-stack`. ([@jonrohan](https://github.com/jonrohan))
* [#391](https://github.com/primer/primer/pull/391) Update shields.io url to https. ([@NuttasitBoonwat](https://github.com/NuttasitBoonwat))

#### Committers: 5
- Diana Mounter ([broccolini](https://github.com/broccolini))
- Joel Califa ([califa](https://github.com/califa))
- Jon Rohan ([jonrohan](https://github.com/jonrohan))
- Sophie Shepherd ([sophshep](https://github.com/sophshep))
- [NuttasitBoonwat](https://github.com/NuttasitBoonwat)

# 10.0.1 (2017-11-14)

#### :bug: Bug Fix
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Primer

[![npm version](http://img.shields.io/npm/v/primer.svg)](https://www.npmjs.org/package/primer)
[![npm version](https://img.shields.io/npm/v/primer.svg)](https://www.npmjs.org/package/primer)
[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer)

Primer is the design system that powers GitHub. Primer includes 23 packages that are grouped into 3 core meta-packages for easy install. Each package and meta-package is independently versioned and distributed via npm, so it's easy to include all or part of Primer within your own project.
Expand All @@ -13,10 +13,10 @@ The Primer repo is managed as a monorepo that is composed of many npm packages.

| Package | Version |
|---|---|
| **[primer](/modules/primer)** <br />Includes all 23 packages | [![npm](http://img.shields.io/npm/v/primer.svg)](https://www.npmjs.com/package/primer) |
| [primer-core](/modules/primer-core) | [![npm](http://img.shields.io/npm/v/primer-core.svg)](https://www.npmjs.com/package/primer-core) |
| [primer-product](/modules/primer-product) | [![npm](http://img.shields.io/npm/v/primer-product.svg)](https://www.npmjs.com/package/primer-product) |
| [primer-marketing](/modules/primer-marketing) | [![npm](http://img.shields.io/npm/v/primer-marketing.svg)](https://www.npmjs.com/package/primer-marketing) |
| **[primer](/modules/primer)** <br />Includes all 23 packages | [![npm](https://img.shields.io/npm/v/primer.svg)](https://www.npmjs.com/package/primer) |
| [primer-core](/modules/primer-core) | [![npm](https://img.shields.io/npm/v/primer-core.svg)](https://www.npmjs.com/package/primer-core) |
| [primer-product](/modules/primer-product) | [![npm](https://img.shields.io/npm/v/primer-product.svg)](https://www.npmjs.com/package/primer-product) |
| [primer-marketing](/modules/primer-marketing) | [![npm](https://img.shields.io/npm/v/primer-marketing.svg)](https://www.npmjs.com/package/primer-marketing) |

## Install

Expand Down
2 changes: 1 addition & 1 deletion modules/primer-alerts/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Primer Alerts

[![npm version](http://img.shields.io/npm/v/primer-alerts.svg)](https://www.npmjs.org/package/primer-alerts)
[![npm version](https://img.shields.io/npm/v/primer-alerts.svg)](https://www.npmjs.org/package/primer-alerts)
[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer)

> Flash messages, or alerts, inform users of successful or pending actions. Use them sparingly. Don’t show more than one at a time.
Expand Down
4 changes: 2 additions & 2 deletions modules/primer-alerts/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.5.2",
"version": "1.5.3",
"name": "primer-alerts",
"description": "Flash messages, or alerts, inform users of successful or pending actions.",
"homepage": "http://primer.github.io/",
Expand Down Expand Up @@ -27,7 +27,7 @@
"test": "../../script/npm-run-all build lint"
},
"dependencies": {
"primer-support": "4.4.2"
"primer-support": "4.5.0"
},
"keywords": [
"alerts",
Expand Down
62 changes: 55 additions & 7 deletions modules/primer-avatars/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Primer Avatars

[![npm version](http://img.shields.io/npm/v/primer-avatars.svg)](https://www.npmjs.org/package/primer-avatars)
[![npm version](https://img.shields.io/npm/v/primer-avatars.svg)](https://www.npmjs.org/package/primer-avatars)
[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer)

> Avatars are images that users can set as their profile picture. On GitHub, they’re always going to be rounded squares. They can be custom photos, uploaded by users, or generated as Identicons as a placeholder.
Expand Down Expand Up @@ -75,14 +75,62 @@ When you need a larger parent avatar, and a smaller child one, overlaid slightly

### Avatar stack

Stacked avatars can be used to show who is participating in thread when there is limited space available. When you hover over the stack, the avatars will reveal themselves. Optimally, you should put no more than 3 avatars in the stack.
Stacked avatars can be used to show multiple collaborators or participants when there is limited space available. When you hover over the stack, the avatars will reveal themselves.

```html
<span class="avatar-stack tooltipped tooltipped-s" aria-label="jonrohan, aaronshekey, and josh">
<img alt="@jonrohan" class="avatar" height="39" alt="jonrohan" src="/jonrohan.png" width="39">
<img alt="@aaronshekey" class="avatar" height="39" alt="aaronshekey" src="/aaronshekey.png" width="39">
<img alt="@josh" class="avatar" height="39" alt="josh" src="/josh.png" width="39">
</span>
<div class="AvatarStack AvatarStack--three-plus">
<div class="AvatarStack-body tooltipped tooltipped-se tooltipped-align-left-1" aria-label="octocat, octocat, and octocat">
<img class="avatar" height="20" alt="@octocat" src="https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png" width="20">
<img class="avatar" height="20" alt="@octocat" src="https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png" width="20">
<img class="avatar" height="20" alt="@octocat" src="https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png" width="20">
</div>
</div>
```

Based on the number of avatars in the stack, add these modifier classes:
- `AvatarStack--two` for 2 avatars.
- `AvatarStack--three-plus` for 3 or more avatars.

If you have more than three avatars, add a div with the classes `avatar avatar-more` as the third avatar in the stack, as such:

```html
<div class="AvatarStack AvatarStack--three-plus">
<div class="AvatarStack-body tooltipped tooltipped-se tooltipped-align-left-1" aria-label="octocat, octocat, octocat, octocat, and octocat">
<img class="avatar" height="20" alt="@octocat" src="https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png" width="20">
<img class="avatar" height="20" alt="@octocat" src="https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png" width="20">
<div class="avatar avatar-more"></div>
<img class="avatar" height="20" alt="@octocat" src="https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png" width="20">
<img class="avatar" height="20" alt="@octocat" src="https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png" width="20">
<img class="avatar" height="20" alt="@octocat" src="https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png" width="20">
</div>
</div>
```

You can also link individual avatars. To do this shift the `avatar` class over to the anchor:

```html
<div class="AvatarStack AvatarStack--two">
<div class="AvatarStack-body tooltipped tooltipped-se tooltipped-align-left-1" aria-label="octocat and octocat">
<a href="#" class="avatar">
<img height="20" alt="@octocat" src="https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png" width="20">
</a>
<a href="#" class="avatar">
<img height="20" alt="@octocat" src="https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png" width="20">
</a>
</div>
</div>
```

Use `AvatarStack--right` to right-align the avatar stack. Remember to switch the alignment of tooltips when making this change.

```html
<div class="AvatarStack AvatarStack--three-plus AvatarStack--right">
<div class="AvatarStack-body tooltipped tooltipped-sw tooltipped-align-right-1" aria-label="octocat, octocat, and octocat">
<img class="avatar" height="20" alt="@octocat" src="https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png" width="20">
<img class="avatar" height="20" alt="@octocat" src="https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png" width="20">
<img class="avatar" height="20" alt="@octocat" src="https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png" width="20">
</div>
</div>
```

## Circle Badge
Expand Down
136 changes: 136 additions & 0 deletions modules/primer-avatars/lib/avatar-stack.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// there is limited space available.
//
// No styleguide references
@warn ".avatar-stack will be deprecated in version 11. Use .AvatarStack instead.";

.avatar-stack {
display: inline-block;
white-space: nowrap;
Expand Down Expand Up @@ -43,3 +45,137 @@
}
}
}

// Refactored, new avatar stack:

.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: $bg-white;

.avatar {
position: relative;
z-index: 2;
display: flex;
width: 20px;
height: 20px;
box-sizing: content-box;
margin-right: -11px;
background-color: $bg-white;
border-right: $border-width $border-style $white;
border-radius: 2px;
transition: margin 0.1s ease-in-out;

&:first-child {
z-index: 3;
}

&:last-child {
z-index: 1;
}

// stylelint-disable selector-max-type
img {
border-radius: 2px;
}
// stylelint-enable selector-max-type

// 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: $gray-100;

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

&::before {
width: 17px;
background: $gray-200;
}

&::after {
width: 14px;
background: $gray-300;
}
}

// Right aligned variation

.AvatarStack--right {
.AvatarStack-body {
right: 0;
flex-direction: row-reverse;

&:hover .avatar {
margin-right: 0;
margin-left: 3px;
}
}

.avatar.avatar-more {
background: $gray-300;

&::before {
width: 5px;
}

&::after {
width: 2px;
background: $gray-100;
}
}

.avatar {
margin-right: 0;
margin-left: -11px;
border-right: 0;
border-left: $border-width $border-style $white;
}
}
4 changes: 2 additions & 2 deletions modules/primer-avatars/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.4.2",
"version": "1.5.0",
"name": "primer-avatars",
"description": "Basic styles for user profile avatars.",
"homepage": "http://primer.github.io/",
Expand Down Expand Up @@ -27,7 +27,7 @@
"test": "../../script/npm-run-all build lint"
},
"dependencies": {
"primer-support": "4.4.2"
"primer-support": "4.5.0"
},
"keywords": [
"avatars",
Expand Down
37 changes: 37 additions & 0 deletions modules/primer-avatars/stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,43 @@ storiesOf('Avatars', module)
</div>

))
.add('AvatarStack', () => (
<div>
<div className='AvatarStack AvatarStack-three-plus mb-2'>
<div className='AvatarStack-body tooltipped tooltipped-se tooltipped-align-left-1' 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>
<div className='AvatarStack AvatarStack-two mb-2'>
<div className='AvatarStack-body tooltipped tooltipped-se tooltipped-align-left-1' 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>
<div className='AvatarStack AvatarStack-three-plus AvatarStack--right mb-2'>
<div className='AvatarStack-body tooltipped tooltipped-sw tooltipped-align-right-1' 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>
<div className='AvatarStack AvatarStack-two AvatarStack--right mb-2'>
<div className='AvatarStack-body tooltipped tooltipped-sw tooltipped-align-right-1' 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>

</div>
))
.add('CircleBadge--small', () => (
<div>
<a className='CircleBadge CircleBadge--small' href='#url' title='Travis CI'>
Expand Down
2 changes: 1 addition & 1 deletion modules/primer-base/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Primer Base

[![npm version](http://img.shields.io/npm/v/primer-base.svg)](https://www.npmjs.org/package/primer-base)
[![npm version](https://img.shields.io/npm/v/primer-base.svg)](https://www.npmjs.org/package/primer-base)
[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer)

> GitHub's CSS to reset the browsers default styles. Built on top of normalize.css
Expand Down
4 changes: 2 additions & 2 deletions modules/primer-base/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.6.0",
"version": "1.6.1",
"name": "primer-base",
"description": "CSS to reset the browsers default styles",
"homepage": "http://primer.github.io/",
Expand Down Expand Up @@ -27,7 +27,7 @@
"test": "../../script/npm-run-all build lint"
},
"dependencies": {
"primer-support": "4.4.2"
"primer-support": "4.5.0"
},
"keywords": [
"primer",
Expand Down
2 changes: 1 addition & 1 deletion modules/primer-blankslate/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Primer Blankslate

[![npm version](http://img.shields.io/npm/v/primer-blankslate.svg)](https://www.npmjs.org/package/primer-blankslate)
[![npm version](https://img.shields.io/npm/v/primer-blankslate.svg)](https://www.npmjs.org/package/primer-blankslate)
[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer)

> Blankslates are for when there is a lack of content within a page or section. Use them as placeholders to tell users why something isn’t there. Be sure to provide an action to add content as well.
Expand Down
4 changes: 2 additions & 2 deletions modules/primer-blankslate/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.4.2",
"version": "1.4.3",
"name": "primer-blankslate",
"description": "Blankslates are for when there is a lack of content within a page or section.",
"homepage": "http://primer.github.io/",
Expand Down Expand Up @@ -27,7 +27,7 @@
"test": "../../script/npm-run-all build lint"
},
"dependencies": {
"primer-support": "4.4.2"
"primer-support": "4.5.0"
},
"keywords": [
"primer",
Expand Down
Loading