Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/components/EducationResource/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ const authorHTML = (await Astro.slots.render("author")).replace(/\<p[^\>]*\>/gm,
<div set:html={authorHTML} />
<slot name="description" />
</div>
<div class="text-sm leading-8 [&_a]:whitespace-nowrap [&_a]:rounded-full [&_a]:mr-1 [&_a]:py-1 [&_a]:px-2 [&_a]:outline [&_a]:outline-1 [&_a]:outline-[var(--type-magenta-dark)]">
<!-- Materials render as outlined pills, so drop the persistent underline
that .rendered-markdown links get, but keep the hover underline. The
!important is needed to beat .rendered-markdown, and would otherwise
kill :hover too -- hence the second utility. -->
<div class="text-sm leading-8 [&_a]:whitespace-nowrap [&_a]:rounded-full [&_a]:mr-1 [&_a]:py-1 [&_a]:px-2 [&_a]:outline-1 [&_a]:outline-(--type-magenta-dark) [&_a]:no-underline! [&_a]:hover:underline!">
<slot name="materials" />
</div>
</div>
Expand Down
14 changes: 3 additions & 11 deletions src/layouts/AboutLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const displayedFeaturedPeople = sortedFeaturedPeople.slice(0, 6);
>
</section>

<section>
<section class="text-link">
<h2 id="contact">{t("Contact")}</h2>
<div
class="text-2xl grid grid-cols-6 lg:grid-cols-9 gap-x-gutter-sm md:gap-x-gutter-md mt-xl"
Expand All @@ -106,7 +106,7 @@ const displayedFeaturedPeople = sortedFeaturedPeople.slice(0, 6);
</div>
</div>
</section>
<section>
<section class="text-link">
<h2 id="supporters">Supporters</h2>
<ul class="text-2xl mt-xl">
<li>
Expand All @@ -123,7 +123,7 @@ const displayedFeaturedPeople = sortedFeaturedPeople.slice(0, 6);
<li><a href="https://www.usebutter.com/">Butter</a></li>
</ul>
</section>
<section>
<section class="text-link">
<h2 id="processing-foundation">The Processing Ecosystem</h2>
<ul class="text-2xl mt-xl">
<li><a href="https://processing.org">Processing</a></li>
Expand All @@ -135,11 +135,3 @@ const displayedFeaturedPeople = sortedFeaturedPeople.slice(0, 6);
</ul>
</section>
</BaseLayout>

<style lang="scss">
@reference "../../styles/global.css";

a {
@apply text-type-magenta-dark;
}
</style>
4 changes: 2 additions & 2 deletions src/layouts/ReferenceItemLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ function normalizeP5ReferenceLinks(html: string | undefined): string | undefined
return (
<div
set:html={part}
class="[&_a]:text-type-magenta-dark [&_a]:!decoration-type-magenta-dark mb-xl reference-item rendered-markdown"
class="mb-xl reference-item rendered-markdown"
/>
);
}
Expand Down Expand Up @@ -326,7 +326,7 @@ function normalizeP5ReferenceLinks(html: string | undefined): string | undefined
{
entry.data.file && entry.data.line &&(
<div class="my-xl">
<div class="text-body [&_a]:text-type-magenta-dark [&_a]:!decoration-type-magenta-dark my-lg">
<div class="text-body text-link my-lg">
Notice any errors or typos? <a href={`https://github.com/${githubRepo}/issues`}>Please let us know</a>. Please feel free to edit
<a
href={`https://github.com/${githubRepo}/blob/${githubRef}/${entry.data.file}#L${entry.data.line}`}
Expand Down
10 changes: 3 additions & 7 deletions src/layouts/SketchLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,9 @@ const iframeTitle = `OpenProcessing Sketch: ${title} by ${authorName}`;

{instructions && <p class="text-md my-sm md:my-lg">{instructions}</p>}

<p class="text-xs md:text-base mb-3xl">
This <a class="text-type-magenta" href={makeSketchLinkUrl(sketchIdNumber)}
>sketch</a
> is ported from the <a
class="text-type-magenta"
href="https://openprocessing.org">OpenProcessing</a
>
<p class="text-xs md:text-base mb-3xl text-link">

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: This updates the color to a slightly darker shade of magenta in light mode. I made this change to better align with the design across the rest of the site, but please let me know if you’d prefer to stick with the original shade. Thanks!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems fine to me!

This <a href={makeSketchLinkUrl(sketchIdNumber)}>sketch</a> is ported from
the <a href="https://openprocessing.org">OpenProcessing</a>
sketch archive.
</p>
</div>
Expand Down
17 changes: 17 additions & 0 deletions styles/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,23 @@ a {
}
}

// Single source of truth for links styled as text rather than as a button.
// The color and the underline live together here so the two can't drift apart.
// Put .text-link on a link itself, or on any container to style every link
// inside it. Markdown-generated content gets the treatment automatically.
a.text-link:not(.button-link),
.text-link a:not(.button-link),
.rendered-markdown a:not(.button-link) {
color: var(--type-magenta-dark);
text-decoration: underline;
text-decoration-color: var(--type-magenta-dark);

.dark-theme & {
color: var(--type-magenta);
text-decoration-color: var(--type-magenta);
}
}

code {
@extend .text-body-mono;
font-size: inherit;
Expand Down
12 changes: 1 addition & 11 deletions styles/markdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@
max-width: variables.$breakpoint-tablet;
}

a {
color: var(--type-magenta-dark);
text-decoration-color: var(--type-magenta-dark);

.dark-theme & {
color: var(--type-magenta);
text-decoration-color: var(--type-magenta);
}
}

a.button-link {
margin-top: var(--spacing-md);
min-width: 180px;
Expand Down Expand Up @@ -114,4 +104,4 @@ html[lang="ko"] .rendered-markdown {
line-height: 1.7;
// Prevent awkward Korean line breaks
word-break: keep-all;
}
}