Browse Source

fix(avatar): position absolute (#774)

走鹃 3 years ago
parent
commit
b4dd5a87b2

+ 2 - 7
packages/semi-foundation/avatar/avatar.scss

@@ -24,12 +24,7 @@ $colors: "amber", "blue", "cyan", "green", "grey", "indigo", "light-blue", "ligh
     }
 
     &-content {
-        position: absolute;
         user-select: none;
-        left: 50%;
-        top: 50%;
-        transform: translate(-50%, -50%);
-        transform-origin: center;
     }
 
     &-extra-extra-small {
@@ -38,7 +33,7 @@ $colors: "amber", "blue", "cyan", "green", "grey", "indigo", "light-blue", "ligh
 
         .#{$module}-content {
             transform-origin: center;
-            transform: scale(.8) translate(-62.5%, -62.5%);
+            transform: scale(0.8);
         }
 
         .#{$module}-label {
@@ -53,7 +48,7 @@ $colors: "amber", "blue", "cyan", "green", "grey", "indigo", "light-blue", "ligh
 
         .#{$module}-content {
             transform-origin: center;
-            transform: scale(.8) translate(-62.5%, -62.5%);
+            transform: scale(0.8);
         }
 
         .#{$module}-label {

+ 2 - 8
packages/semi-foundation/avatar/rtl.scss

@@ -4,22 +4,16 @@ $module: #{$prefix}-avatar;
 .#{$prefix}-portal-rtl {
     .#{$module} {
         direction: rtl;
-        
-        &-content {
-            left: auto;
-            right: 50%;
-            transform: translate(50%, -50%);
-        }
 
         &-extra-extra-small {
             .#{$module}-content {
-                transform: scale(.8) translate(62.5%, -62.5%);
+                transform: scale(0.8);
             }
         }
 
         &-extra-small {
             .#{$module}-content {
-                transform: scale(.8) translate(62.5%, -62.5%);
+                transform: scale(0.8);
             }
         }