File tree Expand file tree Collapse file tree 4 files changed +61
-1
lines changed
packages/main/src/compoments Expand file tree Collapse file tree 4 files changed +61
-1
lines changed Original file line number Diff line number Diff line change 1- 22
1+ 23
Original file line number Diff line number Diff line change @@ -300,6 +300,28 @@ <h2>Form elements</h2>
300300 </ button >
301301 </ form >
302302 </ section >
303+ < section id ="avatar ">
304+ < h2 > Avatar</ h2 >
305+ < p >
306+ Avatar images are styled automatically when alt text contains
307+ "avatar" or "profile":
308+ </ p >
309+ < div >
310+ < img src ="https://picsum.photos/id/237/150 " alt ="User avatar " />
311+ < img src ="https://picsum.photos/id/238/150 " alt ="Profile picture " />
312+ < img src ="https://picsum.photos/id/239/150 " alt ="John's avatar " />
313+ < img
314+ src ="https://picsum.photos/id/236/150 "
315+ alt ="Team member profile "
316+ />
317+ </ div >
318+ < p > Avatars work in different contexts like navigation and content:</ p >
319+ < p >
320+ < img src ="https://picsum.photos/id/235/150 " alt ="Author avatar " />
321+ Written by < strong > Alex Johnson</ strong > - This article was written
322+ by our lead developer.
323+ </ p >
324+ </ section >
303325 < section id ="modal ">
304326 < h2 > Modal</ h2 >
305327 < button class ="contrast " onclick ="modalExample.showModal() ">
Original file line number Diff line number Diff line change 1+ img [alt* ="avatar" i],
2+ img [alt* ="profile" i] {
3+ border : 1px solid var (--border );
4+ border-radius : 50% ;
5+ width : 2.5rem ;
6+ height : 2.5rem ;
7+ object-fit : cover ;
8+ }
9+
10+ /* Fallback for missing images */
11+ img [alt* ="avatar" i]:not ([src ]),
12+ img [alt* ="profile" i]:not ([src ]) {
13+ display : inline-flex ;
14+ justify-content : center ;
15+ align-items : center ;
16+ background : var (--background-secondary );
17+ color : var (--color-muted );
18+ font-weight : 500 ;
19+ font-size : 0.875rem ;
20+ }
21+
22+ /* Style for broken/loading images */
23+ img [alt* ="avatar" i]::after ,
24+ img [alt* ="profile" i]::after {
25+ display : flex ;
26+ justify-content : center ;
27+ align-items : center ;
28+ background : var (--background-secondary );
29+ width : 100% ;
30+ height : 100% ;
31+ content : attr (alt );
32+ color : var (--color-muted );
33+ font-weight : 500 ;
34+ font-size : 0.75rem ;
35+ line-height : 1 ;
36+ text-align : center ;
37+ }
Original file line number Diff line number Diff line change 1414@use " form" ;
1515@use " blog" ;
1616@use " tabs" ;
17+ @use " avatar" ;
You can’t perform that action at this time.
0 commit comments