Skip to content

Commit

Permalink
avatar no longer resizes when adding a size prop
Browse files Browse the repository at this point in the history
  • Loading branch information
nickamantia committed Feb 1, 2022
1 parent 4748d05 commit 8ef0406
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion playbook/app/pb_kits/playbook/pb_avatar/_avatar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const Avatar = (props: AvatarProps) => {
const dataProps = buildDataProps(data)
const ariaProps = buildAriaProps(aria)
const classes = classnames(
buildCss('pb_avatar_kit', size),
buildCss('pb_avatar_kit', `size_${size}`),
globalProps(props),
className
)
Expand Down
4 changes: 2 additions & 2 deletions playbook/app/pb_kits/playbook/pb_avatar/_avatar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ $avatar-sizes: (
position: relative;

@each $name, $size in $avatar-sizes {
&[class*=_#{$name}],
&[class*=_#{$name}_thumb] {
&[class*=_size_#{$name}],
&[class*=_size_#{$name}_thumb] {
width: $size;
height: $size;
object-fit: cover;
Expand Down
2 changes: 1 addition & 1 deletion playbook/app/pb_kits/playbook/pb_avatar/avatar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def initials
end

def classname
generate_classname("pb_avatar_kit", size)
generate_classname("pb_avatar_kit", "size_#{size}")
end

def online_status_props
Expand Down

0 comments on commit 8ef0406

Please # to comment.