fix: enforce css overwrite for raw links (#36)

This commit is contained in:
Robert Kaussow 2021-05-23 15:09:01 +02:00 committed by GitHub
parent 14502ab963
commit 18e0e7577a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 16 deletions

View File

@ -1,3 +1,3 @@
{{- $raw := or (hasPrefix .Text "<img") (hasPrefix .Text "<figure") -}} {{- $raw := or (hasPrefix .Text "<img") (hasPrefix .Text "<figure") -}}
<a class="gblog-post__link{{ if $raw }}--raw{{ end }}" href="{{ .Destination | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}>{{ .Text | safeHTML }}</a> <a class="gblog-markdown__link{{ if $raw }}--raw{{ end }}" href="{{ .Destination | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}>{{ .Text | safeHTML }}</a>
{{- /* Drop trailing newlines */ -}} {{- /* Drop trailing newlines */ -}}

View File

@ -15,7 +15,7 @@
<div class="flex justify-center"> <div class="flex justify-center">
<figure class="gblog-post__figure"> <figure class="gblog-post__figure">
<a class="gblog-post__link--raw" href="{{ .RelPermalink }}"> <a class="gblog-markdown__link--raw" href="{{ .RelPermalink }}">
<img <img
{{ if $lazyLoad }}loading="lazy"{{ end }} {{ if $lazyLoad }}loading="lazy"{{ end }}
{{ with $customSize }} {{ with $customSize }}

View File

@ -333,20 +333,6 @@ img {
font-size: 1.2em; font-size: 1.2em;
} }
} }
&__link--raw {
text-decoration: none;
color: $body-font-color;
&:hover {
background: none;
color: $body-font-color;
}
&:visited {
color: $body-font-color;
}
}
} }
.gblog-footer { .gblog-footer {

View File

@ -25,6 +25,21 @@
border-radius: $border-radius; border-radius: $border-radius;
} }
&__link--raw {
text-decoration: none !important;
color: $body-font-color !important;
&:hover {
background: none !important;
color: $body-font-color !important;
text-decoration: none !important;
}
&:visited {
color: $body-font-color !important;
}
}
blockquote { blockquote {
margin: $padding-16 0; margin: $padding-16 0;
padding: $padding-8 $padding-16 $padding-8 ($padding-16 - $padding-4); //to keep total left space 16dp padding: $padding-8 $padding-16 $padding-8 ($padding-16 - $padding-4); //to keep total left space 16dp