You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
VaAvatar is currently generate an img tag, which is sensitive to aspect ratio of the source image. So, when it's not 1:1, it is impossible to use VaAvatar component because it deforms image.
However, there is a best-practice for this case to use background-image style property with background-size: cover, background-position: center center instead of img tag. So, i think VaAvatar component should be refactored for properly displayed non-square images.
Best regards to all the contribute team!
The text was updated successfully, but these errors were encountered:
Accessibility: The img tag provides better accessibility features out-of-the-box, including the alt attribute for alternative text, which screen readers use to describe the image to visually impaired users.
SEO: Search engines can index images with proper alt text, improving SEO.
Responsive Design: img tags are easier to work with when it comes to responsive design. They can be styled with CSS for different screen sizes.
Loading: Browsers optimize the loading of img tags, including lazy loading in modern browsers.
Disadvantages:
Styling: Some complex styling (e.g., overlay text or complex positioning) might be trickier with img tags compared to using background images.
Using background-image on a Block Element
Advantages:
Complex Layouts: Easier to overlay text or other elements on top of the image since it’s just a background.
Consistent Sizing: Can be easier to maintain consistent sizing and positioning of the background image across different elements.
Fallbacks: You can define multiple fallback images for different screen sizes using media queries.
Disadvantages:
Accessibility: Requires more effort to make it accessible (e.g., adding aria-label or visually hidden text).
SEO: Background images are not indexed by search engines, so you miss out on SEO benefits.
For me in most cases using the img tag is preferable due to its accessibility, SEO benefits, and responsive handling.
Vuestic-ui version: 1.9.8
Description
VaAvatar is currently generate an
img
tag, which is sensitive to aspect ratio of the source image. So, when it's not 1:1, it is impossible to use VaAvatar component because it deforms image.However, there is a best-practice for this case to use
background-image
style property withbackground-size: cover, background-position: center center
instead ofimg
tag. So, i think VaAvatar component should be refactored for properly displayed non-square images.Best regards to all the contribute team!
The text was updated successfully, but these errors were encountered: