Apply a gentle highlight on nostr links

This commit is contained in:
Daniele Tonon
2023-06-04 17:06:13 +02:00
parent c47a6ba4f5
commit 7adc9b2f75
4 changed files with 20 additions and 2 deletions

View File

@@ -335,6 +335,15 @@ h1, h2 {
color: #fafafa; color: #fafafa;
border-bottom: 1px solid rgba(250, 250, 250, 0.24); border-bottom: 1px solid rgba(250, 250, 250, 0.24);
} }
.container .column_content .field a.nostr {
border-bottom: none;
}
.theme--default .container .column_content .field a.nostr {
background-color: #fdf0f5;
}
.theme--dark .container .column_content .field a.nostr {
background-color: #42091e;
}
.container .column_content .field .label { .container .column_content .field .label {
font-size: 0.8rem; font-size: 0.8rem;
} }

View File

@@ -26,6 +26,7 @@ $themes: (
boxed-bg: $color-base3, boxed-bg: $color-base3,
over-bg: $color-base3, over-bg: $color-base3,
theme-toggle: $color-base3, theme-toggle: $color-base3,
hrefbg: lighten($color-accent1, 44%),
), ),
dark: ( dark: (
base1: $color-base7, base1: $color-base7,
@@ -44,6 +45,7 @@ $themes: (
boxed-bg: darken($color-base7, 14%), boxed-bg: darken($color-base7, 14%),
over-bg: darken($color-base7, 4%), over-bg: darken($color-base7, 4%),
theme-toggle: $color-base6, theme-toggle: $color-base6,
hrefbg: darken($color-accent1, 38%),
) )
); );
@@ -63,6 +65,7 @@ $boxed-bg-title: 'boxed-bg-title';
$boxed-bg: 'boxed-bg'; $boxed-bg: 'boxed-bg';
$over-bg: 'over-bg'; $over-bg: 'over-bg';
$theme-toggle: 'theme-toggle'; $theme-toggle: 'theme-toggle';
$hrefbg: 'hrefbg';
$theme-map: null; $theme-map: null;
@mixin themed() { @mixin themed() {
@@ -351,6 +354,12 @@ a {
border-bottom: 1px solid rgba( t($base7), .24 ); border-bottom: 1px solid rgba( t($base7), .24 );
} }
} }
a.nostr {
@include themed() {
background-color: t($hrefbg);
}
border-bottom: none;
}
.label { .label {
font-size: 0.8rem; font-size: 0.8rem;
@include themed() { @include themed() {

View File

@@ -63,5 +63,5 @@
{{end}} {{end}}
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="/njump/static/styles.css?v=20230602d" /> <link rel="stylesheet" href="/njump/static/styles.css?v=20230604" />
</head> </head>

View File

@@ -233,7 +233,7 @@ func replaceURLsWithTags(line string) string {
capturedGroup := submatch[2] capturedGroup := submatch[2]
first6 := capturedGroup[:6] first6 := capturedGroup[:6]
last6 := capturedGroup[len(capturedGroup)-6:] last6 := capturedGroup[len(capturedGroup)-6:]
replacement := fmt.Sprintf(`<a href="/%s">%s</a>`, capturedGroup, first6+"…"+last6) replacement := fmt.Sprintf(`<a href="/%s" class="nostr">%s</a>`, capturedGroup, first6+"…"+last6)
return replacement return replacement
}) })