Skip to content

Commit 9711d07

Browse files
committed
navigation external links indicator icon and padding tweaks
1 parent bb542bc commit 9711d07

File tree

2 files changed

+65
-7
lines changed

2 files changed

+65
-7
lines changed

src/components/base/Footer.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import LogoFull from "/public/svg/logo-full.svg?raw";
2121
{colItem.external && (
2222
<svg
2323
xmlns="http://www.w3.org/2000/svg"
24-
width="12"
25-
height="13"
24+
width="9"
25+
height="9"
2626
viewBox="0 0 12 13"
2727
fill="none"
2828
>
@@ -111,7 +111,7 @@ import LogoFull from "/public/svg/logo-full.svg?raw";
111111
column-gap: 5px;
112112

113113
span {
114-
min-width: 92px;
114+
//min-width: 92px;
115115
text-align: left;
116116
}
117117

src/components/base/Navigation.astro

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,27 @@ const { activeSlug } = Astro.props;
2525
class:list={[
2626
{
2727
active: activeSlug === item.url,
28+
external: item.external,
2829
},
2930
]}
3031
>
3132
<span>{item.display}</span>
33+
{item.external && (
34+
<svg
35+
xmlns="http://www.w3.org/2000/svg"
36+
width="9"
37+
height="9"
38+
viewBox="0 0 12 13"
39+
fill="none"
40+
>
41+
<path
42+
fill-rule="evenodd"
43+
clip-rule="evenodd"
44+
d="M0 0.5H4V1.83333H1.33333V11.1667H10.6667V8.5H12V12.5H0V0.5ZM9.72386 1.83333H7.77778V0.5H12V4.72222H10.6667V2.77614L6.4714 6.9714L5.5286 6.0286L9.72386 1.83333Z"
45+
style={{ fill: "var(--text-body-primary)" }}
46+
/>
47+
</svg>
48+
)}
3249
</a>
3350
</li>
3451
))
@@ -78,10 +95,27 @@ const { activeSlug } = Astro.props;
7895
class:list={[
7996
{
8097
active: activeSlug === item.url,
98+
external: item.external,
8199
},
82100
]}
83101
>
84102
<span>{item.display}</span>
103+
{item.external && (
104+
<svg
105+
xmlns="http://www.w3.org/2000/svg"
106+
width="9"
107+
height="9"
108+
viewBox="0 0 12 13"
109+
fill="none"
110+
>
111+
<path
112+
fill-rule="evenodd"
113+
clip-rule="evenodd"
114+
d="M0 0.5H4V1.83333H1.33333V11.1667H10.6667V8.5H12V12.5H0V0.5ZM9.72386 1.83333H7.77778V0.5H12V4.72222H10.6667V2.77614L6.4714 6.9714L5.5286 6.0286L9.72386 1.83333Z"
115+
style={{ fill: "var(--text-body-primary)" }}
116+
/>
117+
</svg>
118+
)}
85119
</a>
86120
</li>
87121
))
@@ -149,11 +183,23 @@ const { activeSlug } = Astro.props;
149183
font-size: 18px;
150184
border-left: 1px solid transparent;
151185
box-sizing: border-box;
152-
padding: 5px 20px;
186+
padding: 5px 10px;
153187

154188
&.active {
155189
border-left-color: var(--text-body-primary);
156190
}
191+
192+
&.external {
193+
display: flex;
194+
flex-flow: row;
195+
align-items: center;
196+
justify-content: flex-start;
197+
column-gap: 5px;
198+
199+
svg {
200+
user-select: none;
201+
}
202+
}
157203
}
158204
}
159205
}
@@ -203,7 +249,7 @@ const { activeSlug } = Astro.props;
203249
#desktop-nav {
204250
// vars
205251
--main-padding: 12px 32px;
206-
--items-gap: 0px;
252+
--items-gap: 10px;
207253
display: none;
208254
background-color: var(--surface-frame-bg);
209255
z-index: 4;
@@ -226,7 +272,7 @@ const { activeSlug } = Astro.props;
226272

227273
@include break-up(xl) {
228274
--main-padding: 12px 64px;
229-
//--items-gap: 32px;
275+
--items-gap: 32px;
230276
}
231277

232278
.nav-logo {
@@ -257,7 +303,7 @@ const { activeSlug } = Astro.props;
257303
align-items: center;
258304
justify-content: center;
259305
text-decoration: none;
260-
padding: 5px 20px;
306+
padding: 5px 10px;
261307
height: 31px;
262308
border-top: 1px solid transparent;
263309
border-bottom: 1px solid transparent;
@@ -276,6 +322,18 @@ const { activeSlug } = Astro.props;
276322
&.active {
277323
border-top-color: var(--text-body-primary);
278324
}
325+
326+
&.external {
327+
display: flex;
328+
flex-flow: row;
329+
align-items: center;
330+
justify-content: center;
331+
column-gap: 5px;
332+
333+
svg {
334+
user-select: none;
335+
}
336+
}
279337
}
280338
}
281339
}

0 commit comments

Comments
 (0)