Extract all external link styling into a component

This commit is contained in:
Rūdolfs Ošiņš
2023-11-15 16:34:17 +01:00
parent 2bd1893504
commit c7027c1f2f
8 changed files with 61 additions and 33 deletions
-6
View File
@@ -128,12 +128,6 @@ p {
.txt-missing {
color: var(--color-foreground-dim);
}
.txt-link {
text-decoration: none;
}
.txt-link:hover {
color: var(--color-fill-primary);
}
.txt-emoji {
height: 1em;
width: 1em;
+8 -6
View File
@@ -30,13 +30,16 @@
gap: 1.5rem;
}
.radworks {
display: flex;
.logo {
color: var(--color-foreground-contrast);
}
.radworks:hover {
color: var(--color-fill-primary);
a {
display: flex;
}
a:hover {
color: var(--color-fill-secondary);
}
</style>
@@ -44,9 +47,9 @@
<div class="left">
<span class="layout-desktop">Supported by</span>
<a
class="logo"
target="_blank"
rel="noreferrer"
class="radworks"
href="https://radworks.org">
<RadworksLogo />
</a>
@@ -74,7 +77,6 @@
style:gap="0.25rem"
target="_blank"
rel="noreferrer"
class="txt-link"
href="https://radicle.xyz">
radicle.xyz
<IconSmall name="arrow-box-up-right" />
+3 -2
View File
@@ -1,5 +1,6 @@
<script lang="ts">
import Command from "./Command.svelte";
import ExternalLink from "./ExternalLink.svelte";
import Icon from "./Icon.svelte";
export let message: string;
@@ -33,9 +34,9 @@
If you need help resolving this issue, copy the error message
<br />
below and send it to us on
<a class="txt-link" href="https://radicle.zulipchat.com/" target="_blank">
<ExternalLink href="https://radicle.zulipchat.com">
radicle.zulipchat.com
</a>
</ExternalLink>
</div>
<div style:max-width="25rem">
<Command
+36
View File
@@ -0,0 +1,36 @@
<script lang="ts">
import IconSmall from "./IconSmall.svelte";
export let href: string;
</script>
<style>
a {
font-weight: var(--font-weight-semibold);
display: inline-flex;
align-items: center;
gap: 0.25rem;
text-decoration: none;
box-shadow: 0 1px 0 0 var(--color-foreground-contrast);
}
a:hover {
color: var(--color-fill-secondary);
box-shadow: 0 1px 0 0 var(--color-fill-secondary);
}
.icon {
color: var(--color-foreground-gray);
position: relative;
bottom: 1px;
}
a:hover .icon {
color: var(--color-fill-secondary-hover);
}
</style>
<a {href} target="_blank" rel="noreferrer">
<slot>{href}</slot>
<span class="icon"><IconSmall name="arrow-box-up-right" /></span>
</a>
+3 -2
View File
@@ -1,5 +1,6 @@
<script lang="ts">
import Command from "./Command.svelte";
import ExternalLink from "./ExternalLink.svelte";
import Icon from "./Icon.svelte";
export let title: string;
@@ -34,9 +35,9 @@
If you need help resolving this issue, copy the error message
<br />
below and send it to us on
<a class="txt-link" href="https://radicle.zulipchat.com/" target="_blank">
<ExternalLink href="https://radicle.zulipchat.com">
radicle.zulipchat.com
</a>
</ExternalLink>
</div>
</div>
+4 -3
View File
@@ -1,7 +1,8 @@
<script lang="ts">
import Command from "@app/components/Command.svelte";
import Modal from "@app/components/Modal.svelte";
import ExternalLink from "@app/components/ExternalLink.svelte";
import Icon from "@app/components/Icon.svelte";
import Modal from "@app/components/Modal.svelte";
export let title: string;
export let subtitle: string[];
@@ -20,9 +21,9 @@
If you need help resolving this issue, copy the error message
<br />
below and send it to us on
<a class="txt-link" href="https://radicle.zulipchat.com/" target="_blank">
<ExternalLink href="https://radicle.zulipchat.com">
radicle.zulipchat.com
</a>
</ExternalLink>
</div>
<div slot="body">
+4 -8
View File
@@ -6,8 +6,9 @@
import Button from "@app/components/Button.svelte";
import Command from "@app/components/Command.svelte";
import Popover from "@app/components/Popover.svelte";
import ExternalLink from "@app/components/ExternalLink.svelte";
import Icon from "@app/components/Icon.svelte";
import Popover from "@app/components/Popover.svelte";
export let baseUrl: BaseUrl;
export let id: string;
@@ -47,13 +48,8 @@
<div slot="popover" style:width="24rem">
<div style:margin-bottom="1.5rem">
<label for="rad-clone-url">
Use the <a
target="_blank"
rel="noreferrer"
href="https://radicle.xyz/#try"
class="txt-link txt-bold">
Radicle CLI
</a>
Use the
<ExternalLink href="https://radicle.xyz/#try">Radicle CLI</ExternalLink>
to clone this project.
</label>
<Command command={radCloneUrl} />
+3 -6
View File
@@ -3,6 +3,7 @@
import Button from "@app/components/Button.svelte";
import Command from "@app/components/Command.svelte";
import ExternalLink from "@app/components/ExternalLink.svelte";
import IconSmall from "@app/components/IconSmall.svelte";
import Popover from "@app/components/Popover.svelte";
@@ -59,13 +60,9 @@
<div slot="popover" style:width="31rem">
<div class="track-label">
Use the <a
target="_blank"
rel="noreferrer"
href="https://radicle.xyz/#try"
class="txt-link txt-bold">
Use the <ExternalLink href="https://radicle.xyz/#try">
Radicle CLI
</a>
</ExternalLink>
to {command} this project.
{#if command === "track"}
<br />