File tree Expand file tree Collapse file tree 3 files changed +45
-33
lines changed Expand file tree Collapse file tree 3 files changed +45
-33
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ const CodePreview = ({ language = "markdown", code }: Props) => {
40
40
language = { language }
41
41
style = { theme === "dark" ? oneDark : oneLight }
42
42
wrapLines = { true }
43
- customStyle = { { margin : "0" , maxHeight : "20rem " } }
43
+ customStyle = { { margin : "0" , maxHeight : "32rem " } }
44
44
>
45
45
{ code }
46
46
</ SyntaxHighlighter >
Original file line number Diff line number Diff line change @@ -61,29 +61,31 @@ const SnippetModal: React.FC<Props> = ({
61
61
< CloseIcon />
62
62
</ Button >
63
63
</ div >
64
- < CodePreview language = { slugify ( language ) } code = { snippet . code } />
65
- < p >
66
- < b > Description: </ b >
67
- { snippet . description }
68
- </ p >
69
- < p >
70
- Contributed by{ " " }
71
- < a
72
- href = { `https://github.com/${ snippet . author } ` }
73
- target = "_blank"
74
- rel = "noopener noreferrer"
75
- className = "styled-link"
76
- >
77
- @{ snippet . author }
78
- </ a >
79
- </ p >
80
- < ul role = "list" className = "modal__tags" >
81
- { snippet . tags . map ( ( tag ) => (
82
- < li key = { tag } className = "modal__tag" >
83
- { tag }
84
- </ li >
85
- ) ) }
86
- </ ul >
64
+ < div className = "modal__body | flow" >
65
+ < CodePreview language = { slugify ( language ) } code = { snippet . code } />
66
+ < p >
67
+ < b > Description: </ b >
68
+ { snippet . description }
69
+ </ p >
70
+ < p >
71
+ Contributed by{ " " }
72
+ < a
73
+ href = { `https://github.com/${ snippet . author } ` }
74
+ target = "_blank"
75
+ rel = "noopener noreferrer"
76
+ className = "styled-link"
77
+ >
78
+ @{ snippet . author }
79
+ </ a >
80
+ </ p >
81
+ < ul role = "list" className = "modal__tags" >
82
+ { snippet . tags . map ( ( tag ) => (
83
+ < li key = { tag } className = "modal__tag" >
84
+ { tag }
85
+ </ li >
86
+ ) ) }
87
+ </ ul >
88
+ </ div >
87
89
</ motion . div >
88
90
</ motion . div > ,
89
91
modalRoot
Original file line number Diff line number Diff line change @@ -577,22 +577,19 @@ abbr {
577
577
border-radius : var (--br-lg );
578
578
padding : 0.75em ;
579
579
text-align : start;
580
- filter : grayscale (100% );
581
580
582
581
& : is (: hover , : focus-visible ) {
583
- outline : 3px solid var (--clr-border-primary );
584
- filter : grayscale (0 );
582
+ outline : 2px solid var (--clr-border-primary );
585
583
}
586
584
}
587
585
588
586
.snippet__preview {
589
587
width : 100% ;
590
588
overflow : hidden;
591
- aspect-ratio : 10 / 3 ;
589
+ aspect-ratio : 9 / 3 ;
592
590
background-color : var (--clr-bg-secondary );
593
591
/* background-image: var(--gradient-secondary); */
594
592
border : 1px solid var (--clr-border-primary );
595
- border-radius : var (--br-md );
596
593
position : relative;
597
594
padding-inline : 1em ;
598
595
display : grid;
@@ -626,20 +623,33 @@ body:has(.modal-overlay) {
626
623
627
624
.modal {
628
625
background-color : var (--clr-bg-secondary );
629
- padding : 2 rem ;
630
- width : 90 % ;
631
- max-width : 800 px ;
626
+ width : fit-content ;
627
+ max- width: 1000 px ;
628
+ max-height : 90 % ;
632
629
border-radius : var (--br-lg );
633
630
box-shadow : 0 4px 12px rgba (0 , 0 , 0 , 0.3 );
631
+ gap : 0 ;
634
632
position : relative;
635
- gap : 1 rem ;
633
+ overflow : auto ;
636
634
}
637
635
638
636
.modal__header {
637
+ z-index : 50 ;
639
638
display : flex;
639
+ position : sticky;
640
+ top : 0 ;
640
641
align-items : center;
641
642
justify-content : space-between;
642
643
gap : 1rem ;
644
+ padding : 1rem 1.5rem ;
645
+ background-color : var (--clr-bg-secondary );
646
+ border-radius : var (--br-lg );
647
+ }
648
+
649
+ .modal__body {
650
+ padding : 1.5rem ;
651
+ padding-top : 0 ;
652
+ gap : 1rem ;
643
653
}
644
654
645
655
.code-preview {
You can’t perform that action at this time.
0 commit comments