diff --git a/.changeset/angry-wasps-sip.md b/.changeset/angry-wasps-sip.md new file mode 100644 index 000000000..d3db4bbd9 --- /dev/null +++ b/.changeset/angry-wasps-sip.md @@ -0,0 +1,5 @@ +--- +'@cloudfour/patterns': minor +--- + +Add small size modifier and design token to Avatar diff --git a/src/components/avatar/avatar.scss b/src/components/avatar/avatar.scss index 15e1e7b23..8f675be36 100644 --- a/src/components/avatar/avatar.scss +++ b/src/components/avatar/avatar.scss @@ -36,9 +36,13 @@ } /** - * Full-width modifier + * Size modifiers */ +.c-avatar--small { + width: size.$square-avatar-small; +} + .c-avatar--full { width: size.$square-avatar-full; } diff --git a/src/components/avatar/avatar.stories.mdx b/src/components/avatar/avatar.stories.mdx index 8420b6ca2..4aed8af35 100644 --- a/src/components/avatar/avatar.stories.mdx +++ b/src/components/avatar/avatar.stories.mdx @@ -47,9 +47,35 @@ The size is fixed to the value of [our `sizes.$avatar-medium` token by default]( +## Small + +The `c-avatar--small` modifier sizes the avatar down to the value of our `sizes.$avatar-small` token. This may be useful when accompanying a single line of text or showing many avatars in a condensed space. + + + + {avatarStory.bind({})} + + + {avatarStory.bind({})} + + + ## Full Width -The `c-avatar--full` modifier sizes the component to `100%` of its container. +The `c-avatar--full` modifier sizes the component to `100%` of its container width.