mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-24 16:58:47 +01:00
Further apply text color to links
This commit is contained in:
parent
d64a363d60
commit
de10faee88
3 changed files with 22 additions and 0 deletions
|
@ -525,6 +525,13 @@
|
|||
.timeline-deck .status .content.truncated ~ .card {
|
||||
display: none;
|
||||
}
|
||||
.status .content a:not(.mention, .has-url-text) {
|
||||
color: var(--link-text-color);
|
||||
}
|
||||
.status .content a:not(.mention, .has-url-text):is(:hover, :focus) {
|
||||
color: var(--text-color);
|
||||
text-decoration-color: var(--link-color);
|
||||
}
|
||||
.status .content p {
|
||||
/* 12px = 75% of 16px */
|
||||
margin-block: min(0.75em, 12px);
|
||||
|
|
|
@ -30,6 +30,11 @@
|
|||
--link-faded-color: #4169e155;
|
||||
--link-bg-hover-color: #f0f2f599;
|
||||
--link-visited-color: mediumslateblue;
|
||||
--link-text-color: color-mix(
|
||||
in lch,
|
||||
var(--link-color) 60%,
|
||||
var(--text-color) 40%
|
||||
);
|
||||
--focus-ring-color: var(--link-color);
|
||||
--button-bg-color: var(--blue-color);
|
||||
--button-bg-blur-color: #4169e1aa;
|
||||
|
|
|
@ -21,6 +21,16 @@ function enhanceContent(content, opts = {}) {
|
|||
});
|
||||
}
|
||||
|
||||
// Add 'has-url-text' to all links that contains a url
|
||||
if (hasLink) {
|
||||
const links = Array.from(dom.querySelectorAll('a[href]'));
|
||||
links.forEach((link) => {
|
||||
if (/^https?:\/\//i.test(link.textContent.trim())) {
|
||||
link.classList.add('has-url-text');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Spanify un-spanned mentions
|
||||
if (hasLink) {
|
||||
const notMentionLinks = Array.from(dom.querySelectorAll('a[href]'));
|
||||
|
|
Loading…
Reference in a new issue