Skip to content

Commit 57f3cc2

Browse files
Add external link icons to messages
Implement CSS styles to display external link icons next to links in messages. Use a GitHub icon for GitHub links and a custom "W" icon for Wikipedia links to clearly indicate external sources. No modifications to JavaScript or TypeScript files were made. [skip gpt_engineer]
1 parent 1e35120 commit 57f3cc2

File tree

1 file changed

+41
-9
lines changed

1 file changed

+41
-9
lines changed

src/index.css

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,49 @@
7373

7474
.chat-message a {
7575
@apply text-blue-300;
76+
position: relative;
77+
padding-right: 1.2em;
78+
}
7679

77-
&:hover {
78-
@apply text-blue-600;
79-
}
80+
/* External link icon for general links */
81+
.chat-message a[href^="http"]::after {
82+
content: "↗";
83+
position: absolute;
84+
right: 0;
85+
top: -0.1em;
86+
font-size: 0.9em;
87+
@apply text-muted-foreground;
88+
}
8089

81-
&:visited {
82-
@apply text-purple-300;
83-
}
90+
/* GitHub icon */
91+
.chat-message a[href*="github.com"]::after {
92+
content: "G";
93+
font-family: monospace;
94+
font-weight: bold;
95+
font-size: 0.8em;
96+
top: 0;
97+
}
8498

85-
&:visited:hover {
86-
@apply text-purple-600;
87-
}
99+
/* Wikipedia icon */
100+
.chat-message a[href*="wikipedia.org"]::after {
101+
content: "W";
102+
font-family: "Times New Roman", serif;
103+
font-style: italic;
104+
font-weight: bold;
105+
font-size: 0.9em;
106+
top: 0;
107+
}
108+
109+
.chat-message a:hover {
110+
@apply text-blue-600;
111+
}
112+
113+
.chat-message a:visited {
114+
@apply text-purple-300;
115+
}
116+
117+
.chat-message a:visited:hover {
118+
@apply text-purple-600;
88119
}
89120

90121
.chat-message > p {
@@ -199,3 +230,4 @@ details > details {
199230
.hljs-number {
200231
@apply text-orange-400;
201232
}
233+

0 commit comments

Comments
 (0)