Skip to content

Commit

Permalink
fix: remove additional whitespace generated
Browse files Browse the repository at this point in the history
Links on the resume page had additional whitespace surrounding `<span>`
elements, making the underline on the anchor elements look weird.
Similar issue with the `<summary>` elements.

Since `@astrojs/[email protected]`, Astro preserves whitespace before
compacting; see withastro/compiler#893 for more details and links to
other issues.

To address this change without refactoring all the HTML onto a single
line to avoid creating whitespace-only text nodes inside an
inline-formatting context, set the display to `flex`. For information on
how whitespace is handled by HTML and CSS, see this article on MDN:
https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Whitespace
  • Loading branch information
sanman1k98 committed Dec 14, 2023
1 parent 3b87e44 commit cfb6615
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/pages/resume/_components/BaseEntry.astro
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if (entry) {
<h3 class="leading-snug font-600 text-slate-700 text-lg tracking-tight">
{link ? (
<a
class="group decoration-current decoration-1 link"
class="group flex max-w-fit decoration-current decoration-1 link"
href={link}
target="_blank"
>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/resume/_components/Contact.astro
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const { class: className } = Astro.props;
const { text, icon, ...attrs } = link;
return (
<li>
<a { ...attrs }>
<a class="flex justify-end content-center" { ...attrs }>
<span class="hidden sm:inline">{text}</span>
<Icon name={icon} label={text} class="print:hidden ml-1"/>
</a>
Expand Down
4 changes: 1 addition & 3 deletions src/pages/resume/_components/SkillDetails.astro
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ const { Content } = await entry.render();
</style>

<details class:list={["", className]}>
<summary class="text-lg font-600 cursor-pointer">
{entry.data.category}
</summary>
<summary class="text-lg font-600 cursor-pointer">{entry.data.category}</summary>
<Content />
</details>

0 comments on commit cfb6615

Please sign in to comment.