Security News
JavaScript Leaders Demand Oracle Release the JavaScript Trademark
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
primer-avatars
Advanced tools
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.
This repository is a module of the full primer-css repository.
This repository is distributed with npm. After installing npm, you can install primer-avatars
with this command.
$ npm install --save primer-avatars
The source files included are written in Sass (scss
) You can simply point your sass include-path
at your node_modules
directory and import it like this.
@import "primer-avatars/index.scss";
You can also import specific portions of the module by importing those partials from the /lib/
folder. Make sure you import any requirements along with the modules.
For a compiled css version of this module, a npm script is included that will output a css version to build/build.css
The built css file is also included in the npm package.
$ npm run build
You can read more about other primer modules in the full primer docs.
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.
Add .avatar
to any <img>
element to make it an avatar. This resets some key styles for alignment, address a Firefox image placeholder bug, and rounds the corners.
Be sure to set width
and height
attributes for maximum browser performance.
<img class="avatar" src="/jonrohan.png?v=3&s=144" width="72" height="72">
We occasionally use smaller avatars. Anything less than 48px
wide should include the .avatar-small
modifier class to reset the border-radius
to a more appropriate level.
<img class="avatar avatar-small" src="/jonrohan.png?v=3&s=64" width="32" height="32">
When you need a larger parent avatar, and a smaller child one, overlaid slightly, use the parent-child classes.
<div class="avatar-parent-child float-left">
<img class="avatar" src="/jonrohan.png?v=3&s=96" width="48" height="48">
<img class="avatar avatar-child" src="/josh.png?v=3&s=40" width="20" height="20">
</div>
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.
<span class="avatar-stack tooltipped tooltipped-s" aria-label="jonrohan, aaronshekey, and josh">
<img alt="@jonrohan" class="avatar" height="39" src="/jonrohan.png" width="39">
<img alt="@aaronshekey" class="avatar" height="39" src="/aaronshekey.png" width="39">
<img alt="@josh" class="avatar" height="39" src="/josh.png" width="39">
</span>
FAQs
Basic styles for user profile avatars.
The npm package primer-avatars receives a total of 3,362 weekly downloads. As such, primer-avatars popularity was classified as popular.
We found that primer-avatars demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 14 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.