11// Avatar Mixins
2- @use " ../tokens" as * ;
3- @use " typography" as * ;
4- @use " layout" as * ;
2+ @use ' ../tokens' as * ;
3+ @use ' typography' as * ;
4+ @use ' layout' as * ;
55
66@mixin tutor-avatar-base {
7- @include tutor-flex-center ;
8- position : relative ;
9- border-radius : $tutor-radius-full ;
10- overflow : hidden ;
11- background-color : $tutor-button-primary-soft ;
12- color : $tutor-text-primary ;
13- flex-shrink : 0 ;
14- user-select : none ;
7+ @include tutor-flex-center ;
8+ position : relative ;
9+ border-radius : $tutor-radius-full ;
10+ overflow : hidden ;
11+ background-color : $tutor-button-primary-soft ;
12+ color : $tutor-text-primary ;
13+ flex-shrink : 0 ;
14+ user-select : none ;
1515}
1616
1717@mixin tutor-avatar-image {
18- width : 100% ;
19- height : 100% ;
20- object-fit : cover ;
18+ width : 100% ;
19+ height : 100% ;
20+ object-fit : cover ;
21+ aspect-ratio : 1 / 1 ;
2122}
2223
2324@mixin tutor-avatar-initials {
24- @include tutor-typography (' small' , ' medium' );
25- color : inherit ;
26- text-transform : uppercase ;
27- letter-spacing : 0.5px ;
25+ @include tutor-typography (' small' , ' medium' );
26+ color : inherit ;
27+ text-transform : uppercase ;
28+ letter-spacing : 0.5px ;
2829}
2930
3031// Avatar sizes map
3132$tutor-avatar-sizes : (
32- 20 : (
33- font-size : ' tiny' ,
34- icon-size : 12px
35- ),
36- 24 : (
37- font-size : ' tiny' ,
38- icon-size : 12px
39- ),
40- 32 : (
41- font-size : ' tiny' ,
42- icon-size : 16px
43- ),
44- 40 : (
45- font-size : ' small' ,
46- icon-size : 20px
47- ),
48- 48 : (
49- font-size : ' small' ,
50- icon-size : 24px
51- ),
52- 56 : (
53- font-size : ' medium' ,
54- icon-size : 28px
55- ),
56- 64 : (
57- font-size : ' medium' ,
58- icon-size : 32px
59- ),
60- 80 : (
61- font-size : $tutor-font-size-h4 ,
62- icon-size : 40px
63- ),
64- 104 : (
65- font-size : $tutor-font-size-h3 ,
66- icon-size : 48px
67- )
33+ 20 : (
34+ font-size : ' tiny' ,
35+ icon-size : 12px ,
36+ ),
37+ 24 : (
38+ font-size : ' tiny' ,
39+ icon-size : 12px ,
40+ ),
41+ 32 : (
42+ font-size : ' tiny' ,
43+ icon-size : 16px ,
44+ ),
45+ 40 : (
46+ font-size : ' small' ,
47+ icon-size : 20px ,
48+ ),
49+ 48 : (
50+ font-size : ' small' ,
51+ icon-size : 24px ,
52+ ),
53+ 56 : (
54+ font-size : ' medium' ,
55+ icon-size : 28px ,
56+ ),
57+ 64 : (
58+ font-size : ' medium' ,
59+ icon-size : 32px ,
60+ ),
61+ 80 : (
62+ font-size : $tutor-font-size-h4 ,
63+ icon-size : 40px ,
64+ ),
65+ 104 : (
66+ font-size : $tutor-font-size-h3 ,
67+ icon-size : 48px ,
68+ ),
6869);
6970
7071@mixin tutor-avatar-size ($size ) {
71- @if map-has-key ($tutor-avatar-sizes , $size ) {
72- $config : map-get ($tutor-avatar-sizes , $size );
73- $font-size : map-get ($config , font-size );
74- $icon-size : map-get ($config , icon-size );
72+ @if map-has-key ($tutor-avatar-sizes , $size ) {
73+ $config : map-get ($tutor-avatar-sizes , $size );
74+ $font-size : map-get ($config , font-size );
75+ $icon-size : map-get ($config , icon-size );
7576
76- width : #{$size } px;
77- height : #{$size } px;
77+ width : #{$size } px;
78+ height : #{$size } px;
7879
79- .tutor-avatar-initials {
80- @if type-of ($font-size ) == ' string' {
81- @include tutor-typography ($font-size , ' medium' );
82- } @else {
83- font-size : $font-size ;
84- font-weight : $tutor-font-weight-medium ;
85- }
86- }
80+ .tutor-avatar-initials {
81+ @if type-of ($font-size ) == ' string' {
82+ @include tutor-typography ($font-size , ' medium' );
83+ } @else {
84+ font-size : $font-size ;
85+ font-weight : $tutor-font-weight-medium ;
86+ }
87+ }
8788
88- svg {
89- width : $icon-size ;
90- height : $icon-size ;
91- }
92- }
89+ svg {
90+ width : $icon-size ;
91+ height : $icon-size ;
92+ }
93+ }
9394}
9495
9596// Avatar variants
9697@mixin tutor-avatar-variant ($variant : default ) {
97- @if $variant == square {
98- border-radius : $tutor-radius-md ;
99-
100- svg ,
101- .tutor-avatar-image {
102- border-radius : $tutor-radius-md ;
103- }
104- } @else if $variant == icon {
105- background-color : $tutor-surface-brand-tertiary ;
106- color : $tutor-text-secondary ;
107-
108- & :hover {
109- background-color : $tutor-actions-brand-tertiary ;
110- color : $tutor-actions-brand-primary ;
111- }
112- } @else if $variant == border {
113- border : 2px solid $tutor-surface-l2 ;
114- svg ,
115- .tutor-avatar-image {
116- border-radius : 0px ;
117- }
118- }
119- }
98+ @if $variant == square {
99+ border-radius : $tutor-radius-md ;
100+
101+ svg ,
102+ .tutor-avatar-image {
103+ border-radius : $tutor-radius-md ;
104+ }
105+ } @else if $variant == icon {
106+ background-color : $tutor-surface-brand-tertiary ;
107+ color : $tutor-text-secondary ;
108+
109+ & :hover {
110+ background-color : $tutor-actions-brand-tertiary ;
111+ color : $tutor-actions-brand-primary ;
112+ }
113+ } @else if $variant == border {
114+ border : 2px solid $tutor-surface-l2 ;
115+ svg ,
116+ .tutor-avatar-image {
117+ border-radius : 0px ;
118+ }
119+ }
120+ }
0 commit comments