Avatar
A component that stylizes images for use as avatars. This component provides a handful of different avatar styles and sizes.
Install
npm install seed-avatar --save
Dependencies
Example
<div class="c-avatar">
<img src="/images/seed.png" class="c-avatar__image">
</div>
Modifiers
Rounded
<div class="c-avatar c-avatar--rounded">
<img src="/images/seed.png" class="c-avatar__image">
</div>
Sizes
All of the following sizes support responsive modifiers.
Modifier class | Avatar size |
---|---|
.c-avatar--xs |
28px |
.c-avatar--sm |
32px |
.c-avatar--md |
40px |
.c-avatar--lg |
50px |
<div class="c-avatar c-avatar--xs">
<img src="/images/seed.png" class="c-avatar__image">
</div>
Configurations
Below are the default Sass configuration variables for seed-avatar. The variables can be found in the pack’s _config.scss
file.
seed-avatar/_config.scss
// Namespaces
$seed-avatar-namespace: "c-avatar" !default;
$seed-avatar-image-namespace: #{$seed-avatar-namespace}__image !default;
// Borders
$seed-avatar-border-radius: 4px !default;
// Colors
$seed-avatar-background: #f1f3f5 !default;
$seed-avatar-shadow: 0 1px 0 0 #e3e8eb !default;
// Sizes
// Default size
$seed-avatar-size: 50px !default;
// Modifier sizes
$seed-avatar-modifier-sizes: (
lg: $seed-avatar-size,
md: 40px,
sm: 32px,
xs: 28px
) !default;