zu 0.3.3

Yew web components, implementing Material Design
Documentation
// Copyright (c) 2024 Xu Shaohua <shaohua@biofan.org>. All rights reserved.
// Use of this source is governed by Lesser General Public License
// that can be found in the LICENSE file.


// Styles for Avatar

// Styles applied to the root element.
.ZuAvatar-root {
  position: relative;
  overflow: hidden;

  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;

  font-family: $zu-typography-fontFamily;
  font-size: 20px;
  line-height: 1;

  user-select: none;
}

// Styles applied to the root element if not src or srcSet.
.ZuAvatar-colorDefault {
  color: $zu-palette-background-default;
  background-color: $zu-avatar-colorDefaultBg;
}

// Styles applied to the root element if variant="circular".
.ZuAvatar-circular {
  border-radius: 50%;
}

// Styles applied to the root element if variant="rounded".
.ZuAvatar-rounded {
  border-radius: $zu-shape-borderRadius;
}

// Styles applied to the root element if variant="square".
.ZuAvatar-square {
  border-radius: 0;
}

// Styles applied to the img element if either src or srcSet is defined.
.ZuAvatar-img {
  width: 100%;
  height: 100%;
  // Handle non-square image.
  object-fit: cover;

  text-align: center;
  // Hide the image broken icon, only works on Chrome.
  text-indent: 10000px;

  // Hide alt text.
  color: transparent;
}

// Styles applied to the fallback icon
.ZuAvatar-fallback {
  width: 75%;
  height: 75%;
}