@@ -41,8 +41,21 @@ const Pre: React.FC<Props> = ({
41
41
42
42
const showFileNamePanel = showPanel && ! ! title
43
43
44
+ const isBash = highlighted . lang === 'shellscript'
45
+
44
46
return (
45
47
< >
48
+ { isBash && ! showFileNamePanel && (
49
+ < div className = "relative flex h-9 items-center justify-start pr-12 font-display text-2xs text-zinc-300 sm:text-xs" >
50
+ { /* one-off breakpoint to hide the filename on extremely narrow screens - to avoid interfering with the lang select */ }
51
+ < div className = "relative flex h-full items-center justify-center gap-x-1 px-4" >
52
+ < div className = "size-[6px] rounded-full bg-zinc-300/10" />
53
+ < div className = "size-[6px] rounded-full bg-zinc-300/10" />
54
+ < div className = "size-[6px] rounded-full bg-zinc-300/10" />
55
+ </ div >
56
+ < div className = "absolute bottom-0 h-[1px] w-full bg-zinc-300/5" />
57
+ </ div >
58
+ ) }
46
59
{ showFileNamePanel && (
47
60
< div className = "relative flex h-10 items-center justify-start pr-12 font-display text-2xs text-zinc-300 sm:text-xs" >
48
61
{ /* one-off breakpoint to hide the filename on extremely narrow screens - to avoid interfering with the lang select */ }
@@ -55,13 +68,16 @@ const Pre: React.FC<Props> = ({
55
68
< div className = "absolute bottom-0 h-[1px] w-full bg-zinc-300/5" />
56
69
</ div >
57
70
) }
58
- < CopyButton code = { highlighted . code } showPanel = { showPanel } />
71
+ < CopyButton
72
+ code = { highlighted . code }
73
+ className = { cn ( showFileNamePanel && 'top-12' , isBash && 'top-11' ) }
74
+ />
59
75
< CodeHikePre
60
76
code = { highlighted }
61
77
handlers = { handlers }
62
78
className = { cn (
63
79
'overflow-auto overscroll-x-contain p-4' ,
64
- showPanel && ! title && 'pt-8 ' , // add padding to ensure the code doesn't touch the top of the panel
80
+ showPanel && ! title && 'pt-7 ' , // add padding to ensure the code doesn't touch the top of the panel
65
81
className ,
66
82
) }
67
83
style = { {
0 commit comments