diff --git a/docs/componenti/avatar.md b/docs/componenti/avatar.md
index 184eaaa75c..618892ba61 100644
--- a/docs/componenti/avatar.md
+++ b/docs/componenti/avatar.md
@@ -222,14 +222,14 @@ Lista verticale di Avatar di dimensione piccola con classe `.size-sm`.
-
-
+
Mario Rossi
-
-
+
diff --git a/src/scss/custom/_avatar.scss b/src/scss/custom/_avatar.scss
index f9571411a8..4092a9f19f 100644
--- a/src/scss/custom/_avatar.scss
+++ b/src/scss/custom/_avatar.scss
@@ -12,7 +12,7 @@
color: $color-text-secondary; // UI kit
box-sizing: content-box;
transition: background-color 0.2s;
- // image
+
img {
width: 100%;
height: 100%;
@@ -21,7 +21,7 @@
transition: filter 0.2s;
border-radius: 50%;
}
- // text
+
p {
font-size: 1rem; // default size equals to md
margin: 0;
@@ -29,28 +29,32 @@
line-height: 1em;
position: absolute;
}
- // icon
+
.icon {
height: 16px; // default size equals to md
width: 16px;
}
- //color variants----------------------------------------- START
&.avatar-primary {
background: $primary;
}
+
&.avatar-secondary {
background: $secondary;
}
+
&.avatar-green {
background: $green;
}
+
&.avatar-orange {
background: $orange;
}
+
&.avatar-red {
background: $red;
}
+
&.avatar-primary,
&.avatar-secondary,
&.avatar-green,
@@ -58,12 +62,11 @@
&.avatar-red {
color: $white;
}
- //color variants----------------------------------------- END
- //dropdown variant--------------------------------------- START
&.avatar-dropdown {
overflow: visible;
position: relative;
+
.dropdown {
position: absolute;
top: 0;
@@ -75,200 +78,239 @@
align-items: center;
height: 100%;
}
+
.btn-dropdown {
color: inherit;
padding: 0;
line-height: 0;
font-size: 0.75rem;
}
+
.list-item {
display: flex;
align-items: center;
padding: 0 16px;
font-size: 0.875rem;
}
+
.link-list {
+ white-space: nowrap;
+
span {
line-height: 1em;
}
+
li {
margin-bottom: 16px;
&:last-child {
margin-bottom: 0;
}
}
- white-space: nowrap;
+
.avatar {
margin-right: 16px;
+
&.size-sm {
margin-right: 12px;
}
+
p {
color: $white !important;
}
}
}
+
.dropdown-menu {
margin-left: -27px !important;
}
}
- //dropdown variant-------------------------------------- END
- //size variants----------------------------------------- START
&.size-xs {
width: $avatar-base-size * 2;
height: $avatar-base-size * 2;
+
p {
font-size: 0.625rem;
}
+
.icon {
height: 10px;
width: 10px;
}
}
+
&.size-sm {
width: $avatar-base-size * 3;
height: $avatar-base-size * 3;
+
p {
font-size: 0.875rem;
}
+
.icon {
height: 12px;
width: 12px;
}
}
+
&.size-md {
width: $avatar-base-size * 4;
height: $avatar-base-size * 4;
+
p {
font-size: 1rem;
}
+
.icon {
height: 16px;
width: 16px;
}
+
.avatar-presence,
.avatar-status {
border-width: 1px;
+
.icon {
display: none;
}
}
}
+
&.size-lg {
width: $avatar-base-size * 5;
height: $avatar-base-size * 5;
+
p {
font-size: 1.125rem;
}
+
.icon {
height: 20px;
width: 20px;
}
+
.avatar-presence,
.avatar-status {
right: -2px;
width: 15px;
height: 15px;
}
+
.avatar-status {
top: math.div($avatar-base-size, 48);
}
}
+
&.size-xl {
width: $avatar-base-size * 10;
height: $avatar-base-size * 10;
+
p {
font-size: 2.25rem;
}
+
.icon {
height: 40px;
width: 40px;
}
+
.avatar-presence,
.avatar-status {
right: 6px;
width: 18px;
height: 18px;
}
+
.avatar-presence {
bottom: $avatar-base-size;
}
+
.avatar-status {
top: $avatar-base-size * 0.25;
}
}
+
&.size-xxl {
width: $avatar-base-size * 16;
height: $avatar-base-size * 16;
+
p {
font-size: 58px;
}
+
.icon {
height: 62px;
width: 62px;
}
+
.avatar-presence,
.avatar-status {
right: 4px;
width: 24px;
height: 24px;
+
.icon {
width: 20px;
height: 20px;
}
}
+
.avatar-presence {
bottom: $avatar-base-size * 2;
}
+
.avatar-status {
top: $avatar-base-size;
}
}
- //size variants----------------------------------------- END
}
-//hover & focus states
a.avatar {
filter: brightness(100%);
- //position: relative;
+
&:hover {
+ background: shade-color($color-background-secondary-lighter, 5%);
+
img {
filter: brightness(90%);
}
- background: shade-color($color-background-secondary-lighter, 5%);
+
&.avatar-primary {
background: shade-color($primary, 5%);
}
+
&.avatar-secondary {
background: shade-color($secondary, 5%);
}
+
&.avatar-green {
background: shade-color($green, 5%);
}
+
&.avatar-orange {
background: shade-color($orange, 5%);
}
+
&.avatar-red {
background: shade-color($red, 12%);
}
}
}
+
.avatar-dropdown {
&:hover,
&:focus-within {
background: shade-color($color-background-secondary-lighter, 5%);
}
+
.btn-dropdown:focus {
box-shadow: none;
}
}
-//wrapper for status, presence and extra text -------------- START
.avatar-wrapper {
position: relative;
- //presence and status - common properties
.avatar-presence,
.avatar-status {
position: absolute;
@@ -282,7 +324,7 @@ a.avatar {
display: flex;
justify-content: center;
align-items: center;
- //icon
+
.icon {
width: 18px;
height: 18px;
@@ -291,15 +333,17 @@ a.avatar {
}
}
- //presence
.avatar-presence {
bottom: $avatar-base-size;
+
&.active {
background: $green;
}
+
&.busy {
background: $red;
}
+
&.hidden {
&:after {
content: '';
@@ -315,21 +359,22 @@ a.avatar {
}
}
- //status
.avatar-status {
top: 0;
+
&.approved {
background: $green;
}
+
&.declined {
background: $red;
}
+
&.notify {
background: $primary-b1;
}
}
- //extra text version
&.avatar-extra-text {
display: inline-flex;
justify-content: flex-start;
@@ -340,27 +385,21 @@ a.avatar {
flex-shrink: 0;
}
- a {
- text-decoration: none;
- }
-
- //text
.extra-text {
line-height: 1.2em;
margin-left: 16px;
+
h3,
h4 {
font-weight: 600;
margin: 0;
font-size: 1.125rem;
+
a {
display: inline-block;
- text-decoration: none;
- &:hover {
- text-decoration: underline;
- }
}
}
+
p,
time {
margin: 0;
@@ -370,9 +409,7 @@ a.avatar {
}
}
}
-//wrapper for status, presence and extra text -------------- START
-// inline group -------------------------------------------- START
.avatar-group {
& > li {
margin-bottom: 16px;
@@ -380,7 +417,7 @@ a.avatar {
&:last-child {
margin-bottom: 0;
}
- // link
+
.list-item {
display: inline-flex;
align-items: center;
@@ -388,10 +425,11 @@ a.avatar {
line-height: 1em;
.avatar {
margin-right: 12px;
- //reset color & font size for avatar
+
p {
font-size: 1rem;
}
+
&.avatar-primary,
&.avatar-secondary,
&.avatar-green,
@@ -403,17 +441,20 @@ a.avatar {
}
}
}
+
span {
margin: 0;
font-size: 0.875rem;
font-weight: 600;
}
}
+
+ a.list-item span {
+ text-decoration: underline;
+ }
}
}
-// inline group -------------------------------------------- END
-// stacked group ------------------------------------------- START
.avatar-group-stacked {
display: flex;
justify-content: flex-start;
@@ -430,4 +471,3 @@ a.avatar {
}
}
}
-// stacked group ------------------------------------------- END